WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/08/2010 07:53:26 PM (9 years ago)
Author:
markjaquith
Message:

Keep Dashboard RSS widgets in same place when configuring. props duck_. fixes #14785

File:
1 edited

Legend:

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

    r16438 r16814  
    139139    $screen = get_current_screen();
    140140    global $wp_dashboard_control_callbacks;
     141
    141142    if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {
    142143        $wp_dashboard_control_callbacks[$widget_id] = $control_callback;
     
    144145            list($url) = explode( '#', add_query_arg( 'edit', false ), 2 );
    145146            $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( $url ) . '">' . __( 'Cancel' ) . '</a></span>';
    146             add_meta_box( $widget_id, $widget_name, '_wp_dashboard_control_callback', $screen->id, 'normal', 'core' );
    147             return;
    148         }
    149         list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
    150         $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
     147            $callback = '_wp_dashboard_control_callback';
     148        } else {
     149            list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
     150            $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
     151        }
    151152    }
    152153
Note: See TracChangeset for help on using the changeset viewer.