PluginProbe
Adminimize / 1.11.8
Adminimize v1.11.8
1.11.14 1.11.13 1.11.1 1.11.10 1.11.11 1.11.12 1.11.2 1.11.3 1.11.4 1.11.5 1.11.6 1.11.7 1.11.8 1.11.9 1.3 1.4.7 1.6 1.7.12 1.7.13 1.7.14 1.7.15 1.7.16 1.7.17 1.7.18 1.7.19 All 53 releases
adminimize / inc-setup / meta-boxes.php

meta-boxes.php in Adminimize 1.11.8, at inc-setup/meta-boxes.php

55 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Adminimize
4 * @subpackage Meta Boxes Setup
5 * @author Frank Bültge
6 * @since 1.8.1 01/10/2013
7 */
8 if ( ! function_exists( 'add_action' ) ) {
9 echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
10 exit;
11 }
12
13 if ( ! is_admin() ) {
14 return;
15 }
16
17 // If is AJAX Call.
18 if ( defined('DOING_AJAX') && DOING_AJAX ) {
19 return;
20 }
21
22 // The global var is only usable on edit Post Type page
23 add_filter( 'do_meta_boxes', '_mw_adminimize_get_all_meta_boxes', 0, 3 );
24 function _mw_adminimize_get_all_meta_boxes( $post_type, $priority, $post ) {
25
26 global $wp_meta_boxes;
27
28 if ( ! empty( $wp_meta_boxes[ $post_type ] ) ) {
29
30 // get all options
31 $adminimizeoptions = _mw_adminimize_get_option_value();
32
33 // add meta box array for post type
34 $adminimizeoptions[ 'mw_adminimize_meta_boxes_' . $post_type ] = $wp_meta_boxes[ $post_type ];
35
36 // update options
37 _mw_adminimize_update_option( $adminimizeoptions );
38 }
39 }
40
41 function _mw_adminimize_get_meta_boxes( $post_type = NULL, $context = 'advanced' ) {
42
43 $saved_wp_meta_boxes = _mw_adminimize_get_option_value( 'mw_adminimize_meta_boxes_' . $post_type );
44
45 return $saved_wp_meta_boxes;
46 }
47
48 function _mw_adminimize_remove_meta_boxes( $post_type = NULL, $context = 'advanced', $priority = 'default', $id ) {
49
50 // @TODO foreach about settings
51 remove_meta_box( $id, $post_type, $context );
52 }
53
54 // remove on 'admin_menu' Hook
55