Make WordPress Core


Ignore:
Timestamp:
07/05/2016 03:21:44 PM (9 years ago)
Author:
ocean90
Message:

Dashboard: Don't add a "Configure" link to the toggle button.

The HTML for the toggle gets appended to the widget name which is later used for the widget title and the screen reader text of the toggle button. Storing the original widget name in the arguments allows us to use the name without the HTML for the screen reader text and doesn't require further changes by plugin developers.

Props nicholas_io, swissspidy.
Fixes #35021.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r37674 r37972  
    148148    $screen = get_current_screen();
    149149    global $wp_dashboard_control_callbacks;
     150
     151    $private_callback_args = array( '__widget_basename' => $widget_name );
     152
     153    if ( is_null( $callback_args ) ) {
     154        $callback_args = $private_callback_args;
     155    } else if ( is_array( $callback_args ) ) {
     156        $callback_args = array_merge( $callback_args, $private_callback_args );
     157    }
    150158
    151159    if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {
Note: See TracChangeset for help on using the changeset viewer.