Changeset 27669
- Timestamp:
- 03/24/2014 02:20:33 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/dashboard.php
r27613 r27669 57 57 wp_add_dashboard_widget( 'dashboard_primary', __( 'WordPress News' ), 'wp_dashboard_primary' ); 58 58 59 // Hook to register new widgets60 // Filter widget order61 59 if ( is_network_admin() ) { 60 61 /** 62 * Fires after core widgets for the Network Admin dashboard have been registered. 63 * 64 * @since 3.1.0 65 */ 62 66 do_action( 'wp_network_dashboard_setup' ); 67 68 /** 69 * Filter the list of widgets to load for the Network Admin dashboard. 70 * 71 * @since 3.1.0 72 * 73 * @param array $dashboard_widgets An array of dashboard widgets. 74 */ 63 75 $dashboard_widgets = apply_filters( 'wp_network_dashboard_widgets', array() ); 64 76 } elseif ( is_user_admin() ) { 77 78 /** 79 * Fires after core widgets for the User Admin dashboard have been registered. 80 * 81 * @since 3.1.0 82 */ 65 83 do_action( 'wp_user_dashboard_setup' ); 84 85 /** 86 * Filter the list of widgets to load for the User Admin dashboard. 87 * 88 * @since 3.1.0 89 * 90 * @param array $dashboard_widgets An array of dashboard widgets. 91 */ 66 92 $dashboard_widgets = apply_filters( 'wp_user_dashboard_widgets', array() ); 67 93 } else { 94 95 /** 96 * Fires after core widgets for the admin dashboard have been registered. 97 * 98 * @since 2.5.0 99 */ 68 100 do_action( 'wp_dashboard_setup' ); 101 102 /** 103 * Filter the list of widgets to load for the admin dashboard. 104 * 105 * @since 2.5.0 106 * 107 * @param array $dashboard_widgets An array of dashboard widgets. 108 */ 69 109 $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() ); 70 110 } … … 88 128 89 129 /** This action is documented in wp-admin/edit-form-advanced.php */ 90 do_action('do_meta_boxes', $screen->id, 'normal', ''); 130 do_action( 'do_meta_boxes', $screen->id, 'normal', '' ); 131 91 132 /** This action is documented in wp-admin/edit-form-advanced.php */ 92 do_action( 'do_meta_boxes', $screen->id, 'side', '');133 do_action( 'do_meta_boxes', $screen->id, 'side', '' ); 93 134 } 94 135 … … 166 207 } 167 208 168 /* Dashboard Widgets */ 209 // 210 // Dashboard Widgets 211 // 169 212 170 213 /** … … 221 264 222 265 /** 223 * Include additional elements in the 'At a Glance' dashboard widget. 224 * This widget was previously 'Right Now'. 266 * Filter the array of extra elements to list in the 'At a Glance' 267 * dashboard widget. 268 * 269 * Prior to 3.8.0, the widget was named 'Right Now'. Each element 270 * is wrapped in list-item tags on output. 225 271 * 226 272 * @since 3.8.0 227 * @param array $items Array of items. 273 * 274 * @param array $items Array of extra 'At a Glance' widget items. 228 275 */ 229 276 $elements = apply_filters( 'dashboard_glance_items', array() ); 277 230 278 if ( $elements ) { 231 279 echo '<li>' . implode( "</li>\n<li>", $elements ) . "</li>\n"; … … 241 289 242 290 /** 243 * Filter the title attribute for the link displayed in Site Content metabox when search engines are discouraged from indexing the site. 291 * Filter the link title attribute for the 'Search Engines Discouraged' 292 * message displayed in the 'At a Glance' dashboard widget. 293 * 294 * Prior to 3.8.0, the widget was named 'Right Now'. 244 295 * 245 296 * @since 3.0.0 246 297 * 247 * @param string Default attribute text.298 * @param string $title Default attribute text. 248 299 */ 249 300 $title = apply_filters( 'privacy_on_link_title', __( 'Your site is asking search engines not to index its content' ) ); 250 301 251 302 /** 252 * Filter the text for the link displayed in Site Content metabox when search engines are discouraged from indexing the site. 303 * Filter the link label for the 'Search Engines Discouraged' message 304 * displayed in the 'At a Glance' dashboard widget. 305 * 306 * Prior to 3.8.0, the widget was named 'Right Now'. 253 307 * 254 308 * @since 3.0.0 255 309 * 256 * @param string Default text.310 * @param string $content Default text. 257 311 */ 258 312 $content = apply_filters( 'privacy_on_link_text' , __( 'Search Engines Discouraged' ) ); … … 263 317 </div> 264 318 <?php 265 // activity_box_end has a core action, but only prints content when multisite. 266 // Using an output buffer is the only way to really check if anything's displayed here. 319 /* 320 * activity_box_end has a core action, but only prints content when multisite. 321 * Using an output buffer is the only way to really check if anything's displayed here. 322 */ 267 323 ob_start(); 324 325 /** 326 * Fires at the end of the 'At a Glance' dashboard widget. 327 * 328 * Prior to 3.8.0, the widget was named 'Right Now'. 329 * 330 * @since 2.5.0 331 */ 268 332 do_action( 'rightnow_end' ); 333 334 /** 335 * Fires at the end of the 'At a Glance' dashboard widget. 336 * 337 * Prior to 3.8.0, the widget was named 'Right Now'. 338 * 339 * @since 2.0.0 340 */ 269 341 do_action( 'activity_box_end' ); 342 270 343 $actions = ob_get_clean(); 271 344 … … 304 377 305 378 <p class="youhave"><?php echo $sentence; ?></p> 306 <?php do_action( 'wpmuadminresult', '' ); ?> 379 380 381 <?php 382 /** 383 * Fires in the Network Admin 'Right Now' dashboard widget 384 * just before the user and site search form fields. 385 * 386 * @since MU 387 * 388 * @param null $unused 389 */ 390 do_action( 'wpmuadminresult', '' ); 391 ?> 307 392 308 393 <form action="<?php echo network_admin_url('users.php'); ?>" method="get"> … … 320 405 </form> 321 406 <?php 407 /** 408 * Fires at the end of the 'Right Now' widget in the Network Admin dashboard. 409 * 410 * @since MU 411 */ 322 412 do_action( 'mu_rightnow_end' ); 413 414 /** 415 * Fires at the end of the 'Right Now' widget in the Network Admin dashboard. 416 * 417 * @since MU 418 */ 323 419 do_action( 'mu_activity_box_end' ); 324 420 } … … 362 458 363 459 <div class="input-text-wrap" id="title-wrap"> 364 <label class="screen-reader-text prompt" for="title" id="title-prompt-text"><?php echo apply_filters( 'enter_title_here', __( 'Title' ), $post ); ?></label> 460 <label class="screen-reader-text prompt" for="title" id="title-prompt-text"> 461 462 <?php 463 /** This filter is documented in wp-admin/edit-form-advanced.php */ 464 echo apply_filters( 'enter_title_here', __( 'Title' ), $post ); 465 ?> 466 </label> 365 467 <input type="text" name="post_title" id="title" autocomplete="off" /> 366 468 </div> … … 471 573 $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>'; 472 574 575 /** 576 * Filter the action links displayed for each comment in the 'Recent Comments' 577 * dashboard widget. 578 * 579 * @since 2.6.0 580 * 581 * @param array $actions An array of comment actions. Default actions include: 582 * 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam', 583 * 'Delete', and 'Trash'. 584 * @param object $comment The comment object. 585 */ 473 586 $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment ); 474 587 … … 831 944 function wp_dashboard_primary() { 832 945 $feeds = array( 833 'news' => array( 834 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ), 835 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ), 946 'news' => array( 947 948 /** 949 * Filter the primary link URL for the 'WordPress News' dashboard widget. 950 * 951 * @since 2.5.0 952 * 953 * @param string $link The widget's primary link URL. 954 */ 955 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ), 956 957 /** 958 * Filter the primary feed URL for the 'WordPress News' dashboard widget. 959 * 960 * @since 2.3.0 961 * 962 * @param string $url The widget's primary feed URL. 963 */ 964 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ), 965 966 /** 967 * Filter the primary link title for the 'WordPress News' dashboard widget. 968 * 969 * @since 2.3.0 970 * 971 * @param string $title Title attribute for the widget's primary link. 972 */ 836 973 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ), 837 974 'items' => 1, … … 841 978 ), 842 979 'planet' => array( 843 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ), 844 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ), 980 981 /** 982 * Filter the secondary link URL for the 'WordPress News' dashboard widget. 983 * 984 * @since 2.3.0 985 * 986 * @param string $link The widget's secondary link URL. 987 */ 988 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ), 989 990 /** 991 * Filter the secondary feed URL for the 'WordPress News' dashboard widget. 992 * 993 * @since 2.3.0 994 * 995 * @param string $url The widget's secondary feed URL. 996 */ 997 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ), 998 999 /** 1000 * Filter the secondary link title for the 'WordPress News' dashboard widget. 1001 * 1002 * @since 2.3.0 1003 * 1004 * @param string $title Title attribute for the widget's secondary link. 1005 */ 845 1006 'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ), 846 1007 'items' => 3, … … 1058 1219 } 1059 1220 1221 /** 1222 * Filter the notice output for the 'Browse Happy' nag meta box. 1223 * 1224 * @since 3.2.0 1225 * 1226 * @param string $notice The notice content. 1227 * @param array $response An array containing web browser information. 1228 */ 1060 1229 echo apply_filters( 'browse-happy-notice', $notice, $response ); 1061 1230 }
Note: See TracChangeset
for help on using the changeset viewer.