mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 00:01:27 +01:00
Keep Dashboard RSS widgets in same place when configuring. props duck_. fixes #14785
git-svn-id: http://svn.automattic.com/wordpress/trunk@16814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fdb3b09a99
commit
28f16ea431
@ -138,16 +138,17 @@ function wp_dashboard_setup() {
|
||||
function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null ) {
|
||||
$screen = get_current_screen();
|
||||
global $wp_dashboard_control_callbacks;
|
||||
|
||||
if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {
|
||||
$wp_dashboard_control_callbacks[$widget_id] = $control_callback;
|
||||
if ( isset( $_GET['edit'] ) && $widget_id == $_GET['edit'] ) {
|
||||
list($url) = explode( '#', add_query_arg( 'edit', false ), 2 );
|
||||
$widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( $url ) . '">' . __( 'Cancel' ) . '</a></span>';
|
||||
add_meta_box( $widget_id, $widget_name, '_wp_dashboard_control_callback', $screen->id, 'normal', 'core' );
|
||||
return;
|
||||
$callback = '_wp_dashboard_control_callback';
|
||||
} else {
|
||||
list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
|
||||
$widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
|
||||
}
|
||||
list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
|
||||
$widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
|
||||
}
|
||||
|
||||
if ( is_blog_admin () )
|
||||
|
Loading…
Reference in New Issue
Block a user