PluginProbe ʕ •ᴥ•ʔ
Advanced Custom Fields: Extended / 0.9.2.7
Advanced Custom Fields: Extended v0.9.2.7
0.9.2.7 0.9.2.6 0.9.2.5 0.8.6 0.8.6.1 0.8.6.3 0.8.6.5 0.8.6.6 0.8.6.7 0.8.6.8 0.8.6.9 0.8.7 0.8.7.1 0.8.7.2 0.8.7.3 0.8.7.4 0.8.7.5 0.8.7.6 0.8.8 0.8.8.1 0.8.8.10 0.8.8.11 0.8.8.2 0.8.8.3 0.8.8.4 0.8.8.5 0.8.8.6 0.8.8.7 0.8.8.8 0.8.8.9 0.8.9 0.8.9.1 0.8.9.2 0.8.9.3 0.8.9.4 0.8.9.5 0.9 0.9.0.1 0.9.0.2 0.9.0.3 0.9.0.4 0.9.0.5 0.9.0.6 0.9.0.7 0.9.0.8 0.9.0.9 0.9.1 0.9.1.1 0.9.2 0.9.2.1 0.9.2.2 0.9.2.3 0.9.2.4 trunk 0.5 0.5.1 0.5.2 0.5.2.1 0.5.2.3 0.5.5 0.5.5.1 0.5.8 0.5.8.1 0.6 0.6.0.1 0.6.0.2 0.6.1 0.6.3 0.6.5 0.6.7 0.6.7.2 0.7 0.7.0.3 0.7.5 0.7.5.5 0.7.8 0.7.9 0.7.9.3 0.7.9.4 0.7.9.9.8 0.7.9.9.9 0.8 0.8.1 0.8.2 0.8.3 0.8.3.1 0.8.4 0.8.4.1 0.8.4.5 0.8.4.6 0.8.5 0.8.5.5
acf-extended / includes / admin / menu.php
acf-extended / includes / admin Last commit date
tools 3 months ago views 5 years ago admin.php 3 months ago menu.php 3 months ago plugins.php 3 months ago settings.php 3 months ago
menu.php
106 lines
1 <?php
2
3 if(!defined('ABSPATH')){
4 exit;
5 }
6
7 if(!class_exists('acfe_admin_menu')):
8
9 class acfe_admin_menu{
10
11 /**
12 * construct
13 */
14 function __construct(){
15
16 add_action('admin_menu', array($this, 'admin_menu'), 999);
17
18 }
19
20
21 /**
22 * admin_menu
23 *
24 * Swap menu items to the correct order
25 */
26 function admin_menu(){
27
28 // global
29 global $submenu;
30
31 // bail early
32 if(!acfe_get($submenu, array('edit.php?post_type=acf-field-group'))){
33 return;
34 }
35
36 // vars
37 $new_menu = array();
38 $all_menu = $submenu['edit.php?post_type=acf-field-group'];
39
40 // order
41 $order = array(
42 'edit.php?post_type=acf-field-group',
43 'post-new.php?post_type=acf-field-group',
44 'edit-tags.php?taxonomy=acf-field-group-category',
45 'edit.php?post_type=acfe-dbt',
46 'edit.php?post_type=acfe-form',
47 'edit.php?post_type=acfe-dop',
48 'edit.php?post_type=acf-post-type',
49 'acfe-settings',
50 'edit.php?post_type=acf-taxonomy',
51 'edit.php?post_type=acf-ui-options-page',
52 'acf-tools',
53 'acf-settings-updates',
54 );
55
56 // loop
57 foreach($submenu['edit.php?post_type=acf-field-group'] as $k => $item){
58
59 //name
60 $name = $item[2];
61
62 // search
63 $position = array_search($name, $order);
64
65 // found position
66 if($position !== false){
67 $this->assign_submenu($new_menu, $position, $item, $all_menu, $k);
68 }
69
70 }
71
72 // sort new menu
73 ksort($new_menu);
74
75 // assign new menu
76 $submenu['edit.php?post_type=acf-field-group'] = $new_menu;
77
78 // add menu items that are left
79 if(!empty($all_menu)){
80 $submenu['edit.php?post_type=acf-field-group'] = array_merge($new_menu, $all_menu);
81 }
82
83 }
84
85
86 /**
87 * assign_submenu
88 *
89 * @param $new_menu
90 * @param $new_menu_key
91 * @param $item
92 * @param $all_menu
93 * @param $all_menu_key
94 */
95 function assign_submenu(&$new_menu, $new_menu_key, $item, &$all_menu, $all_menu_key){
96
97 $new_menu[ $new_menu_key ] = $item;
98 unset($all_menu[ $all_menu_key ]);
99
100 }
101
102 }
103
104 new acfe_admin_menu();
105
106 endif;