PluginProbe
Adminimize / 1.9.1
Adminimize v1.9.1
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.9.1, at inc-setup/meta-boxes.php

50 lines 1.3 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 NULL;
15 }
16
17 // The global var is only usable on edit Post Type page
18 add_filter( 'do_meta_boxes', '_mw_adminimize_get_all_meta_boxes', 0, 3 );
19 function _mw_adminimize_get_all_meta_boxes( $post_type, $priority, $post ) {
20
21 global $wp_meta_boxes;
22
23 if ( ! empty( $wp_meta_boxes[ $post_type ] ) ) {
24
25 // get all options
26 $adminimizeoptions = _mw_adminimize_get_option_value();
27
28 // add meta box array for post type
29 $adminimizeoptions[ 'mw_adminimize_meta_boxes_' . $post_type ] = $wp_meta_boxes[ $post_type ];
30
31 // update options
32 _mw_adminimize_update_option( $adminimizeoptions );
33 }
34 }
35
36 function _mw_adminimize_get_meta_boxes( $post_type = NULL, $context = 'advanced' ) {
37
38 $saved_wp_meta_boxes = _mw_adminimize_get_option_value( 'mw_adminimize_meta_boxes_' . $post_type );
39
40 return $saved_wp_meta_boxes;
41 }
42
43 function _mw_adminimize_remove_meta_boxes( $post_type = NULL, $context = 'advanced', $priority = 'default', $id ) {
44
45 // @TODO foreach about settings
46 remove_meta_box( $id, $post_type, $context );
47 }
48
49 // remove on 'admin_menu' Hook
50