| @@ -6,11 +6,16 @@ | ||
| 6 | 6 | 'orderby' => 'menu_order', |
| 7 | 7 | 'order' => 'desc' |
| 8 | 8 | ); |
| 9 | 9 | |
| 10 | +// The link is only shown on the settings screen; skip the query on the frontend. | |
| 10 | 11 | $topic_permalink = ''; |
| 11 | -foreach (get_posts($args) as $post) { | |
| 12 | - $topic_permalink = get_permalink($post->ID); | |
| 12 | +if ( is_admin() ) { | |
| 13 | + $args['fields'] = 'ids'; | |
| 14 | + $args['no_found_rows'] = true; | |
| 15 | + foreach ( get_posts( $args ) as $latest_topic_id ) { | |
| 16 | + $topic_permalink = get_permalink( $latest_topic_id ); | |
| 17 | + } | |
| 13 | 18 | } |
| 14 | 19 | |
| 15 | 20 | $forum_url = admin_url('customize.php?url=') . site_url('/') . get_option('_bbp_root_slug') . '?autofocus[panel]=forumax-settings&autofocus[section]=forum-archive-page'; |
| 16 | 21 | $topic_url = admin_url('customize.php?url=') . $topic_permalink . '?autofocus[panel]=forumax-settings&autofocus[section]=topics_fields'; |
| @@ -40,8 +45,16 @@ | ||
| 40 | 45 | 'left' => esc_html__('Left', 'forumax'), |
| 41 | 46 | 'right' => esc_html__('Right', 'forumax'), |
| 42 | 47 | ], |
| 43 | 48 | 'default' => 'left', |
| 49 | + ], | |
| 50 | + | |
| 51 | + [ | |
| 52 | + 'id' => 'hide_support_assistant', | |
| 53 | + 'type' => 'switcher', | |
| 54 | + 'title' => esc_html__('Hide Support Chat', 'forumax'), | |
| 55 | + 'subtitle' => esc_html__('Hide the documentation support chat button on Forumax admin pages.', 'forumax'), | |
| 56 | + 'default' => false, | |
| 44 | 57 | ], |
| 45 | 58 | |
| 46 | 59 | [ |
| 47 | 60 | 'id' => 'customizer_visibility', |