screen-attachment.php
7 months ago
screen-options-page.php
7 months ago
screen-post.php
7 months ago
screen-settings.php
7 months ago
screen-taxonomy.php
3 months ago
screen-user.php
7 months ago
screen-settings.php
84 lines
| 1 | <?php |
| 2 | |
| 3 | if(!defined('ABSPATH')){ |
| 4 | exit; |
| 5 | } |
| 6 | |
| 7 | if(!class_exists('acfe_screen_settings')): |
| 8 | |
| 9 | class acfe_screen_settings{ |
| 10 | |
| 11 | // vars |
| 12 | var $page; |
| 13 | |
| 14 | /** |
| 15 | * construct |
| 16 | */ |
| 17 | function __construct(){ |
| 18 | |
| 19 | /** |
| 20 | * hooks: |
| 21 | * |
| 22 | * acfe/load_settings $page |
| 23 | * acfe/add_settings_meta_boxes $page |
| 24 | */ |
| 25 | |
| 26 | // load |
| 27 | add_action('load-options-general.php', array($this, 'load')); |
| 28 | add_action('load-options-writing.php', array($this, 'load')); |
| 29 | add_action('load-options-reading.php', array($this, 'load')); |
| 30 | add_action('load-options-discussion.php', array($this, 'load')); |
| 31 | add_action('load-options-media.php', array($this, 'load')); |
| 32 | add_action('load-options-permalink.php', array($this, 'load')); |
| 33 | |
| 34 | } |
| 35 | |
| 36 | |
| 37 | /** |
| 38 | * load |
| 39 | * |
| 40 | * load-options-general.php |
| 41 | */ |
| 42 | function load(){ |
| 43 | |
| 44 | global $pagenow; |
| 45 | |
| 46 | $page = str_replace('.php', '', $pagenow); |
| 47 | |
| 48 | $this->page = $page; |
| 49 | |
| 50 | // actions |
| 51 | do_action("acfe/load_settings", $page); |
| 52 | do_action("acfe/load_settings/page={$page}", $page); |
| 53 | |
| 54 | // hooks |
| 55 | add_action('admin_footer', array($this, 'admin_footer')); |
| 56 | |
| 57 | } |
| 58 | |
| 59 | |
| 60 | /** |
| 61 | * admin_footer |
| 62 | */ |
| 63 | function admin_footer(){ |
| 64 | |
| 65 | do_action('acfe/add_settings_meta_boxes', $this->page); |
| 66 | |
| 67 | // enhanced ui |
| 68 | if(acf_get_setting('acfe/modules/ui')){ |
| 69 | |
| 70 | $screen = get_current_screen(); |
| 71 | |
| 72 | do_meta_boxes($screen, 'acf_after_title', $this->page); |
| 73 | do_meta_boxes($screen, 'normal', $this->page); |
| 74 | do_meta_boxes($screen, 'side', $this->page); |
| 75 | |
| 76 | } |
| 77 | |
| 78 | } |
| 79 | |
| 80 | } |
| 81 | |
| 82 | acf_new_instance('acfe_screen_settings'); |
| 83 | |
| 84 | endif; |