mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
Prevent the Slug metabox from being forever hidden when showing all metaboxes. Fixes #12088
git-svn-id: http://svn.automattic.com/wordpress/trunk@14065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fbf39813dc
commit
59bb0c7d9c
@ -988,10 +988,12 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
|
||||
break;
|
||||
case 'closed-postboxes' :
|
||||
check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' );
|
||||
$closed = isset( $_POST['closed'] ) ? $_POST['closed'] : '';
|
||||
$closed = explode( ',', $_POST['closed'] );
|
||||
$hidden = isset( $_POST['hidden'] ) ? $_POST['hidden'] : '';
|
||||
$hidden = explode( ',', $_POST['hidden'] );
|
||||
$closed = isset( $_POST['closed'] ) ? explode( ',', $_POST['closed']) : array();
|
||||
$closed = array_filter($closed);
|
||||
|
||||
$hidden = isset( $_POST['hidden'] ) ? explode( ',', $_POST['hidden']) : array();
|
||||
$hidden = array_filter($hidden);
|
||||
|
||||
$page = isset( $_POST['page'] ) ? $_POST['page'] : '';
|
||||
|
||||
if ( !preg_match( '/^[a-z_-]+$/', $page ) )
|
||||
|
@ -2967,12 +2967,11 @@ function get_hidden_meta_boxes($screen) {
|
||||
if ( is_string($screen) )
|
||||
$screen = convert_to_screen($screen);
|
||||
|
||||
$hidden = (array) get_user_option( "meta-box-hidden_$screen->id" );
|
||||
$hidden = get_user_option( "meta-box-hidden_$screen->id" );
|
||||
|
||||
// Hide slug boxes by default
|
||||
if ( empty($hidden[0]) ) {
|
||||
if ( !is_array($hidden) )
|
||||
$hidden = array('slugdiv');
|
||||
}
|
||||
|
||||
return $hidden;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user