PluginProbe ʕ •ᴥ•ʔ
Advanced Custom Fields: Extended / 0.9
Advanced Custom Fields: Extended v0.9
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 / module-manager.php
acf-extended / includes Last commit date
admin 2 years ago field-groups 2 years ago fields 2 years ago fields-settings 2 years ago locations 3 years ago modules 2 years ago screens 3 years ago acfe-deprecated-functions.php 2 years ago acfe-field-functions.php 2 years ago acfe-field-group-functions.php 2 years ago acfe-file-functions.php 3 years ago acfe-form-functions.php 2 years ago acfe-helper-functions.php 2 years ago acfe-meta-functions.php 3 years ago acfe-post-functions.php 3 years ago acfe-screen-functions.php 3 years ago acfe-template-functions.php 3 years ago acfe-term-functions.php 3 years ago acfe-user-functions.php 3 years ago acfe-wp-functions.php 3 years ago assets.php 3 years ago compatibility-6.0.php 2 years ago compatibility.php 2 years ago field-extend.php 3 years ago field.php 3 years ago hooks.php 3 years ago init.php 3 years ago local-meta.php 3 years ago module-acf.php 2 years ago module-db.php 3 years ago module-l10n.php 3 years ago module-legacy.php 3 years ago module-manager.php 3 years ago module-post.php 2 years ago module-posts.php 2 years ago module-upgrades.php 3 years ago module.php 2 years ago multilang.php 3 years ago settings.php 3 years ago template-tags.php 2 years ago third-party.php 3 years ago upgrades.php 3 years ago
module-manager.php
146 lines
1 <?php
2
3 if(!defined('ABSPATH')){
4 exit;
5 }
6
7 if(!class_exists('acfe_module_manager')):
8
9 class acfe_module_manager{
10
11 /**
12 * construct
13 */
14 function __construct(){
15
16 add_action('acfe/init', array($this, 'register_items'), 99);
17 add_action('init', array($this, 'register_items'));
18 add_action('init', array($this, 'register_post_types'));
19
20 }
21
22
23 /**
24 * register_items
25 */
26 function register_items(){
27
28 // get current hook
29 // ini or acf/init
30 $hook = current_filter();
31
32 // query modules by register hook
33 $modules = acfe_query_modules(array(
34 'register' => $hook
35 ));
36
37 // bail early
38 if(!$modules){
39 return;
40 }
41
42 // loop modules
43 foreach($modules as $module){
44
45 // check active
46 if(!$module->is_active()){
47 continue;
48 }
49
50 // get loaded items
51 $items = $module->get_local_items();
52 $items = $module->apply_module_filters('acfe/module/register_items', $items);
53
54 // loop items
55 foreach($items as $item){
56
57 // cleanup keys (ID, local, _valid...)
58 $item = $module->prepare_item_for_export($item);
59
60 // filters
61 $item = $module->apply_module_filters('acfe/module/register_item_args', $item);
62
63 // bail early
64 if($item === false){
65 continue;
66 }
67
68 // bail early
69 if(!$item['active']){
70 continue;
71 }
72
73 // actions
74 $module->do_module_action('acfe/module/register_item', $item);
75
76 }
77
78 }
79
80 }
81
82
83 /**
84 * register_post_types
85 */
86 function register_post_types(){
87
88 // get all modules
89 $modules = acfe_get_modules();
90
91 // loop modules
92 foreach($modules as $module){
93
94 // check active
95 if(!$module->is_active()){
96 continue;
97 }
98
99 // capability
100 $capability = acf_get_setting('show_admin') ? acf_get_setting('capability') : false;
101
102 // arguments
103 $args = wp_parse_args($module->args, array(
104 'label' => '',
105 'labels' => array(),
106 'supports' => array('title'),
107 'hierarchical' => false,
108 'public' => false,
109 'show_ui' => true,
110 'show_in_menu' => false,
111 'menu_icon' => 'dashicons-layout',
112 'show_in_admin_bar' => false,
113 'show_in_nav_menus' => false,
114 'can_export' => false,
115 'has_archive' => false,
116 'rewrite' => false,
117 'exclude_from_search' => true,
118 'publicly_queryable' => false,
119 'capabilities' => array(
120 'publish_posts' => $capability,
121 'edit_posts' => $capability,
122 'edit_others_posts' => $capability,
123 'delete_posts' => $capability,
124 'delete_others_posts' => $capability,
125 'read_private_posts' => $capability,
126 'edit_post' => $capability,
127 'delete_post' => $capability,
128 'read_post' => $capability,
129 ),
130 'acfe_admin_orderby' => 'title',
131 'acfe_admin_order' => 'ASC',
132 'acfe_admin_ppp' => 999,
133 ));
134
135 // register post type
136 register_post_type($module->post_type, $args);
137
138 }
139
140 }
141
142 }
143
144 acf_new_instance('acfe_module_manager');
145
146 endif;