Changeset 6537
- Timestamp:
- 06/13/2017 05:30:47 AM (8 years ago)
- Location:
- trunk/src/includes/admin
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/admin.php
r6514 r6537 579 579 $version = bbp_get_version(); 580 580 581 // Register the JS 582 wp_register_script( 'bbp-admin-common-js', $this->js_url . 'common' . $suffix . '.js', array( 'jquery', 'suggest' ), $version ); 583 wp_register_script( 'bbp-admin-topics-js', $this->js_url . 'topics' . $suffix . '.js', array( 'jquery' ), $version ); 584 wp_register_script( 'bbp-admin-replies-js', $this->js_url . 'replies' . $suffix . '.js', array( 'jquery', 'suggest' ), $version ); 585 wp_register_script( 'bbp-converter', $this->js_url . 'converter' . $suffix . '.js', array( 'jquery', 'postbox', 'dashboard' ), $version ); 586 581 587 // Post type checker (only topics and replies) 582 588 if ( 'post' === get_current_screen()->base ) { 583 switch( get_current_screen()->post_type ) { 589 590 switch ( get_current_screen()->post_type ) { 584 591 case bbp_get_reply_post_type() : 585 592 case bbp_get_topic_post_type() : 586 593 587 594 // Enqueue the common JS 588 wp_enqueue_script( 'bbp-admin-common-js' , $this->js_url . 'common' . $suffix . '.js', array( 'jquery', 'suggest' ), $version);595 wp_enqueue_script( 'bbp-admin-common-js' ); 589 596 590 597 // Topics admin 591 598 if ( bbp_get_topic_post_type() === get_current_screen()->post_type ) { 592 wp_enqueue_script( 'bbp-admin-topics-js' , $this->js_url . 'topics' . $suffix . '.js', array( 'jquery' ), $version);599 wp_enqueue_script( 'bbp-admin-topics-js' ); 593 600 594 601 // Replies admin 595 602 } elseif ( bbp_get_reply_post_type() === get_current_screen()->post_type ) { 596 wp_enqueue_script( 'bbp-admin-replies-js' , $this->js_url . 'replies' . $suffix . '.js', array( 'jquery', 'suggest' ), $version);603 wp_enqueue_script( 'bbp-admin-replies-js' ); 597 604 } 598 605 … … 613 620 $suffix .= defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 614 621 615 // Enqueue admin CSS with dashicons dependency 616 wp_enqueue_style( 'bbp-admin-css', $this->css_url . 'admin' . $suffix . '.css', array( 'dashicons' ), bbp_get_version() ); 622 // Register admin CSS with dashicons dependency 623 wp_register_style( 'bbp-admin-css', $this->css_url . 'admin' . $suffix . '.css', array( 'dashicons' ), bbp_get_version() ); 624 625 // Enqueue 626 wp_enqueue_style( 'bbp-admin-css' ); 617 627 } 618 628 … … 787 797 788 798 <h2 class="nav-tab-wrapper"> 789 <a class="nav-tab nav-tab-active" href="<?php echo esc_url( ad min_url( add_query_arg( array( 'page' => 'bbp-about' ),'index.php' ) ) ); ?>">799 <a class="nav-tab nav-tab-active" href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) ); ?>"> 790 800 <?php esc_html_e( 'What’s New', 'bbpress' ); ?> 791 </a><a class="nav-tab" href="<?php echo esc_url( ad min_url( add_query_arg( array( 'page' => 'bbp-credits' ),'index.php' ) ) ); ?>">801 </a><a class="nav-tab" href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbp-credits' ), admin_url( 'index.php' ) ) ); ?>"> 792 802 <?php esc_html_e( 'Credits', 'bbpress' ); ?> 793 803 </a> … … 838 848 839 849 <div class="return-to-dashboard"> 840 <a href="<?php echo esc_url( ad min_url( add_query_arg( array( 'page' => 'bbpress' ),'options-general.php' ) ) ); ?>"><?php esc_html_e( 'Go to Forum Settings', 'bbpress' ); ?></a>850 <a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) ); ?>"><?php esc_html_e( 'Go to Forum Settings', 'bbpress' ); ?></a> 841 851 </div> 842 852 … … 849 859 * Output the credits screen 850 860 * 851 * Hardcoding this in here is pretty janky. It's fine for 2.2, but we'll861 * Hardcoding this in here is pretty janky. It's fine for now, but we'll 852 862 * want to leverage api.wordpress.org eventually. 853 863 * … … 864 874 865 875 <h2 class="nav-tab-wrapper"> 866 <a href="<?php echo esc_url( ad min_url( add_query_arg( array( 'page' => 'bbp-about' ),'index.php' ) ) ); ?>" class="nav-tab">876 <a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) ); ?>" class="nav-tab"> 867 877 <?php esc_html_e( 'What’s New', 'bbpress' ); ?> 868 </a><a href="<?php echo esc_url( ad min_url( add_query_arg( array( 'page' => 'bbp-credits' ),'index.php' ) ) ); ?>" class="nav-tab nav-tab-active">878 </a><a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbp-credits' ), admin_url( 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active"> 869 879 <?php esc_html_e( 'Credits', 'bbpress' ); ?> 870 880 </a> … … 885 895 <li class="wp-person" id="wp-person-jmdodd"> 886 896 <a href="https://profiles.wordpress.org/jmdodd" class="web"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=120" class="gravatar" alt="" />Jennifer M. Dodd</a> 887 <span class="title"><?php esc_html_e( 'Feature Developer', 'bbpress' ); ?></span>897 <span class="title"><?php esc_html_e( 'Feature Virtuoso', 'bbpress' ); ?></span> 888 898 </li> 889 899 <li class="wp-person" id="wp-person-netweb"> 890 900 <a href="https://profiles.wordpress.org/netweb" class="web"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=120" class="gravatar" alt="" />Stephen Edgar</a> 891 <span class="title"><?php esc_html_e( ' Converter Specialist', 'bbpress' ); ?></span>901 <span class="title"><?php esc_html_e( 'Tool Maven', 'bbpress' ); ?></span> 892 902 </li> 893 903 </ul> … … 917 927 </ul> 918 928 919 <h3 class="wp-people-group"><?php esc_html_e( 'Co re Contributors to bbPress 2.6', 'bbpress' ); ?></h3>929 <h3 class="wp-people-group"><?php esc_html_e( 'Contributors to bbPress 2.6', 'bbpress' ); ?></h3> 920 930 <p class="wp-credits-list"> 921 931 <a href="https://profiles.wordpress.org/alex-ye">alex-ye</a>, … … 981 991 982 992 <div class="return-to-dashboard"> 983 <a href="<?php echo esc_url( ad min_url( add_query_arg( array( 'page' => 'bbpress' ),'options-general.php' ) ) ); ?>"><?php esc_html_e( 'Go to Forum Settings', 'bbpress' ); ?></a>993 <a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) ); ?>"><?php esc_html_e( 'Go to Forum Settings', 'bbpress' ); ?></a> 984 994 </div> 985 995 -
trunk/src/includes/admin/assets/css/admin.css
r6514 r6537 370 370 background-color: #fafafa; 371 371 } 372 373 /* Tools */ 374 375 td.bbp-tool-title strong { 376 display: block; 377 } -
trunk/src/includes/admin/classes/class-bbp-converter.php
r6514 r6537 83 83 public function admin_head() { 84 84 85 // Variables86 $bbp = bbpress();87 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';88 $repair_url = add_query_arg( array(89 'page' => 'bbp-repair'90 ), admin_url() );91 92 85 // Enqueue scripts 93 wp_enqueue_script( 'postbox' ); 94 wp_enqueue_script( 'dashboard' ); 95 wp_enqueue_script( 'bbp-converter', $bbp->admin->js_url . 'converter' . $suffix . '.js', array( 'jquery', 'postbox' ), $bbp->version ); 86 wp_enqueue_script( 'bbp-converter' ); 96 87 97 88 // Localize JS … … 119 110 120 111 // Import 121 'import_success' => sprintf( esc_html__( 'Repair any missing information: %s', 'bbpress' ), '<a href="' . esc_url( $repair_url ) . '">' . esc_html__( 'Continue', 'bbpress' ) . '</a>' ),122 112 'import_complete' => esc_html__( 'Import Finished', 'bbpress' ), 123 113 'import_stopped_user' => esc_html__( 'Import Stopped (by User)', 'bbpress' ), -
trunk/src/includes/admin/tools.php
r6496 r6537 28 28 29 29 <div class="card"> 30 <h3 class="title"><?php _e( 'Forums', 'bbpress' ) ?></h3>30 <h3 class="title"><?php esc_html_e( 'Forums', 'bbpress' ) ?></h3> 31 31 <p><?php esc_html_e( 'bbPress provides the following tools to help you manage your forums:', 'bbpress' ); ?></p> 32 32 … … 42 42 43 43 // Add link to array 44 $links[] = sprintf( '<a href="%s">%s</a>', get_admin_url( '', add_query_arg( array( 'page' => $tool['page'] ), 'tools.php') ), $tool['name'] );44 $links[] = sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array( 'page' => $tool['page'] ), admin_url( 'tools.php' ) ) ), $tool['name'] ); 45 45 } 46 46 … … 67 67 'id' => '', 68 68 'type' => '', 69 'title' => '', 69 70 'description' => '', 70 71 'callback' => '', … … 79 80 80 81 // Bail if missing required values 81 if ( empty( $r['id'] ) || empty( $r['priority'] ) || empty( $r[' description'] ) || empty( $r['callback'] ) ) {82 if ( empty( $r['id'] ) || empty( $r['priority'] ) || empty( $r['title'] ) || empty( $r['callback'] ) ) { 82 83 return; 83 84 } … … 86 87 bbpress()->admin->tools[ $r['id'] ] = array( 87 88 'type' => $r['type'], 89 'title' => $r['title'], 88 90 'description' => $r['description'], 89 91 'priority' => $r['priority'], … … 109 111 'id' => 'bbp-sync-topic-meta', 110 112 'type' => 'repair', 111 ' description' =>__( 'Recalculate parent topic for each reply', 'bbpress' ),113 'title' => esc_html__( 'Recalculate parent topic for each reply', 'bbpress' ), 112 114 'callback' => 'bbp_admin_repair_topic_meta', 113 115 'priority' => 5, … … 120 122 'id' => 'bbp-sync-forum-meta', 121 123 'type' => 'repair', 122 ' description' =>__( 'Recalculate parent forum for each topic and reply', 'bbpress' ),124 'title' => esc_html__( 'Recalculate parent forum for each topic and reply', 'bbpress' ), 123 125 'callback' => 'bbp_admin_repair_forum_meta', 124 126 'priority' => 10, … … 131 133 'id' => 'bbp-sync-forum-visibility', 132 134 'type' => 'repair', 133 ' description' =>__( 'Recalculate private and hidden forums', 'bbpress' ),135 'title' => esc_html__( 'Recalculate private and hidden forums', 'bbpress' ), 134 136 'callback' => 'bbp_admin_repair_forum_visibility', 135 137 'priority' => 15, … … 142 144 'id' => 'bbp-sync-all-topics-forums', 143 145 'type' => 'repair', 144 ' description' =>__( 'Recalculate last activity in each topic and forum', 'bbpress' ),146 'title' => esc_html__( 'Recalculate last activity in each topic and forum', 'bbpress' ), 145 147 'callback' => 'bbp_admin_repair_freshness', 146 148 'priority' => 20, … … 153 155 'id' => 'bbp-sync-all-topics-sticky', 154 156 'type' => 'repair', 155 ' description' =>__( 'Recalculate sticky relationship of each topic', 'bbpress' ),157 'title' => esc_html__( 'Recalculate sticky relationship of each topic', 'bbpress' ), 156 158 'callback' => 'bbp_admin_repair_sticky', 157 159 'priority' => 25, … … 164 166 'id' => 'bbp-sync-all-reply-positions', 165 167 'type' => 'repair', 166 ' description' => __( 'Recalculate the position of each reply', 'bbpress' ),168 'title' => esc_html__( 'Recalculate position of each reply in each topic', 'bbpress' ), 167 169 'callback' => 'bbp_admin_repair_reply_menu_order', 168 170 'priority' => 30, … … 171 173 ) ); 172 174 175 // Sync all topic engagements for all users 176 bbp_register_repair_tool( array( 177 'id' => 'bbp-topic-engagements', 178 'type' => 'repair', 179 'title' => esc_html__( 'Recalculate engagements in each topic for each user', 'bbpress' ), 180 'callback' => 'bbp_admin_repair_topic_voice_count', 181 'priority' => 35, 182 'overhead' => 'high', 183 'components' => array( bbp_get_topic_post_type(), bbp_get_user_rewrite_id() ) 184 ) ); 185 173 186 // Update closed topic counts 174 187 bbp_register_repair_tool( array( 175 188 'id' => 'bbp-sync-closed-topics', 176 189 'type' => 'repair', 177 ' description' => __( 'Repair closed topics', 'bbpress' ),190 'title' => esc_html__( 'Repair closed topic statuses', 'bbpress' ), 178 191 'callback' => 'bbp_admin_repair_closed_topics', 179 'priority' => 35,192 'priority' => 40, 180 193 'overhead' => 'medium', 181 194 'components' => array( bbp_get_topic_post_type() ) … … 186 199 'id' => 'bbp-forum-topics', 187 200 'type' => 'repair', 188 ' description' =>__( 'Recount topics in each forum', 'bbpress' ),201 'title' => esc_html__( 'Recount topics in each forum', 'bbpress' ), 189 202 'callback' => 'bbp_admin_repair_forum_topic_count', 190 'priority' => 4 0,203 'priority' => 45, 191 204 'overhead' => 'medium', 192 205 'components' => array( bbp_get_forum_post_type(), bbp_get_topic_post_type() ) … … 197 210 'id' => 'bbp-topic-tags', 198 211 'type' => 'repair', 199 ' description' =>__( 'Recount topics in each topic-tag', 'bbpress' ),212 'title' => esc_html__( 'Recount topics in each topic-tag', 'bbpress' ), 200 213 'callback' => 'bbp_admin_repair_topic_tag_count', 201 'priority' => 45,214 'priority' => 50, 202 215 'overhead' => 'medium', 203 216 'components' => array( bbp_get_topic_post_type(), bbp_get_topic_tag_tax_id() ) … … 208 221 'id' => 'bbp-forum-replies', 209 222 'type' => 'repair', 210 ' description' =>__( 'Recount replies in each forum', 'bbpress' ),223 'title' => esc_html__( 'Recount replies in each forum', 'bbpress' ), 211 224 'callback' => 'bbp_admin_repair_forum_reply_count', 212 'priority' => 5 0,225 'priority' => 55, 213 226 'overhead' => 'high', 214 227 'components' => array( bbp_get_forum_post_type(), bbp_get_reply_post_type() ) … … 219 232 'id' => 'bbp-topic-replies', 220 233 'type' => 'repair', 221 ' description' =>__( 'Recount replies in each topic', 'bbpress' ),234 'title' => esc_html__( 'Recount replies in each topic', 'bbpress' ), 222 235 'callback' => 'bbp_admin_repair_topic_reply_count', 223 'priority' => 55,236 'priority' => 60, 224 237 'overhead' => 'high', 225 238 'components' => array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) 226 239 ) ); 227 240 228 // Count topic engagements229 bbp_register_repair_tool( array(230 'id' => 'bbp-topic-engagements',231 'type' => 'repair',232 'description' => __( 'Recount engagements in each topic', 'bbpress' ),233 'callback' => 'bbp_admin_repair_topic_voice_count',234 'priority' => 60,235 'overhead' => 'high',236 'components' => array( bbp_get_topic_post_type(), bbp_get_user_rewrite_id() )237 ) );238 239 241 // Count non-published replies to each topic 240 242 bbp_register_repair_tool( array( 241 243 'id' => 'bbp-topic-hidden-replies', 242 244 'type' => 'repair', 243 ' description' =>__( 'Recount pending, spammed, and trashed replies in each topic', 'bbpress' ),245 'title' => esc_html__( 'Recount pending, spammed, and trashed replies in each topic', 'bbpress' ), 244 246 'callback' => 'bbp_admin_repair_topic_hidden_reply_count', 245 247 'priority' => 65, … … 252 254 'id' => 'bbp-user-topics', 253 255 'type' => 'repair', 254 ' description' =>__( 'Recount topics for each user', 'bbpress' ),256 'title' => esc_html__( 'Recount topics for each user', 'bbpress' ), 255 257 'callback' => 'bbp_admin_repair_user_topic_count', 256 258 'priority' => 70, … … 263 265 'id' => 'bbp-user-replies', 264 266 'type' => 'repair', 265 ' description' =>__( 'Recount replies for each user', 'bbpress' ),267 'title' => esc_html__( 'Recount replies for each user', 'bbpress' ), 266 268 'callback' => 'bbp_admin_repair_user_reply_count', 267 269 'priority' => 75, … … 274 276 'id' => 'bbp-user-favorites', 275 277 'type' => 'repair', 276 ' description' =>__( 'Remove unpublished topics from user favorites', 'bbpress' ),278 'title' => esc_html__( 'Remove unpublished topics from user favorites', 'bbpress' ), 277 279 'callback' => 'bbp_admin_repair_user_favorites', 278 280 'priority' => 80, … … 285 287 'id' => 'bbp-user-topic-subscriptions', 286 288 'type' => 'repair', 287 ' description' =>__( 'Remove unpublished topics from user subscriptions', 'bbpress' ),289 'title' => esc_html__( 'Remove unpublished topics from user subscriptions', 'bbpress' ), 288 290 'callback' => 'bbp_admin_repair_user_topic_subscriptions', 289 291 'priority' => 85, … … 296 298 'id' => 'bbp-user-forum-subscriptions', 297 299 'type' => 'repair', 298 ' description' =>__( 'Remove unpublished forums from user subscriptions', 'bbpress' ),300 'title' => esc_html__( 'Remove unpublished forums from user subscriptions', 'bbpress' ), 299 301 'callback' => 'bbp_admin_repair_user_forum_subscriptions', 300 302 'priority' => 90, … … 307 309 'id' => 'bbp-user-role-map', 308 310 'type' => 'repair', 309 ' description' => __( 'Remap existingusers to default forum roles', 'bbpress' ),311 'title' => esc_html__( 'Remap all users to default forum roles', 'bbpress' ), 310 312 'callback' => 'bbp_admin_repair_user_roles', 311 313 'priority' => 95, … … 314 316 ) ); 315 317 318 // Migrate topic engagements to post-meta 319 bbp_register_repair_tool( array( 320 'id' => 'bbp-user-topic-engagements-move', 321 'type' => 'upgrade', 322 'title' => esc_html__( 'Upgrade user topic engagements', 'bbpress' ), 323 'callback' => 'bbp_admin_upgrade_user_engagements', 324 'priority' => 100, 325 'overhead' => 'high', 326 'components' => array( bbp_get_user_rewrite_id(), bbp_get_user_engagements_rewrite_id() ) 327 ) ); 328 316 329 // Migrate favorites from user-meta to post-meta 317 330 bbp_register_repair_tool( array( 318 331 'id' => 'bbp-user-favorites-move', 319 332 'type' => 'upgrade', 320 ' description' => __( 'Upgrade userfavorites', 'bbpress' ),333 'title' => esc_html__( 'Upgrade user topic favorites', 'bbpress' ), 321 334 'callback' => 'bbp_admin_upgrade_user_favorites', 322 'priority' => 10 0,335 'priority' => 105, 323 336 'overhead' => 'high', 324 337 'components' => array( bbp_get_user_rewrite_id(), bbp_get_user_favorites_rewrite_id() ) … … 329 342 'id' => 'bbp-user-topic-subscriptions-move', 330 343 'type' => 'upgrade', 331 ' description' =>__( 'Upgrade user topic subscriptions', 'bbpress' ),344 'title' => esc_html__( 'Upgrade user topic subscriptions', 'bbpress' ), 332 345 'callback' => 'bbp_admin_upgrade_user_topic_subscriptions', 333 'priority' => 1 05,346 'priority' => 110, 334 347 'overhead' => 'high', 335 348 'components' => array( bbp_get_user_rewrite_id(), bbp_get_user_subscriptions_rewrite_id() ) … … 340 353 'id' => 'bbp-user-forum-subscriptions-move', 341 354 'type' => 'upgrade', 342 ' description' =>__( 'Upgrade user forum subscriptions', 'bbpress' ),355 'title' => esc_html__( 'Upgrade user forum subscriptions', 'bbpress' ), 343 356 'callback' => 'bbp_admin_upgrade_user_forum_subscriptions', 344 'priority' => 11 0,357 'priority' => 115, 345 358 'overhead' => 'high', 346 359 'components' => array( bbp_get_user_rewrite_id(), bbp_get_user_subscriptions_rewrite_id() ) 347 360 ) ); 348 361 349 // Migrate topic engagements to post-meta350 bbp_register_repair_tool( array(351 'id' => 'bbp-user-topic-engagements-move',352 'type' => 'upgrade',353 'description' => __( 'Upgrade topic engagements', 'bbpress' ),354 'callback' => 'bbp_admin_upgrade_user_engagements',355 'priority' => 115,356 'overhead' => 'medium',357 'components' => array( bbp_get_user_rewrite_id(), bbp_get_user_engagements_rewrite_id() )358 ) );359 360 362 // Sync all BuddyPress group forum relationships 361 363 bbp_register_repair_tool( array( 362 364 'id' => 'bbp-group-forums', 363 365 'type' => 'upgrade', 364 ' description' =>__( 'Upgrade BuddyPress Group Forum relationships', 'bbpress' ),366 'title' => esc_html__( 'Upgrade BuddyPress Group Forum relationships', 'bbpress' ), 365 367 'callback' => 'bbp_admin_upgrade_group_forum_relationship', 366 368 'priority' => 120, … … 373 375 'id' => 'bbp-user-favorites-delete', 374 376 'type' => 'upgrade', 375 ' description' =>__( 'Remove favorites from user-meta', 'bbpress' ),377 'title' => esc_html__( 'Remove favorites from user-meta', 'bbpress' ), 376 378 'callback' => 'bbp_admin_upgrade_remove_favorites_from_usermeta', 377 379 'priority' => 125, … … 384 386 'id' => 'bbp-user-topic-subscriptions-delete', 385 387 'type' => 'upgrade', 386 ' description' =>__( 'Remove topic subscriptions from user-meta', 'bbpress' ),388 'title' => esc_html__( 'Remove topic subscriptions from user-meta', 'bbpress' ), 387 389 'callback' => 'bbp_admin_upgrade_remove_topic_subscriptions_from_usermeta', 388 390 'priority' => 130, … … 395 397 'id' => 'bbp-user-forum-subscriptions-delete', 396 398 'type' => 'upgrade', 397 ' description' =>__( 'Remove forum subscriptions from user-meta', 'bbpress' ),399 'title' => esc_html__( 'Remove forum subscriptions from user-meta', 'bbpress' ), 398 400 'callback' => 'bbp_admin_upgrade_remove_forum_subscriptions_from_usermeta', 399 401 'priority' => 135, … … 442 444 $is_current = (bool) ( $tab['name'] == $active_tab ); 443 445 $tab_class = $is_current ? $active_class : $idle_class; 444 $tab_url = get_admin_url( '', add_query_arg( array( 'page' => $tab['page'] ),'tools.php' ) );446 $tab_url = add_query_arg( array( 'page' => $tab['page'] ), admin_url( 'tools.php' ) ); 445 447 $tabs_html .= '<a href="' . esc_url( $tab_url ) . '" class="' . esc_attr( $tab_class ) . '">' . esc_html( $tab['name'] ) . '</a>'; 446 448 } … … 458 460 */ 459 461 function bbp_get_tools_admin_pages() { 462 463 // Get tools URL one time & use in each tab 464 $tools_url = admin_url( 'tools.php' ); 460 465 461 466 // Filter & return … … 468 473 469 474 // Deprecated 2.6.0 470 'href' => get_admin_url( '', add_query_arg( array( 'page' => 'bbp-repair' ), 'tools.php' ))475 'href' => add_query_arg( array( 'page' => 'bbp-repair' ), $tools_url ) 471 476 ), 472 477 array( … … 477 482 478 483 // Deprecated 2.6.0 479 'href' => get_admin_url( '', add_query_arg( array( 'page' => 'bbp-upgrade' ), 'tools.php' ))484 'href' => add_query_arg( array( 'page' => 'bbp-upgrade' ), $tools_url ) 480 485 ), 481 486 array( … … 486 491 487 492 // Deprecated 2.6.0 488 'href' => get_admin_url( '', add_query_arg( array( 'page' => 'bbp-converter' ), 'tools.php' ))493 'href' => add_query_arg( array( 'page' => 'bbp-converter' ), $tools_url ) 489 494 ), 490 495 array( … … 495 500 496 501 // Deprecated 2.6.0 497 'href' => get_admin_url( '', add_query_arg( array( 'page' => 'bbp-reset' ), 'tools.php' ))502 'href' => add_query_arg( array( 'page' => 'bbp-reset' ), $tools_url ) 498 503 ) 499 504 ) ); -
trunk/src/includes/admin/tools/common.php
r6438 r6537 30 30 */ 31 31 function bbp_get_admin_repair_tool_run_url( $component = array() ) { 32 $tools = admin_url( 'tools.php' ); 33 $page = ( 'repair' === $component['type'] ) ? 'bbp-repair' : 'bbp-upgrade'; 34 $args = array( 'page' => $page, 'action' => 'run', 'checked' => array( $component['id'] ) ); 35 $url = add_query_arg( $args, $tools ); 36 $nonced = wp_nonce_url( $url, 'bbpress-do-counts' ); 32 33 // Page 34 $page = ( 'repair' === $component['type'] ) 35 ? 'bbp-repair' 36 : 'bbp-upgrade'; 37 38 // Arguments 39 $args = array( 40 'page' => $page, 41 'action' => 'run', 42 'checked' => array( $component['id'] 43 ) ); 44 45 // Url 46 $nonced = wp_nonce_url( add_query_arg( $args, admin_url( 'tools.php' ) ), 'bbpress-do-counts' ); 37 47 38 48 // Filter & return … … 176 186 177 187 // Filter & return 178 return apply_filters( 'bbp_get_admin_repair_tools', $tools, $type );188 return (array) apply_filters( 'bbp_get_admin_repair_tools', $tools, $type ); 179 189 } 180 190 … … 201 211 202 212 // Filter & return 203 return apply_filters( 'bbp_get_admin_repair_tool_registered_components', $retval );213 return (array) apply_filters( 'bbp_get_admin_repair_tool_registered_components', $retval ); 204 214 } 205 215 … … 364 374 // Search 365 375 if ( ! empty( $search ) ) { 366 if ( ! strstr( strtolower( $tool[' description'] ), strtolower( $search ) ) ) {376 if ( ! strstr( strtolower( $tool['title'] ), strtolower( $search ) ) ) { 367 377 continue; 368 378 } … … 373 383 'id' => sanitize_key( $id ), 374 384 'type' => $tool['type'], 385 'title' => $tool['title'], 375 386 'description' => $tool['description'], 376 387 'callback' => $tool['callback'], … … 412 423 413 424 // Filter & return 414 return apply_filters( 'bbp_get_admin_repair_tool_components', $links, $item );425 return (array) apply_filters( 'bbp_get_admin_repair_tool_components', $links, $item ); 415 426 } 416 427 … … 460 471 461 472 // Loop through tools and count overheads 462 foreach ( $tools as $ id => $tool ) {473 foreach ( $tools as $tool ) { 463 474 464 475 // Get the overhead level … … 480 491 // Default ticker 481 492 $i = 0; 493 494 // Sort 495 ksort( $overheads ); 482 496 483 497 // Loop through overheads and build filter … … 493 507 494 508 // Figure out separator and active class 495 $current = ! empty( $_GET['overhead'] ) && ( sanitize_key( $_GET['overhead'] ) === $key ) ? 'current' : ''; 509 $current = ! empty( $_GET['overhead'] ) && ( sanitize_key( $_GET['overhead'] ) === $key ) 510 ? 'current' 511 : ''; 496 512 497 513 // Counts to show … … 537 553 538 554 // Filter & return 539 return apply_filters( 'bbp_get_admin_repair_tool_overhead', $links, $item );540 } 555 return (array) apply_filters( 'bbp_get_admin_repair_tool_overhead', $links, $item ); 556 } -
trunk/src/includes/admin/tools/repair.php
r6523 r6537 89 89 </th> 90 90 <td class="bbp-tool-title column-primary column-description" data-colname="<?php esc_html_e( 'Description', 'bbpress' ); ?>"> 91 <strong><?php echo esc_html( $item['description'] ); ?></strong> 92 <div class="row-actions hide-if-no-js"> 91 <strong><?php echo esc_html( $item['title'] ); ?></strong><?php 92 93 // Optional description 94 if ( ! empty( $item['description'] ) ) : 95 echo esc_html( $item['description'] ); 96 endif; 97 98 ?><div class="row-actions hide-if-no-js"> 93 99 <span class="run"> 94 <a href="<?php bbp_admin_repair_tool_run_url( $item ); ?>" aria-label="<?php printf( esc_html__( 'Run %s', 'bbpress' ), $item[' description'] ); ?>" id="<?php echo esc_attr( $item['id'] ); ?>" ><?php esc_html_e( 'Run', 'bbpress' ); ?></a>100 <a href="<?php bbp_admin_repair_tool_run_url( $item ); ?>" aria-label="<?php printf( esc_html__( 'Run %s', 'bbpress' ), $item['title'] ); ?>" id="<?php echo esc_attr( $item['id'] ); ?>" ><?php esc_html_e( 'Run', 'bbpress' ); ?></a> 95 101 </span> 96 102 </div> -
trunk/src/includes/admin/tools/upgrade.php
r6534 r6537 86 86 </th> 87 87 <td class="bbp-tool-title column-primary column-description" data-colname="<?php esc_html_e( 'Description', 'bbpress' ); ?>"> 88 <strong><?php echo esc_html( $item['description'] ); ?></strong> 89 <div class="row-actions hide-if-no-js"> 88 <strong><?php echo esc_html( $item['title'] ); ?></strong><?php 89 90 // Optional description 91 if ( ! empty( $item['description'] ) ) : 92 esc_html( $item['description'] ); 93 endif; 94 95 ?><div class="row-actions hide-if-no-js"> 90 96 <span class="run"> 91 <a href="<?php bbp_admin_repair_tool_run_url( $item ); ?>" aria-label="<?php printf( esc_html__( 'Run %s', 'bbpress' ), $item[' description'] ); ?>" id="<?php echo esc_attr( $item['id'] ); ?>" ><?php esc_html_e( 'Run', 'bbpress' ); ?></a>97 <a href="<?php bbp_admin_repair_tool_run_url( $item ); ?>" aria-label="<?php printf( esc_html__( 'Run %s', 'bbpress' ), $item['title'] ); ?>" id="<?php echo esc_attr( $item['id'] ); ?>" ><?php esc_html_e( 'Run', 'bbpress' ); ?></a> 92 98 </span> 93 99 </div>
Note: See TracChangeset
for help on using the changeset viewer.