| 1 |
<?php |
| 2 |
|
| 3 |
// Select docs page |
| 4 |
$args = array( |
| 5 |
'post_type' => 'topic', |
| 6 |
'posts_per_page' => 1, |
| 7 |
'orderby' => 'menu_order', |
| 8 |
'order' => 'desc' |
| 9 |
); |
| 10 |
|
| 11 |
$topic_permalink = ''; |
| 12 |
foreach ( get_posts( $args ) as $post ) { |
| 13 |
$topic_permalink = get_permalink( $post->ID ); |
| 14 |
} |
| 15 |
|
| 16 |
$forum_url = admin_url('customize.php?url=') . site_url( '/' ) . get_option( '_bbp_root_slug' ) . '?autofocus[panel]=bbp-core-settings&autofocus[section]=forum-archive-page'; |
| 17 |
$topic_url = admin_url( 'customize.php?url=' ) . $topic_permalink . '?autofocus[panel]=bbp-core-settings&autofocus[section]=topics_fields'; |
| 18 |
|
| 19 |
CSF::createSection( $prefix, array( |
| 20 |
'id' => 'design_fields', |
| 21 |
'title' => esc_html__( 'Customizer', 'eazydocs' ), |
| 22 |
'fields' => [ |
| 23 |
|
| 24 |
array( |
| 25 |
'id' => 'customizer_visibility', |
| 26 |
'type' => 'switcher', |
| 27 |
'title' => esc_html__( 'Options Visibility on Customizer', 'eazydocs' ), |
| 28 |
'text_on' => esc_html__( 'Enabled', 'eazydocs' ), |
| 29 |
'text_off' => esc_html__( 'Disabled', 'eazydocs' ), |
| 30 |
'text_width' => 100 |
| 31 |
), |
| 32 |
|
| 33 |
array( |
| 34 |
'type' => 'content', |
| 35 |
'content' => sprintf( '<a href="'.$forum_url.'" target="_blank" id="bbpc_forum_option_link">' . esc_html__( 'Forum', 'eazydocs' ) . '</a> <a href="' . $topic_url . '" target="_blank" id="bbpc_topic_option_link">' . esc_html__( 'Topic', 'eazydocs' ) . '</a>' ), |
| 36 |
'dependency' => array( |
| 37 |
array( 'customizer_visibility', '==', true ), |
| 38 |
), |
| 39 |
) |
| 40 |
] |
| 41 |
) ); |