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) {
|
if (options.screen_panel && options.auto_collect) {
|
||||||
NoticeManager.collectNotices();
|
NoticeManager.collectNotices();
|
||||||
} else {
|
} else {
|
||||||
/**
|
if (options.above_title) {
|
||||||
* Move ALL notices above page title.
|
NoticeManager.moveAboveTitle();
|
||||||
* 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");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -169,5 +164,14 @@ var NoticeManager = (function ($, document) {
|
|||||||
$("#screen-meta-links").detach();
|
$("#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) )
|
}(jQuery,document) )
|
||||||
@ -30,6 +30,12 @@ new PluginCore(
|
|||||||
// 'title' => 'N',
|
// 'title' => 'N',
|
||||||
'description' => 'Setup How notice manager functions.',
|
'description' => 'Setup How notice manager functions.',
|
||||||
'fields' => [
|
'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',
|
'id' => 'screen_panel',
|
||||||
'title' => 'Notices Panel',
|
'title' => 'Notices Panel',
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class NoticeManager{
|
|||||||
if ( ! empty( $this->options['screen_panel'] ) ){
|
if ( ! empty( $this->options['screen_panel'] ) ){
|
||||||
add_action( 'admin_init' , [ $this , 'register_notice_manager_panel' ] );
|
add_action( 'admin_init' , [ $this , 'register_notice_manager_panel' ] );
|
||||||
}else{
|
}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