NoticeManager.moveAboveTitle + above_title option
This commit is contained in:
parent
57c54c756a
commit
a2c3e60f87
@ -77,14 +77,9 @@ var NoticeManager = (function ($, document) {
|
||||
if (options.screen_panel && options.auto_collect) {
|
||||
NoticeManager.collectNotices();
|
||||
} else {
|
||||
/**
|
||||
* Move ALL notices above page title.
|
||||
* Default no-panel action - override WordPress moving notices BELOW title.
|
||||
* I HATE it when WordPress moves notices below title.
|
||||
*
|
||||
* comment this line out to completely restore WordPress functionality when auto_collect is off
|
||||
*/
|
||||
notices.insertBefore(".wrap:first");
|
||||
if (options.above_title) {
|
||||
NoticeManager.moveAboveTitle();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -169,5 +164,14 @@ var NoticeManager = (function ($, document) {
|
||||
$("#screen-meta-links").detach();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Move ALL notices above page title.
|
||||
* Default no-panel action - override WordPress moving notices BELOW title.
|
||||
* I HATE it when WordPress moves notices below title.
|
||||
*/
|
||||
moveAboveTitle: () => {
|
||||
notices.insertBefore(".wrap:first");
|
||||
},
|
||||
};
|
||||
}(jQuery,document) )
|
||||
@ -30,6 +30,12 @@ new PluginCore(
|
||||
// 'title' => 'N',
|
||||
'description' => 'Setup How notice manager functions.',
|
||||
'fields' => [
|
||||
[
|
||||
'id' => 'above_title',
|
||||
'title' => 'Above Title',
|
||||
'type' => 'checkbox',
|
||||
'description' => 'Move all notices above title. (WordPress core moves notices below title using script.)',
|
||||
],
|
||||
[
|
||||
'id' => 'screen_panel',
|
||||
'title' => 'Notices Panel',
|
||||
|
||||
@ -32,7 +32,7 @@ class NoticeManager{
|
||||
if ( ! empty( $this->options['screen_panel'] ) ){
|
||||
add_action( 'admin_init' , [ $this , 'register_notice_manager_panel' ] );
|
||||
}else{
|
||||
array_walk($this->options,function(&$item){$item=0;});
|
||||
// array_walk($this->options,function(&$item){$item=0;});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user