PluginProbe ʕ •ᴥ•ʔ
Advanced Custom Fields: Extended / trunk
Advanced Custom Fields: Extended vtrunk
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 / forms / form-post.php
acf-extended / includes / forms Last commit date
form-post-type-archive.php 1 month ago form-post-type-list.php 2 months ago form-post.php 2 months ago form-taxonomy-list.php 2 months ago
form-post.php
76 lines
1 <?php
2
3 if(!defined('ABSPATH')){
4 exit;
5 }
6
7 if(!class_exists('acfe_form_post')):
8
9 class acfe_form_post{
10
11 /**
12 * construct
13 */
14 function __construct(){
15
16 // re-add sidebar submitdiv metabox
17 acfe_replace_action('load-post.php', array('ACF_Form_Post', 'initialize'), array($this, 'initialize'));
18 acfe_replace_action('load-post-new.php', array('ACF_Form_Post', 'initialize'), array($this, 'initialize'));
19
20 }
21
22
23 /**
24 * initialize
25 *
26 * Rewrites ACF_Form_Post->initialize() which remove the submitdiv metabox in ACF Field Group since ACF 6.0+
27 *
28 * advanced-custom-fields-pro/includes/forms/form-post.php:48
29 */
30 function initialize(){
31
32 // globals
33 global $typenow;
34
35 // get restricted post types
36 $internal_post_types = $this->get_internal_posts_types();
37 $restricted = array_merge($internal_post_types, array('acf-taxonomy', 'attachment'));
38
39 // restrict specific post types
40 if(in_array($typenow, $restricted)){
41 return;
42 }
43
44 // enqueue scripts
45 acf_enqueue_scripts(array(
46 'uploader' => true,
47 ));
48
49 // actions
50 add_action('add_meta_boxes', array(acf_get_instance('ACF_Form_Post'), 'add_meta_boxes'), 10, 2);
51
52 }
53
54
55 /**
56 * get_internal_posts_types
57 *
58 * @return array|string[]
59 */
60 function get_internal_posts_types(){
61
62 // function was introduced in acf 6.1+
63 if(function_exists('acf_get_internal_post_types')){
64 return (array) acf_get_internal_post_types();
65 }
66
67 // fallback
68 return array('acf-field-group', 'acf-post-type', 'acf-taxonomy', 'acf-ui-options-page');
69
70 }
71
72 }
73
74 acf_new_instance('acfe_form_post');
75
76 endif;