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.2.1 4.2.2 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.4.10 4.4.11 4.4.12 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 5.10 5.10.1 5.10.2 5.11 5.11.1 5.11.2 5.11.3 5.11.4 5.12 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.6.10 5.6.2 5.6.3 5.6.4 5.6.5 5.6.6 5.6.7 5.6.8 5.6.9 5.7.0 5.7.1 5.7.10 5.7.12 5.7.13 5.7.2 5.7.3 5.7.4 5.7.5 5.7.6 5.7.7 5.7.8 5.7.9 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.2 5.8.3 5.8.4
advanced-custom-fields / includes / third-party.php
advanced-custom-fields / includes Last commit date
admin 1 month ago ajax 3 months ago api 2 weeks ago fields 4 weeks ago forms 4 weeks ago legacy 5 months ago locations 1 month ago post-types 5 months ago rest-api 4 weeks ago walkers 5 months ago acf-bidirectional-functions.php 5 months ago acf-field-functions.php 5 months ago acf-field-group-functions.php 5 months ago acf-form-functions.php 5 months ago acf-helper-functions.php 5 months ago acf-hook-functions.php 5 months ago acf-input-functions.php 5 months ago acf-internal-post-type-functions.php 5 months ago acf-meta-functions.php 2 months ago acf-post-functions.php 5 months ago acf-post-type-functions.php 5 months ago acf-taxonomy-functions.php 5 months ago acf-user-functions.php 5 months ago acf-utility-functions.php 5 months ago acf-value-functions.php 5 months ago acf-wp-functions.php 5 months ago assets.php 5 months ago class-acf-data.php 5 months ago class-acf-internal-post-type.php 5 months ago compatibility.php 5 months ago deprecated.php 5 months ago fields.php 5 months ago index.php 2 years ago l10n.php 5 months ago local-fields.php 5 months ago local-json.php 3 months ago local-meta.php 5 months ago locations.php 5 months ago loop.php 5 months ago media.php 5 months ago rest-api.php 5 months ago revisions.php 3 months ago third-party.php 5 months ago upgrades.php 2 months ago validation.php 5 months ago wpml.php 5 months ago
third-party.php
154 lines
1 <?php
2 /**
3 * @package ACF
4 * @author WP Engine
5 *
6 * © 2026 Advanced Custom Fields (ACF®). All rights reserved.
7 * "ACF" is a trademark of WP Engine.
8 * Licensed under the GNU General Public License v2 or later.
9 * https://www.gnu.org/licenses/gpl-2.0.html
10 */
11
12 if ( ! class_exists( 'acf_third_party' ) ) :
13
14 /**
15 * ACF 3rd Party Compatibility Class
16 */
17 class acf_third_party {
18
19 /**
20 * This function will setup the class functionality
21 *
22 * @since 5.0.0
23 */
24 public function __construct() {
25 // Tabify Edit Screen - http://wordpress.org/extend/plugins/tabify-edit-screen/
26 if ( class_exists( 'Tabify_Edit_Screen' ) ) {
27 add_filter( 'tabify_posttypes', array( $this, 'tabify_posttypes' ) );
28 add_action( 'tabify_add_meta_boxes', array( $this, 'tabify_add_meta_boxes' ) );
29 }
30
31 // Post Type Switcher - http://wordpress.org/extend/plugins/post-type-switcher/
32 if ( class_exists( 'Post_Type_Switcher' ) ) {
33 add_filter( 'pts_allowed_pages', array( $this, 'pts_allowed_pages' ) );
34 }
35
36 // Event Espresso - https://wordpress.org/plugins/event-espresso-decaf/
37 if ( function_exists( 'espresso_version' ) ) {
38 add_filter( 'acf/get_post_types', array( $this, 'ee_get_post_types' ), 10, 2 );
39 }
40
41 // Dark Mode
42 if ( class_exists( 'Dark_Mode' ) ) {
43 add_action( 'doing_dark_mode', array( $this, 'doing_dark_mode' ) );
44 }
45 }
46
47 /**
48 * Event Espresso post types do not use the native post.php edit page, but instead render their own.
49 * Show the EE post types in lists where 'show_ui' is used.
50 *
51 * @date 24/2/18
52 * @since 5.6.9
53 *
54 * @param array $post_types Post types array.
55 * @param array $args Other arguments array.
56 * @return array
57 */
58 public function ee_get_post_types( $post_types, $args ) {
59 if ( ! empty( $args['show_ui'] ) ) {
60 $ee_post_types = get_post_types( array( 'show_ee_ui' => 1 ) );
61 $ee_post_types = array_keys( $ee_post_types );
62 $post_types = array_merge( $post_types, $ee_post_types );
63 $post_types = array_unique( $post_types );
64 }
65
66 return $post_types;
67 }
68
69 /**
70 * This function removes ACF post types from the tabify edit screen (post type selection sidebar)
71 *
72 * @since 3.5.1
73 *
74 * @param array $posttypes An array of post types supported by tabify.
75 * @return array
76 */
77 public function tabify_posttypes( $posttypes ) {
78 // unset ACF post types
79 unset( $posttypes['acf-field-group'] );
80 unset( $posttypes['acf-field'] );
81
82 return $posttypes;
83 }
84
85
86 /**
87 * This function creates dummy metaboxes on the tabify edit screen page
88 *
89 * @since 3.5.1
90 *
91 * @param string $post_type The name of the displayed post type.
92 */
93 public function tabify_add_meta_boxes( $post_type ) {
94 // get field groups
95 $field_groups = acf_get_field_groups();
96
97 if ( ! empty( $field_groups ) ) {
98 foreach ( $field_groups as $field_group ) {
99
100 // vars
101 $id = "acf-{$field_group['key']}";
102 $title = 'ACF: ' . acf_esc_html( acf_get_field_group_title( $field_group ) );
103
104 // add meta box
105 add_meta_box( $id, $title, '__return_true', $post_type );
106 }
107 }
108 }
109
110
111 /**
112 * This filter will prevent PTS from running on the field group page
113 *
114 * @since 5.0.0
115 *
116 * @param array $pages An array of pages PTS should run on.
117 * @return array
118 */
119 public function pts_allowed_pages( $pages ) {
120
121 // vars
122 $post_type = '';
123
124 // phpcs:disable WordPress.Security.NonceVerification.Recommended -- Verified elsewhere.
125 // check $_GET because it is too early to use functions / global vars.
126 if ( ! empty( $_GET['post_type'] ) ) {
127 $post_type = sanitize_text_field( $_GET['post_type'] );
128 } elseif ( ! empty( $_GET['post'] ) ) {
129 $post_type = get_post_type( $_GET['post'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized when get_post_type() calls get_post().
130 }
131 // phpcs:enable WordPress.Security.NonceVerification.Recommended
132 // check post type
133 if ( $post_type == 'acf-field-group' ) {
134 $pages = array();
135 }
136
137 // return
138 return $pages;
139 }
140
141 /**
142 * Runs during 'admin_enqueue_scripts' if dark mode is enabled
143 *
144 * @since 5.7.3
145 */
146 public function doing_dark_mode() {
147 $min = defined( 'ACF_DEVELOPMENT_MODE' ) && ACF_DEVELOPMENT_MODE ? '' : '.min';
148 wp_enqueue_style( 'acf-dark', acf_get_url( 'assets/css/acf-dark' . $min . '.css' ), array(), ACF_VERSION );
149 }
150 }
151
152 new acf_third_party();
153 endif;
154