| @@ -6,16 +6,11 @@ | ||
| 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. | |
| 11 | 10 | $topic_permalink = ''; |
| 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 | - } | |
| 11 | +foreach (get_posts($args) as $post) { | |
| 12 | + $topic_permalink = get_permalink($post->ID); | |
| 18 | 13 | } |
| 19 | 14 | |
| 20 | 15 | $forum_url = admin_url('customize.php?url=') . site_url('/') . get_option('_bbp_root_slug') . '?autofocus[panel]=forumax-settings&autofocus[section]=forum-archive-page'; |
| 21 | 16 | $topic_url = admin_url('customize.php?url=') . $topic_permalink . '?autofocus[panel]=forumax-settings&autofocus[section]=topics_fields'; |