Changeset 2968855
- Timestamp:
- 09/19/2023 05:49:35 PM (2 years ago)
- Location:
- plus-features-for-advanced-custom-fields
- Files:
-
- 112 added
- 1 deleted
- 7 edited
-
tags/1.3.1 (added)
-
tags/1.3.1/LICENSE.txt (added)
-
tags/1.3.1/README.txt (added)
-
tags/1.3.1/acfp.php (added)
-
tags/1.3.1/admin (added)
-
tags/1.3.1/admin/class-acfp-admin.php (added)
-
tags/1.3.1/admin/css (added)
-
tags/1.3.1/admin/css/acfp-admin.css (added)
-
tags/1.3.1/admin/index.php (added)
-
tags/1.3.1/admin/js (added)
-
tags/1.3.1/admin/js/acfp-admin.js (added)
-
tags/1.3.1/admin/partials (added)
-
tags/1.3.1/admin/partials/acfp-admin-display.php (added)
-
tags/1.3.1/assets (added)
-
tags/1.3.1/assets/build (added)
-
tags/1.3.1/assets/build/admin (added)
-
tags/1.3.1/assets/build/common (added)
-
tags/1.3.1/assets/build/common/css (added)
-
tags/1.3.1/assets/build/common/js (added)
-
tags/1.3.1/assets/build/common/js/acfp-input-override.js (added)
-
tags/1.3.1/assets/build/common/js/acfp-input-override.min.js (added)
-
tags/1.3.1/assets/build/css (added)
-
tags/1.3.1/assets/build/css/acfp-field-dual-range-slider.min.css (added)
-
tags/1.3.1/assets/build/css/acfp-field-dual-range-slider.min.css.map (added)
-
tags/1.3.1/assets/build/css/acfp-field-dual-range-slider.scss (added)
-
tags/1.3.1/assets/build/js (added)
-
tags/1.3.1/assets/build/js/acfp-field-dual-range-slider.js (added)
-
tags/1.3.1/assets/build/js/acfp-field-dual-range-slider.min.js (added)
-
tags/1.3.1/assets/build/public (added)
-
tags/1.3.1/assets/screenshot-1.png (added)
-
tags/1.3.1/assets/screenshot-2.png (added)
-
tags/1.3.1/assets/screenshot-3.png (added)
-
tags/1.3.1/assets/screenshot-4.png (added)
-
tags/1.3.1/assets/screenshot-5.png (added)
-
tags/1.3.1/common (added)
-
tags/1.3.1/common/class-acfp-common.php (added)
-
tags/1.3.1/common/css (added)
-
tags/1.3.1/common/css/acfp-admin.css (added)
-
tags/1.3.1/common/index.php (added)
-
tags/1.3.1/common/js (added)
-
tags/1.3.1/common/js/acfp-common.js (added)
-
tags/1.3.1/common/partials (added)
-
tags/1.3.1/common/partials/acfp-common-display.php (added)
-
tags/1.3.1/includes (added)
-
tags/1.3.1/includes/acfp-utility.php (added)
-
tags/1.3.1/includes/class-acfp-activator.php (added)
-
tags/1.3.1/includes/class-acfp-deactivator.php (added)
-
tags/1.3.1/includes/class-acfp-i18n.php (added)
-
tags/1.3.1/includes/class-acfp-loader.php (added)
-
tags/1.3.1/includes/class-acfp.php (added)
-
tags/1.3.1/includes/fields (added)
-
tags/1.3.1/includes/fields/class-acfp-acf-field-dual-range-slider.php (added)
-
tags/1.3.1/includes/fields/class-acfp-acf-link-field.php (added)
-
tags/1.3.1/includes/fields/mods (added)
-
tags/1.3.1/includes/fields/mods/class-acfp-acf-link-field-mod.php (added)
-
tags/1.3.1/includes/index.php (added)
-
tags/1.3.1/includes/renders (added)
-
tags/1.3.1/includes/renders/class-acfp-render-button-group.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-checkbox.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-dual-range-slider.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-email.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-file.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-image.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-link.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-number.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-oembed.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-page-link.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-post-object.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-radio.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-range.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-relationship.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-select.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-taxonomy.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-text.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-textarea.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-true-false.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-url.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-user.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render-wysiwyg.php (added)
-
tags/1.3.1/includes/renders/class-acfp-render.php (added)
-
tags/1.3.1/includes/renders/interface-acfp-render-field-type.php (added)
-
tags/1.3.1/includes/shortcodes (added)
-
tags/1.3.1/includes/shortcodes/class-acfp-shortcode.php (added)
-
tags/1.3.1/index.php (added)
-
tags/1.3.1/languages (added)
-
tags/1.3.1/languages/acfp.pot (added)
-
tags/1.3.1/public (added)
-
tags/1.3.1/public/class-acfp-public.php (added)
-
tags/1.3.1/public/css (added)
-
tags/1.3.1/public/css/acfp-public.css (added)
-
tags/1.3.1/public/index.php (added)
-
tags/1.3.1/public/js (added)
-
tags/1.3.1/public/js/acfp-public.js (added)
-
tags/1.3.1/public/partials (added)
-
tags/1.3.1/public/partials/acfp-public-display.php (added)
-
tags/1.3.1/uninstall.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/acfp.php (modified) (2 diffs)
-
trunk/admin/class-acfp-admin.php (modified) (3 diffs)
-
trunk/admin/js/acfp-input-override.js (deleted)
-
trunk/assets/build/admin (added)
-
trunk/assets/build/common (added)
-
trunk/assets/build/common/css (added)
-
trunk/assets/build/common/js (added)
-
trunk/assets/build/common/js/acfp-input-override.js (added)
-
trunk/assets/build/common/js/acfp-input-override.min.js (added)
-
trunk/assets/build/public (added)
-
trunk/common (added)
-
trunk/common/class-acfp-common.php (added)
-
trunk/common/css (added)
-
trunk/common/css/acfp-admin.css (added)
-
trunk/common/index.php (added)
-
trunk/common/js (added)
-
trunk/common/js/acfp-common.js (added)
-
trunk/common/partials (added)
-
trunk/common/partials/acfp-common-display.php (added)
-
trunk/includes/class-acfp.php (modified) (5 diffs)
-
trunk/includes/fields/class-acfp-acf-field-dual-range-slider.php (modified) (6 diffs)
-
trunk/includes/fields/mods/class-acfp-acf-link-field-mod.php (modified) (3 diffs)
-
trunk/includes/shortcodes/class-acfp-shortcode.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plus-features-for-advanced-custom-fields/trunk/README.txt
r2967759 r2968855 5 5 Requires at least: 5.0 6 6 Tested up to: 6.3 7 Stable tag: 1.3. 07 Stable tag: 1.3.1 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 339 339 == Changelog == 340 340 341 = 1.3.1 = 342 Fixed: JavaScript exception. 343 341 344 = 1.3.0 = 342 345 Added rel="nofollow" on ACF link field type. … … 372 375 == Upgrade Notice == 373 376 374 = 1.3. 0=375 Added shortcode support for button_group, true_false and link.377 = 1.3.1 = 378 Fixed: JavaScript exception. -
plus-features-for-advanced-custom-fields/trunk/acfp.php
r2967777 r2968855 16 16 * Plugin URI: https://wordpress.org/plugins/plus-features-for-advanced-custom-fields 17 17 * Description: Adds extra features to Advanced Custom Fields plugin(ACF) 18 * Version: 1.3. 018 * Version: 1.3.1 19 19 * Author: the WP Catalyst 20 20 * Author URI: https://profiles.wordpress.org/thewpcatalyst/ … … 35 35 * Rename this for your plugin and update it as you release new versions. 36 36 */ 37 define( 'ACFP_VERSION', '1.3. 0' );37 define( 'ACFP_VERSION', '1.3.1' ); 38 38 39 39 /** -
plus-features-for-advanced-custom-fields/trunk/admin/class-acfp-admin.php
r2967754 r2968855 20 20 * @author the WP Catalyst <[email protected]> 21 21 */ 22 class A cfp_Admin {22 class ACFP_Admin { 23 23 24 24 /** … … 104 104 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/acfp-admin.js', array( 'jquery' ), $this->version, false ); 105 105 106 wp_enqueue_script( $this->plugin_name . '-override', plugin_dir_url( __FILE__ ) . 'js/acfp-input-override.js', array( 'jquery' ), $this->version, true );107 106 } 107 108 108 109 109 /** … … 113 113 */ 114 114 public function init() { 115 $this->remove_acf_link_field_type_hooks();// they will be re-added on this plugin.116 $this->include_field_types();117 115 } 118 119 /**120 * Removes the original hooks added on acf_field_link. This prevents overridden functions from been called.121 *122 * @return void123 */124 public function remove_acf_link_field_type_hooks() {125 $instance = acf_get_field_type( 'link' );126 // value127 if ( $instance instanceof acf_field_link ) {128 $this->remove_field_type_filter( $instance->name, 'acf/load_value', array( $instance, 'load_value' ), 10, 3 );129 $this->remove_field_type_filter( $instance->name, 'acf/update_value', array( $instance, 'update_value' ), 10, 3 );130 $this->remove_field_type_filter( $instance->name, 'acf/format_value', array( $instance, 'format_value' ), 10, 3 );131 $this->remove_field_type_filter( $instance->name, 'acf/validate_value', array( $instance, 'validate_value' ), 10, 4 );132 $this->remove_field_type_action( $instance->name, 'acf/delete_value', array( $instance, 'delete_value' ), 10, 3 );133 134 // field135 $this->remove_field_type_filter( $instance->name, 'acf/validate_rest_value', array( $instance, 'validate_rest_value' ), 10, 3 );136 $this->remove_field_type_filter( $instance->name, 'acf/validate_field', array( $instance, 'validate_field' ), 10, 1 );137 $this->remove_field_type_filter( $instance->name, 'acf/load_field', array( $instance, 'load_field' ), 10, 1 );138 $this->remove_field_type_filter( $instance->name, 'acf/update_field', array( $instance, 'update_field' ), 10, 1 );139 $this->remove_field_type_filter( $instance->name, 'acf/duplicate_field', array( $instance, 'duplicate_field' ), 10, 1 );140 $this->remove_field_type_action( $instance->name, 'acf/delete_field', array( $instance, 'delete_field' ), 10, 1 );141 $this->remove_field_type_action( $instance->name, 'acf/render_field', array( $instance, 'render_field' ), 9, 1 );142 143 $this->remove_field_type_action( $instance->name, 'acf/render_field_settings', array( $instance, 'render_field_settings' ), 9, 1 );144 $this->remove_field_type_filter( $instance->name, 'acf/prepare_field', array( $instance, 'prepare_field' ), 10, 1 );145 $this->remove_field_type_filter( $instance->name, 'acf/translate_field', array( $instance, 'translate_field' ), 10, 1 );146 147 // input actions148 $this->remove_action( 'acf/input/admin_enqueue_scripts', array( $instance, 'input_admin_enqueue_scripts' ), 10, 0 );149 $this->remove_action( 'acf/input/admin_head', array( $instance, 'input_admin_head' ), 10, 0 );150 $this->remove_action( 'acf/input/form_data', array( $instance, 'input_form_data' ), 10, 1 );151 $this->remove_filter( 'acf/input/admin_l10n', array( $instance, 'input_admin_l10n' ), 10, 1 );152 $this->remove_action( 'acf/input/admin_footer', array( $instance, 'input_admin_footer' ), 10, 1 );153 154 // field group actions155 $this->remove_action( 'acf/field_group/admin_enqueue_scripts', array( $instance, 'field_group_admin_enqueue_scripts' ), 10, 0 );156 $this->remove_action( 'acf/field_group/admin_head', array( $instance, 'field_group_admin_head' ), 10, 0 );157 $this->remove_action( 'acf/field_group/admin_footer', array( $instance, 'field_group_admin_footer' ), 10, 0 );158 159 foreach ( acf_get_combined_field_type_settings_tabs() as $tab_key => $tab_label ) {160 $this->remove_field_type_action( $instance->name, "acf/field_group/render_field_settings_tab/{$tab_key}", array( $instance, "render_field_{$tab_key}_settings" ), 9, 1 );161 }162 }163 164 }165 166 /**167 * Removes field specific filter168 *169 * @param string $field_type_name the name used to register the field.170 * @param string $tag name of the hook171 * @param string $function_to_add callback.172 * @param integer $priority priority.173 * @param integer $accepted_args number of args.174 * @return void175 */176 function remove_field_type_filter( string $field_type_name, string $tag = '', $function_to_add = '', int $priority = 10, int $accepted_args = 1 ) {177 $tag .= '/type=' . $field_type_name;178 $this->remove_filter( $tag, $function_to_add, $priority, $accepted_args );179 180 }181 182 /**183 * Removes filter184 *185 * @param string $field_type_name the name used to register the field.186 * @param string $tag name of the hook187 * @param string $function_to_add callback.188 * @param integer $priority priority.189 * @param integer $accepted_args number of args.190 * @return void191 */192 function remove_filter( string $tag = '', $function_to_add = '', int $priority = 10, int $accepted_args = 1 ) {193 remove_filter( $tag, $function_to_add, $priority, $accepted_args );194 195 }196 197 /**198 * Removes field specific action199 *200 * @param string $field_type_name the name used to register the field.201 * @param string $tag name of the hook202 * @param string $function_to_add callback.203 * @param integer $priority priority.204 * @param integer $accepted_args number of args.205 * @return void206 */207 function remove_field_type_action( string $field_type_name, string $tag = '', $function_to_add = '', int $priority = 10, int $accepted_args = 1 ) {208 $tag .= '/type=' . $field_type_name;209 $this->remove_action( $tag, $function_to_add, $priority, $accepted_args );210 }211 212 /**213 * Removes action214 *215 * @param string $tag name of the hook216 * @param string $function_to_add callback.217 * @param integer $priority priority.218 * @param integer $accepted_args number of args.219 * @return void220 */221 function remove_action( string $tag = '', $function_to_add = '', int $priority = 10, int $accepted_args = 1 ) {222 remove_action( $tag, $function_to_add, $priority, $accepted_args );223 }224 225 226 /**227 * Includes extra fields228 *229 * @return void230 */231 public function include_field_types() {232 if ( ! function_exists( 'acf_register_field_type' ) ) {233 return;234 }235 236 $acfp_field_types_classes = array(237 'ACFP_ACF_Field_Dual_Range_Slider' => 'includes/fields/class-acfp-acf-field-dual-range-slider.php',238 'ACFP_ACF_Link_Field' => 'includes/fields/class-acfp-acf-link-field.php',239 );240 241 // phpcs:ignore WordPress.NamingConventions.ValidHookName242 $acfp_field_types_classes = apply_filters( 'acfp/include_field_types', $acfp_field_types_classes, $this->acfp );243 244 foreach ( $acfp_field_types_classes as $field_type_class => $class_path ) {245 require_once plugin_dir_path( dirname( __FILE__ ) ) . $class_path;246 acf_register_field_type( $field_type_class );247 }248 249 }250 251 116 } -
plus-features-for-advanced-custom-fields/trunk/includes/class-acfp.php
r2967754 r2968855 86 86 $this->version = ACFP_VERSION; 87 87 } else { 88 $this->version = '1.3. 0';88 $this->version = '1.3.1'; 89 89 } 90 90 $this->plugin_name = 'acfp'; … … 151 151 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-acfp-admin.php'; 152 152 153 /** 154 * The class responsible for defining all actions that occur in both admin and public area. 155 */ 156 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'common/class-acfp-common.php'; 153 157 /** 154 158 * The class responsible for defining all actions that occur in the public-facing … … 225 229 226 230 $plugin_acf_link_mod = new ACFP_ACF_Link_Field_Mod( $this ); 231 $this->loader->add_action( 'acf/init', $plugin_acf_link_mod, 'acf_init' ); 232 $this->loader->add_action( 'acf/register_scripts', $plugin_acf_link_mod, 'enqueue_extra_scripts_after_acf_scripts_and_styles', 10, 2 ); 227 233 $this->loader->add_action( 'acf/load_value/type=link', $plugin_acf_link_mod, 'load_value', 10, 3 ); 228 234 $this->loader->add_action( 'after_wp_tiny_mce', $plugin_acf_link_mod, 'after_wp_tiny_mce' ); 235 236 $plugin_common = new ACFP_Common( $this ); 237 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_common, 'enqueue_styles' ); 238 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_common, 'enqueue_scripts' ); 239 $this->loader->add_action( 'acf/init', $plugin_common, 'acf_init' ); 240 $this->loader->add_action( 'init', $plugin_common, 'init' ); 229 241 } 230 242 … … 237 249 */ 238 250 private function define_admin_hooks() { 239 240 $plugin_admin = new Acfp_Admin( $this ); 241 251 $plugin_admin = new ACFP_Admin( $this ); 242 252 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); 243 253 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); 244 $this->loader->add_action( 'acf/init', $plugin_admin, 'init' ); 245 254 $this->loader->add_action( 'init', $plugin_admin, 'init' ); 246 255 } 247 256 … … 254 263 */ 255 264 private function define_public_hooks() { 256 257 265 $plugin_public = new Acfp_Public( $this->get_plugin_name(), $this->get_version() ); 258 259 266 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); 260 267 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); -
plus-features-for-advanced-custom-fields/trunk/includes/fields/class-acfp-acf-field-dual-range-slider.php
r2967754 r2968855 12 12 /** 13 13 * The ACFP_ACF_Field_Dual_Range_Slider class 14 * 14 15 * @since 1.0.0 15 16 */ … … 38 39 * @since 5.0.0 39 40 */ 40 function __construct() {41 public function __construct() { 41 42 $this->id = 'dual_range_slider'; 42 43 … … 108 109 * @param $field (array) the $field being edited. 109 110 */ 110 function render_field_settings( $field ) {111 public function render_field_settings( $field ) { 111 112 acf_render_field_setting( 112 113 $field, … … 174 175 * @param $field the $field being rendered. 175 176 */ 176 function render_field( $field ) {177 public function render_field( $field ) { 177 178 $field_id = esc_attr( $this->id ); 178 179 $min = intval( $field['min_value'] ); … … 262 263 * @return $value 263 264 */ 264 function update_value( $value, $post_id, $field ) {265 public function update_value( $value, $post_id, $field ) { 265 266 return $this->get_desired_value( $value ); 266 267 } … … 283 284 * @return $valid 284 285 */ 285 function validate_value( $valid, $value, $field, $input ) {286 public function validate_value( $valid, $value, $field, $input ) { 286 287 $desired_value = $this->get_desired_value( $value ); 287 288 if ( false === $desired_value ) { -
plus-features-for-advanced-custom-fields/trunk/includes/fields/mods/class-acfp-acf-link-field-mod.php
r2967754 r2968855 16 16 */ 17 17 class ACFP_ACF_Link_Field_Mod { 18 /** 19 * The ID of this plugin. 20 * 21 * @since 1.3.1 22 * @access private 23 * @var string $plugin_name The ID of this plugin. 24 */ 25 private $plugin_name; 26 27 /** 28 * The version of this plugin. 29 * 30 * @since 1.3.1 31 * @access private 32 * @var string $version The current version of this plugin. 33 */ 34 private $version; 35 36 /** 37 * Holds ACFP class instance 38 * 39 * @var ACFP 40 */ 41 private $acfp; 18 42 19 43 /** … … 24 48 */ 25 49 public function __construct( Acfp $acfp ) { 26 50 $this->acfp = $acfp; 51 $this->plugin_name = $acfp->get_plugin_name(); 52 $this->version = $acfp->get_version(); 27 53 } 28 54 … … 38 64 * @return mixed 39 65 */ 66 67 /** 68 * Fired on acf/init action. 69 * 70 * @since 1.3.1 71 * 72 * @return void 73 */ 74 public function acf_init() { 75 $this->remove_acf_link_field_type_hooks();// they will be re-added on this plugin. 76 } 77 78 /** 79 * Removes the original hooks added on acf_field_link. This prevents overridden functions from been called. 80 * 81 * @since 1.3.1 82 * 83 * @return void 84 */ 85 public function remove_acf_link_field_type_hooks() { 86 $instance = acf_get_field_type( 'link' ); 87 // value. 88 if ( $instance instanceof acf_field_link ) { 89 $this->remove_field_type_filter( $instance->name, 'acf/load_value', array( $instance, 'load_value' ), 10, 3 ); 90 $this->remove_field_type_filter( $instance->name, 'acf/update_value', array( $instance, 'update_value' ), 10, 3 ); 91 $this->remove_field_type_filter( $instance->name, 'acf/format_value', array( $instance, 'format_value' ), 10, 3 ); 92 $this->remove_field_type_filter( $instance->name, 'acf/validate_value', array( $instance, 'validate_value' ), 10, 4 ); 93 $this->remove_field_type_action( $instance->name, 'acf/delete_value', array( $instance, 'delete_value' ), 10, 3 ); 94 95 // field. 96 $this->remove_field_type_filter( $instance->name, 'acf/validate_rest_value', array( $instance, 'validate_rest_value' ), 10, 3 ); 97 $this->remove_field_type_filter( $instance->name, 'acf/validate_field', array( $instance, 'validate_field' ), 10, 1 ); 98 $this->remove_field_type_filter( $instance->name, 'acf/load_field', array( $instance, 'load_field' ), 10, 1 ); 99 $this->remove_field_type_filter( $instance->name, 'acf/update_field', array( $instance, 'update_field' ), 10, 1 ); 100 $this->remove_field_type_filter( $instance->name, 'acf/duplicate_field', array( $instance, 'duplicate_field' ), 10, 1 ); 101 $this->remove_field_type_action( $instance->name, 'acf/delete_field', array( $instance, 'delete_field' ), 10, 1 ); 102 $this->remove_field_type_action( $instance->name, 'acf/render_field', array( $instance, 'render_field' ), 9, 1 ); 103 104 $this->remove_field_type_action( $instance->name, 'acf/render_field_settings', array( $instance, 'render_field_settings' ), 9, 1 ); 105 $this->remove_field_type_filter( $instance->name, 'acf/prepare_field', array( $instance, 'prepare_field' ), 10, 1 ); 106 $this->remove_field_type_filter( $instance->name, 'acf/translate_field', array( $instance, 'translate_field' ), 10, 1 ); 107 108 // input actions. 109 $this->remove_action( 'acf/input/admin_enqueue_scripts', array( $instance, 'input_admin_enqueue_scripts' ), 10, 0 ); 110 $this->remove_action( 'acf/input/admin_head', array( $instance, 'input_admin_head' ), 10, 0 ); 111 $this->remove_action( 'acf/input/form_data', array( $instance, 'input_form_data' ), 10, 1 ); 112 $this->remove_filter( 'acf/input/admin_l10n', array( $instance, 'input_admin_l10n' ), 10, 1 ); 113 $this->remove_action( 'acf/input/admin_footer', array( $instance, 'input_admin_footer' ), 10, 1 ); 114 115 // field group actions. 116 $this->remove_action( 'acf/field_group/admin_enqueue_scripts', array( $instance, 'field_group_admin_enqueue_scripts' ), 10, 0 ); 117 $this->remove_action( 'acf/field_group/admin_head', array( $instance, 'field_group_admin_head' ), 10, 0 ); 118 $this->remove_action( 'acf/field_group/admin_footer', array( $instance, 'field_group_admin_footer' ), 10, 0 ); 119 120 foreach ( acf_get_combined_field_type_settings_tabs() as $tab_key => $tab_label ) { 121 $this->remove_field_type_action( $instance->name, "acf/field_group/render_field_settings_tab/{$tab_key}", array( $instance, "render_field_{$tab_key}_settings" ), 9, 1 ); 122 } 123 } 124 125 } 126 127 /** 128 * Removes field specific filter 129 * 130 * @since 1.3.1 131 * 132 * @param string $field_type_name the name used to register the field. 133 * @param string $tag name of the hook. 134 * @param string $function_to_add callback. 135 * @param integer $priority priority. 136 * @param integer $accepted_args number of args. 137 * @return void 138 */ 139 protected function remove_field_type_filter( string $field_type_name, string $tag = '', $function_to_add = '', int $priority = 10, int $accepted_args = 1 ) { 140 $tag .= '/type=' . $field_type_name; 141 $this->remove_filter( $tag, $function_to_add, $priority, $accepted_args ); 142 143 } 144 145 /** 146 * Removes filter 147 * 148 * @since 1.3.1 149 * 150 * @param string $tag name of the hook. 151 * @param mixed $function_to_add callback. 152 * @param integer $priority priority. 153 * @param integer $accepted_args number of args. 154 * @return void 155 */ 156 protected function remove_filter( string $tag = '', $function_to_add = '', int $priority = 10, int $accepted_args = 1 ) { 157 remove_filter( $tag, $function_to_add, $priority, $accepted_args ); 158 } 159 160 /** 161 * Removes field specific action 162 * 163 * @since 1.3.1 164 * 165 * @param string $field_type_name the name used to register the field. 166 * @param string $tag name of the hook. 167 * @param string $function_to_add callback. 168 * @param integer $priority priority. 169 * @param integer $accepted_args number of args. 170 * @return void 171 */ 172 protected function remove_field_type_action( string $field_type_name, string $tag = '', $function_to_add = '', int $priority = 10, int $accepted_args = 1 ) { 173 $tag .= '/type=' . $field_type_name; 174 $this->remove_action( $tag, $function_to_add, $priority, $accepted_args ); 175 } 176 177 /** 178 * Removes action 179 * 180 * @since 1.3.1 181 * 182 * @param string $tag name of the hook. 183 * @param string $function_to_add callback. 184 * @param integer $priority priority. 185 * @param integer $accepted_args number of args. 186 * @return void 187 */ 188 protected function remove_action( string $tag = '', $function_to_add = '', int $priority = 10, int $accepted_args = 1 ) { 189 remove_action( $tag, $function_to_add, $priority, $accepted_args ); 190 } 191 192 /** 193 * Register the JavaScript after ACF core scripts and styles have been registered. 194 * 195 * @since 1.3.1 196 * 197 * @param mixed $version ACF version. 198 * @param mixed $suffix ACF suffix for '.min' or ''. 199 * 200 * @return void 201 */ 202 public function enqueue_extra_scripts_after_acf_scripts_and_styles( $version, $suffix ) { 203 wp_enqueue_script( $this->plugin_name . '-acfp-input-override', $this->acfp->get_plugin_base_url() . 'assets/build/common/js/acfp-input-override' . $suffix . '.js', array( 'jquery' ), $this->version, true ); 204 } 40 205 41 206 /** -
plus-features-for-advanced-custom-fields/trunk/includes/shortcodes/class-acfp-shortcode.php
r2967754 r2968855 66 66 */ 67 67 public function acfp_shortcode( $atts ) { 68 // Return if ACF is not active. 69 if(! class_exists('ACF')){ 70 return; 71 } 72 68 73 // Return if the ACF shortcode is disabled. 69 74 if ( ! acf_get_setting( 'enable_shortcode' ) ) { … … 243 248 $render = new ACFP_Render_Link( $field_value, $a ); 244 249 break; 245 /*case 'page_link': 250 /* 251 case 'page_link': 246 252 $render = new ACFP_Render_Page_Link( $field_value, $a ); 247 253 break;
Note: See TracChangeset
for help on using the changeset viewer.