Update to 5.9.3
This commit is contained in:
parent
a2b8fc9aec
commit
76383b8979
4
acf.php
4
acf.php
|
|
@ -3,7 +3,7 @@
|
|||
Plugin Name: Advanced Custom Fields PRO
|
||||
Plugin URI: https://www.advancedcustomfields.com
|
||||
Description: Customize WordPress with powerful, professional and intuitive fields.
|
||||
Version: 5.9.1
|
||||
Version: 5.9.3
|
||||
Author: Elliot Condon
|
||||
Author URI: https://www.advancedcustomfields.com
|
||||
Text Domain: acf
|
||||
|
|
@ -17,7 +17,7 @@ if( ! class_exists('ACF') ) :
|
|||
class ACF {
|
||||
|
||||
/** @var string The plugin version number. */
|
||||
var $version = '5.9.1';
|
||||
var $version = '5.9.3';
|
||||
|
||||
/** @var array The plugin settings array. */
|
||||
var $settings = array();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -3434,7 +3434,8 @@
|
|||
wait: 'load',
|
||||
|
||||
events: {
|
||||
'removeField': 'onRemove'
|
||||
'removeField': 'onRemove',
|
||||
'duplicateField': 'onDuplicate'
|
||||
},
|
||||
|
||||
$input: function(){
|
||||
|
|
@ -3474,6 +3475,13 @@
|
|||
if( this.select2 ) {
|
||||
this.select2.destroy();
|
||||
}
|
||||
},
|
||||
|
||||
onDuplicate: function( e, $el, $duplicate ){
|
||||
if( this.select2 ) {
|
||||
$duplicate.find('.select2-container').remove();
|
||||
$duplicate.find('select').removeClass('select2-hidden-accessible');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -7768,9 +7776,12 @@
|
|||
});
|
||||
}
|
||||
|
||||
// remove conflicting atts
|
||||
$select.removeData('ajax');
|
||||
$select.removeAttr('data-ajax');
|
||||
// Temporarily remove conflicting attribute.
|
||||
var attrAjax = $select.attr( 'data-ajax' );
|
||||
if( attrAjax !== undefined ) {
|
||||
$select.removeData('ajax');
|
||||
$select.removeAttr('data-ajax');
|
||||
}
|
||||
|
||||
// ajax
|
||||
if( this.get('ajax') ) {
|
||||
|
|
@ -7831,6 +7842,11 @@
|
|||
// add class
|
||||
$container.addClass('-acf');
|
||||
|
||||
// Add back temporarily removed attr.
|
||||
if( attrAjax !== undefined ) {
|
||||
$select.attr('data-ajax', attrAjax);
|
||||
}
|
||||
|
||||
// action for 3rd party customization
|
||||
acf.doAction('select2_init', $select, options, this.data, (field || false), this);
|
||||
},
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -124,6 +124,20 @@ function acf_request_args( $args = array() ) {
|
|||
return $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a single $_REQUEST arg with fallback.
|
||||
*
|
||||
* @date 23/10/20
|
||||
* @since 5.9.2
|
||||
*
|
||||
* @param string $key The property name.
|
||||
* @param mixed $default The default value to fallback to.
|
||||
* @return mixed
|
||||
*/
|
||||
function acf_request_arg( $name = '', $default = null ) {
|
||||
return isset( $_REQUEST[ $name ] ) ? $_REQUEST[ $name ] : $default;
|
||||
}
|
||||
|
||||
// Register store.
|
||||
acf_register_store( 'filters' );
|
||||
|
||||
|
|
|
|||
|
|
@ -1,64 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* acf_decode_post_id
|
||||
*
|
||||
* Returns an array containing the object type and id for the given post_id string.
|
||||
*
|
||||
* @date 25/1/19
|
||||
* @since 5.7.11
|
||||
*
|
||||
* @param (int|string) $post_id The post id.
|
||||
* @return array()
|
||||
*/
|
||||
function acf_decode_post_id( $post_id = 0 ) {
|
||||
|
||||
// Default data
|
||||
$data = array(
|
||||
'type' => 'post',
|
||||
'id' => 0
|
||||
);
|
||||
|
||||
// Check if is numeric.
|
||||
if( is_numeric($post_id) ) {
|
||||
$data['id'] = (int) $post_id;
|
||||
|
||||
// Check if is string.
|
||||
} elseif( is_string($post_id) ) {
|
||||
|
||||
// Determine "{$type}_{$id}" from string.
|
||||
$bits = explode( '_', $post_id );
|
||||
$id = array_pop( $bits );
|
||||
$type = implode( '_', $bits );
|
||||
|
||||
// Check if is meta type.
|
||||
if( function_exists("get_{$type}_meta") && is_numeric($id) ) {
|
||||
$data['type'] = $type;
|
||||
$data['id'] = (int) $id;
|
||||
|
||||
// Check if is taxonomy name.
|
||||
} elseif( taxonomy_exists($type) && is_numeric($id) ) {
|
||||
$data['type'] = 'term';
|
||||
$data['id'] = (int) $id;
|
||||
|
||||
// Otherwise, default to option.
|
||||
} else {
|
||||
$data['type'] = 'option';
|
||||
$data['id'] = $post_id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the $data array after it has been decoded.
|
||||
*
|
||||
* @date 12/02/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param array $data The type and id array.
|
||||
*/
|
||||
return apply_filters( "acf/decode_post_id", $data, $post_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* acf_get_meta
|
||||
*
|
||||
|
|
@ -74,20 +15,20 @@ function acf_get_meta( $post_id = 0 ) {
|
|||
|
||||
// Allow filter to short-circuit load_value logic.
|
||||
$null = apply_filters( "acf/pre_load_meta", null, $post_id );
|
||||
if( $null !== null ) {
|
||||
return ( $null === '__return_null' ) ? null : $null;
|
||||
}
|
||||
|
||||
if( $null !== null ) {
|
||||
return ( $null === '__return_null' ) ? null : $null;
|
||||
}
|
||||
|
||||
// Decode $post_id for $type and $id.
|
||||
extract( acf_decode_post_id($post_id) );
|
||||
|
||||
// Use get_$type_meta() function when possible.
|
||||
if( function_exists("get_{$type}_meta") ) {
|
||||
$allmeta = call_user_func("get_{$type}_meta", $id, '');
|
||||
|
||||
// Default to wp_options.
|
||||
} else {
|
||||
// Determine CRUD function.
|
||||
// - Relies on decoded post_id result to identify option or meta types.
|
||||
// - Uses xxx_metadata(type) instead of xxx_type_meta() to bypass additional logic that could alter the ID.
|
||||
if( $type === 'option' ) {
|
||||
$allmeta = acf_get_option_meta( $id );
|
||||
} else {
|
||||
$allmeta = get_metadata( $type, $id, '' );
|
||||
}
|
||||
|
||||
// Loop over meta and check that a reference exists for each value.
|
||||
|
|
@ -181,10 +122,10 @@ function acf_get_metadata( $post_id = 0, $name = '', $hidden = false ) {
|
|||
|
||||
// Allow filter to short-circuit logic.
|
||||
$null = apply_filters( "acf/pre_load_metadata", null, $post_id, $name, $hidden );
|
||||
if( $null !== null ) {
|
||||
return ( $null === '__return_null' ) ? null : $null;
|
||||
}
|
||||
|
||||
if( $null !== null ) {
|
||||
return ( $null === '__return_null' ) ? null : $null;
|
||||
}
|
||||
|
||||
// Decode $post_id for $type and $id.
|
||||
extract( acf_decode_post_id($post_id) );
|
||||
|
||||
|
|
@ -196,11 +137,11 @@ function acf_get_metadata( $post_id = 0, $name = '', $hidden = false ) {
|
|||
return null;
|
||||
}
|
||||
|
||||
// Check option.
|
||||
// Determine CRUD function.
|
||||
// - Relies on decoded post_id result to identify option or meta types.
|
||||
// - Uses xxx_metadata(type) instead of xxx_type_meta() to bypass additional logic that could alter the ID.
|
||||
if( $type === 'option' ) {
|
||||
return get_option( "{$prefix}{$id}_{$name}", null );
|
||||
|
||||
// Check meta.
|
||||
} else {
|
||||
$meta = get_metadata( $type, $id, "{$prefix}{$name}", false );
|
||||
return isset($meta[0]) ? $meta[0] : null;
|
||||
|
|
@ -225,10 +166,10 @@ function acf_update_metadata( $post_id = 0, $name = '', $value = '', $hidden = f
|
|||
|
||||
// Allow filter to short-circuit logic.
|
||||
$pre = apply_filters( "acf/pre_update_metadata", null, $post_id, $name, $value, $hidden );
|
||||
if( $pre !== null ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
if( $pre !== null ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
// Decode $post_id for $type and $id.
|
||||
extract( acf_decode_post_id($post_id) );
|
||||
|
||||
|
|
@ -240,15 +181,13 @@ function acf_update_metadata( $post_id = 0, $name = '', $value = '', $hidden = f
|
|||
return false;
|
||||
}
|
||||
|
||||
// Update option.
|
||||
// Determine CRUD function.
|
||||
// - Relies on decoded post_id result to identify option or meta types.
|
||||
// - Uses xxx_metadata(type) instead of xxx_type_meta() to bypass additional logic that could alter the ID.
|
||||
if( $type === 'option' ) {
|
||||
|
||||
// Unslash value to match update_metadata() functionality.
|
||||
$value = wp_unslash( $value );
|
||||
$autoload = (bool) acf_get_setting('autoload');
|
||||
return update_option( "{$prefix}{$id}_{$name}", $value, $autoload );
|
||||
|
||||
// Update meta.
|
||||
} else {
|
||||
return update_metadata( $type, $id, "{$prefix}{$name}", $value );
|
||||
}
|
||||
|
|
@ -271,10 +210,10 @@ function acf_delete_metadata( $post_id = 0, $name = '', $hidden = false ) {
|
|||
|
||||
// Allow filter to short-circuit logic.
|
||||
$pre = apply_filters( "acf/pre_delete_metadata", null, $post_id, $name, $hidden );
|
||||
if( $pre !== null ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
if( $pre !== null ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
// Decode $post_id for $type and $id.
|
||||
extract( acf_decode_post_id($post_id) );
|
||||
|
||||
|
|
@ -286,12 +225,11 @@ function acf_delete_metadata( $post_id = 0, $name = '', $hidden = false ) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Update option.
|
||||
// Determine CRUD function.
|
||||
// - Relies on decoded post_id result to identify option or meta types.
|
||||
// - Uses xxx_metadata(type) instead of xxx_type_meta() to bypass additional logic that could alter the ID.
|
||||
if( $type === 'option' ) {
|
||||
$autoload = (bool) acf_get_setting('autoload');
|
||||
return delete_option( "{$prefix}{$id}_{$name}" );
|
||||
|
||||
// Update meta.
|
||||
} else {
|
||||
return delete_metadata( $type, $id, "{$prefix}{$name}" );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,3 +106,111 @@ function acf_get_object_type( $object_type, $object_subtype = '' ) {
|
|||
*/
|
||||
return apply_filters( 'acf/get_object_type', $object, $object_type, $object_subtype );
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes a post_id value such as 1 or "user_1" into an array containing the type and ID.
|
||||
*
|
||||
* @date 25/1/19
|
||||
* @since 5.7.11
|
||||
*
|
||||
* @param (int|string) $post_id The post id.
|
||||
* @return array
|
||||
*/
|
||||
function acf_decode_post_id( $post_id = 0 ) {
|
||||
$type = '';
|
||||
$id = 0;
|
||||
|
||||
// Interpret numeric value (123).
|
||||
if ( is_numeric($post_id) ) {
|
||||
$type = 'post';
|
||||
$id = $post_id;
|
||||
|
||||
// Interpret string value ("user_123" or "option").
|
||||
} elseif ( is_string($post_id) ) {
|
||||
$i = strrpos($post_id, '_');
|
||||
if( $i > 0 ) {
|
||||
$type = substr($post_id, 0, $i);
|
||||
$id = substr($post_id, $i+1);
|
||||
} else {
|
||||
$type = $post_id;
|
||||
}
|
||||
|
||||
// Handle incorrect param type.
|
||||
} else {
|
||||
return compact( 'type', 'id' );
|
||||
}
|
||||
|
||||
// Validate props based on param format.
|
||||
$format = $type . '_' . (is_numeric($id) ? '%d' : '%s');
|
||||
switch ( $format ) {
|
||||
case 'post_%d':
|
||||
$type = 'post';
|
||||
$id = absint( $id );
|
||||
break;
|
||||
case 'term_%d':
|
||||
$type = 'term';
|
||||
$id = absint( $id );
|
||||
break;
|
||||
case 'attachment_%d':
|
||||
$type = 'post';
|
||||
$id = absint( $id );
|
||||
break;
|
||||
case 'comment_%d':
|
||||
$type = 'comment';
|
||||
$id = absint( $id );
|
||||
break;
|
||||
case 'widget_%s':
|
||||
case 'widget_%d':
|
||||
$type = 'option';
|
||||
$id = $post_id;
|
||||
break;
|
||||
case 'menu_%d':
|
||||
$type = 'term';
|
||||
$id = absint( $id );
|
||||
break;
|
||||
case 'menu_item_%d':
|
||||
$type = 'post';
|
||||
$id = absint( $id );
|
||||
break;
|
||||
case 'user_%d':
|
||||
$type = 'user';
|
||||
$id = absint( $id );
|
||||
break;
|
||||
case 'block_%s':
|
||||
$type = 'block';
|
||||
$id = $post_id;
|
||||
break;
|
||||
case 'option_%s':
|
||||
$type = 'option';
|
||||
$id = $post_id;
|
||||
break;
|
||||
case 'blog_%d':
|
||||
case 'site_%d':
|
||||
$type = 'blog';
|
||||
$id = absint( $id );
|
||||
break;
|
||||
default:
|
||||
// Check for taxonomy name.
|
||||
if( taxonomy_exists($type) && is_numeric($id) ) {
|
||||
$type = 'term';
|
||||
$id = absint( $id );
|
||||
break;
|
||||
}
|
||||
|
||||
// Treat unknown post_id format as an option.
|
||||
$type = 'option';
|
||||
$id = $post_id;
|
||||
break;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the decoded post_id information.
|
||||
*
|
||||
* @date 25/1/19
|
||||
* @since 5.7.11
|
||||
*
|
||||
* @param array $props An array containing "type" and "id" information.
|
||||
* @param (int|string) $post_id The post id.
|
||||
*/
|
||||
return apply_filters( "acf/decode_post_id", compact( 'type', 'id' ), $post_id );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2611,7 +2611,8 @@ function acf_get_valid_post_id( $post_id = 0 ) {
|
|||
}
|
||||
|
||||
|
||||
// $post_id may be an object
|
||||
// $post_id may be an object.
|
||||
// todo: Compare class types instead.
|
||||
if( is_object($post_id) ) {
|
||||
|
||||
// post
|
||||
|
|
@ -2627,7 +2628,7 @@ function acf_get_valid_post_id( $post_id = 0 ) {
|
|||
// term
|
||||
} elseif( isset($post_id->taxonomy, $post_id->term_id) ) {
|
||||
|
||||
$post_id = acf_get_term_post_id( $post_id->taxonomy, $post_id->term_id );
|
||||
$post_id = 'term_' . $post_id->term_id;
|
||||
|
||||
// comment
|
||||
} elseif( isset($post_id->comment_ID) ) {
|
||||
|
|
@ -2815,36 +2816,6 @@ function acf_isset_termmeta( $taxonomy = '' ) {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_get_term_post_id
|
||||
*
|
||||
* This function will return a valid post_id string for a given term and taxonomy
|
||||
*
|
||||
* @type function
|
||||
* @date 6/2/17
|
||||
* @since 5.5.6
|
||||
*
|
||||
* @param $taxonomy (string)
|
||||
* @param $term_id (int)
|
||||
* @return (string)
|
||||
*/
|
||||
|
||||
function acf_get_term_post_id( $taxonomy, $term_id ) {
|
||||
|
||||
// WP < 4.4
|
||||
if( !acf_isset_termmeta() ) {
|
||||
|
||||
return $taxonomy . '_' . $term_id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return 'term_' . $term_id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_upload_files
|
||||
*
|
||||
|
|
@ -4870,5 +4841,3 @@ function acf_is_block_editor() {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -138,22 +138,19 @@ function acf_get_taxonomy_labels( $taxonomies = array() ) {
|
|||
*/
|
||||
|
||||
function acf_get_term_title( $term ) {
|
||||
|
||||
// set to term name
|
||||
$title = $term->name;
|
||||
|
||||
// allow for empty name
|
||||
// Allow for empty name.
|
||||
if( $title === '' ) {
|
||||
$title = __('(no title)', 'acf');
|
||||
}
|
||||
|
||||
// prepent ancestors indentation
|
||||
// Prepend ancestors indentation.
|
||||
if( is_taxonomy_hierarchical($term->taxonomy) ) {
|
||||
$ancestors = get_ancestors( $term->term_id, $term->taxonomy );
|
||||
$title = str_repeat('- ', count($ancestors)) . $title;
|
||||
}
|
||||
|
||||
// return
|
||||
return $title;
|
||||
}
|
||||
|
||||
|
|
@ -493,6 +490,19 @@ function acf_get_choice_from_term( $term, $format = 'term_id' ) {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
/**
|
||||
* Returns a valid post_id string for a given term and taxonomy.
|
||||
* No longer needed since WP introduced the termmeta table in WP 4.4.
|
||||
*
|
||||
* @date 6/2/17
|
||||
* @since 5.5.6
|
||||
* @deprecated 5.9.2
|
||||
*
|
||||
* @param $taxonomy (string) The taxonomy type.
|
||||
* @param $term_id (int) The term ID.
|
||||
* @return (string)
|
||||
*/
|
||||
function acf_get_term_post_id( $taxonomy, $term_id ) {
|
||||
_deprecated_function( __FUNCTION__, '5.9.2', 'string format term_%d' );
|
||||
return 'term_' . $term_id;
|
||||
}
|
||||
|
|
@ -47,18 +47,34 @@ class acf_field_color_picker extends acf_field {
|
|||
function input_admin_enqueue_scripts() {
|
||||
|
||||
// Register scripts for non-admin.
|
||||
// Applies logic from wp_default_scripts() function.
|
||||
// Applies logic from wp_default_scripts() function defined in "wp-includes/script-loader.php".
|
||||
if( !is_admin() ) {
|
||||
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
||||
$scripts = wp_scripts();
|
||||
$scripts->add( 'iris', '/wp-admin/js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), '1.0.7', 1 );
|
||||
$scripts->add( 'wp-color-picker', "/wp-admin/js/color-picker$suffix.js", array( 'iris' ), false, 1 );
|
||||
$scripts->set_translations( 'wp-color-picker' );
|
||||
|
||||
// Handle localisation across multiple WP versions.
|
||||
// WP 5.0+
|
||||
if( method_exists($scripts, 'set_translations') ) {
|
||||
$scripts->set_translations( 'wp-color-picker' );
|
||||
// WP 4.9
|
||||
} else {
|
||||
$scripts->localize( 'wp-color-picker', 'wpColorPickerL10n', array(
|
||||
'clear' => __( 'Clear' ),
|
||||
'clearAriaLabel' => __( 'Clear color' ),
|
||||
'defaultString' => __( 'Default' ),
|
||||
'defaultAriaLabel' => __( 'Select default color' ),
|
||||
'pick' => __( 'Select Color' ),
|
||||
'defaultLabel' => __( 'Color value' ),
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Enqueue.
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
wp_enqueue_script( 'wp-color-picker' );
|
||||
wp_enqueue_script( 'wp-color-picker' );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ class acf_field_page_link extends acf_field {
|
|||
|
||||
|
||||
// order posts by search
|
||||
if( $is_search && empty($args['orderby']) ) {
|
||||
if( $is_search && empty($args['orderby']) && isset($args['s']) ) {
|
||||
|
||||
$posts = acf_order_by_search( $posts, $args['s'] );
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ class acf_field_post_object extends acf_field {
|
|||
|
||||
|
||||
// order posts by search
|
||||
if( $is_search && empty($args['orderby']) ) {
|
||||
if( $is_search && empty($args['orderby']) && isset($args['s']) ) {
|
||||
|
||||
$posts = acf_order_by_search( $posts, $args['s'] );
|
||||
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ class acf_field_relationship extends acf_field {
|
|||
|
||||
|
||||
// order posts by search
|
||||
if( $is_search && empty($args['orderby']) ) {
|
||||
if( $is_search && empty($args['orderby']) && isset($args['s']) ) {
|
||||
|
||||
$posts = acf_order_by_search( $posts, $args['s'] );
|
||||
|
||||
|
|
@ -643,7 +643,7 @@ class acf_field_relationship extends acf_field {
|
|||
/*
|
||||
* format_value()
|
||||
*
|
||||
* This filter is appied to the $value after it is loaded from the db and before it is returned to the template
|
||||
* This filter is applied to the $value after it is loaded from the db and before it is returned to the template
|
||||
*
|
||||
* @type filter
|
||||
* @since 3.6
|
||||
|
|
@ -733,7 +733,7 @@ class acf_field_relationship extends acf_field {
|
|||
/*
|
||||
* update_value()
|
||||
*
|
||||
* This filter is appied to the $value before it is updated in the db
|
||||
* This filter is applied to the $value before it is updated in the db
|
||||
*
|
||||
* @type filter
|
||||
* @since 3.6
|
||||
|
|
@ -777,4 +777,4 @@ acf_register_field_type( 'acf_field_relationship' );
|
|||
|
||||
endif; // class_exists check
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -32,13 +32,16 @@ class acf_field_taxonomy extends acf_field {
|
|||
'field_type' => 'checkbox',
|
||||
'multiple' => 0,
|
||||
'allow_null' => 0,
|
||||
//'load_save_terms' => 0, // removed in 5.2.7
|
||||
'return_format' => 'id',
|
||||
'add_term' => 1, // 5.2.3
|
||||
'load_terms' => 0, // 5.2.7
|
||||
'save_terms' => 0 // 5.2.7
|
||||
);
|
||||
|
||||
// Register filter variations.
|
||||
acf_add_filter_variations( 'acf/fields/taxonomy/query', array('name', 'key'), 1 );
|
||||
acf_add_filter_variations( 'acf/fields/taxonomy/result', array('name', 'key'), 2 );
|
||||
|
||||
|
||||
// ajax
|
||||
add_action('wp_ajax_acf/fields/taxonomy/query', array($this, 'ajax_query'));
|
||||
|
|
@ -156,8 +159,6 @@ class acf_field_taxonomy extends acf_field {
|
|||
|
||||
// filters
|
||||
$args = apply_filters('acf/fields/taxonomy/query', $args, $field, $options['post_id']);
|
||||
$args = apply_filters('acf/fields/taxonomy/query/name=' . $field['name'], $args, $field, $options['post_id'] );
|
||||
$args = apply_filters('acf/fields/taxonomy/query/key=' . $field['key'], $args, $field, $options['post_id'] );
|
||||
|
||||
|
||||
// get terms
|
||||
|
|
@ -227,54 +228,35 @@ class acf_field_taxonomy extends acf_field {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* get_term_title
|
||||
*
|
||||
* This function returns the HTML for a result
|
||||
*
|
||||
* @type function
|
||||
* @date 1/11/2013
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $post (object)
|
||||
* @param $field (array)
|
||||
* @param $post_id (int) the post_id to which this value is saved to
|
||||
* @return (string)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns the Term's title displayed in the field UI.
|
||||
*
|
||||
* @date 1/11/2013
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param WP_Term $term The term object.
|
||||
* @param array $field The field settings.
|
||||
* @param mixed $post_id The post_id being edited.
|
||||
* @return string
|
||||
*/
|
||||
function get_term_title( $term, $field, $post_id = 0 ) {
|
||||
$title = acf_get_term_title( $term );
|
||||
|
||||
// get post_id
|
||||
if( !$post_id ) $post_id = acf_get_form_data('post_id');
|
||||
// Default $post_id to current post being edited.
|
||||
$post_id = $post_id ? $post_id : acf_get_form_data('post_id');
|
||||
|
||||
|
||||
// vars
|
||||
$title = '';
|
||||
|
||||
|
||||
// ancestors
|
||||
$ancestors = get_ancestors( $term->term_id, $field['taxonomy'] );
|
||||
|
||||
if( !empty($ancestors) ) {
|
||||
|
||||
$title .= str_repeat('- ', count($ancestors));
|
||||
|
||||
}
|
||||
|
||||
|
||||
// title
|
||||
$title .= $term->name;
|
||||
|
||||
|
||||
// filters
|
||||
$title = apply_filters('acf/fields/taxonomy/result', $title, $term, $field, $post_id);
|
||||
$title = apply_filters('acf/fields/taxonomy/result/name=' . $field['_name'] , $title, $term, $field, $post_id);
|
||||
$title = apply_filters('acf/fields/taxonomy/result/key=' . $field['key'], $title, $term, $field, $post_id);
|
||||
|
||||
|
||||
// return
|
||||
return $title;
|
||||
/**
|
||||
* Filters the term title.
|
||||
*
|
||||
* @date 1/11/2013
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param string $title The term title.
|
||||
* @param WP_Term $term The term object.
|
||||
* @param array $field The field settings.
|
||||
* @param (int|string) $post_id The post_id being edited.
|
||||
*/
|
||||
return apply_filters('acf/fields/taxonomy/result', $title, $term, $field, $post_id);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -347,9 +329,14 @@ class acf_field_taxonomy extends acf_field {
|
|||
// load_terms
|
||||
if( $field['load_terms'] ) {
|
||||
|
||||
// Decode $post_id for $type and $id.
|
||||
extract( acf_decode_post_id($post_id) );
|
||||
if( $type === 'block' ) {
|
||||
// Get parent block...
|
||||
}
|
||||
|
||||
// get terms
|
||||
$info = acf_get_post_id_info($post_id);
|
||||
$term_ids = wp_get_object_terms($info['id'], $field['taxonomy'], array('fields' => 'ids', 'orderby' => 'none'));
|
||||
$term_ids = wp_get_object_terms( $id, $field['taxonomy'], array('fields' => 'ids', 'orderby' => 'none') );
|
||||
|
||||
|
||||
// bail early if no terms
|
||||
|
|
@ -481,11 +468,14 @@ class acf_field_taxonomy extends acf_field {
|
|||
// Although not fully supported by WordPress, non "post" objects may use the term relationships table.
|
||||
// Sharing taxonomies across object types is discoraged, but unique taxonomies work well.
|
||||
// Note: Do not attempt to restrict to "post" only. This has been attempted in 5.8.9 and later reverted.
|
||||
$info = acf_get_post_id_info( $post_id );
|
||||
extract( acf_decode_post_id($post_id) );
|
||||
if( $type === 'block' ) {
|
||||
// Get parent block...
|
||||
}
|
||||
|
||||
// Loop over taxonomies and save terms.
|
||||
foreach( $this->save_post_terms as $taxonomy => $term_ids ){
|
||||
wp_set_object_terms( $info['id'], $term_ids, $taxonomy, false );
|
||||
wp_set_object_terms( $id, $term_ids, $taxonomy, false );
|
||||
}
|
||||
|
||||
// Reset storage.
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class acf_form_nav_menu {
|
|||
function update_nav_menu( $menu_id ) {
|
||||
|
||||
// vars
|
||||
$post_id = acf_get_term_post_id( 'nav_menu', $menu_id );
|
||||
$post_id = 'term_' . $menu_id;
|
||||
|
||||
|
||||
// verify and remove nonce
|
||||
|
|
@ -288,7 +288,7 @@ class acf_form_nav_menu {
|
|||
|
||||
// vars
|
||||
$nav_menu_id = acf_get_data('nav_menu_id');
|
||||
$post_id = acf_get_term_post_id( 'nav_menu', $nav_menu_id );
|
||||
$post_id = 'term_' . $nav_menu_id;
|
||||
|
||||
|
||||
// get field groups
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class acf_form_taxonomy {
|
|||
function add_term( $taxonomy ) {
|
||||
|
||||
// vars
|
||||
$post_id = acf_get_term_post_id( $taxonomy, 0 );
|
||||
$post_id = 'term_0';
|
||||
|
||||
|
||||
// update vars
|
||||
|
|
@ -191,7 +191,7 @@ class acf_form_taxonomy {
|
|||
function edit_term( $term, $taxonomy ) {
|
||||
|
||||
// vars
|
||||
$post_id = acf_get_term_post_id( $term->taxonomy, $term->term_id );
|
||||
$post_id = 'term_' . $term->term_id;
|
||||
|
||||
|
||||
// update vars
|
||||
|
|
@ -345,7 +345,7 @@ if( $this->view == 'add' ): ?>
|
|||
function save_term( $term_id, $tt_id, $taxonomy ) {
|
||||
|
||||
// vars
|
||||
$post_id = acf_get_term_post_id( $taxonomy, $term_id );
|
||||
$post_id = 'term_' . $term_id;
|
||||
|
||||
|
||||
// verify and remove nonce
|
||||
|
|
|
|||
|
|
@ -169,13 +169,13 @@ class acf_revisions {
|
|||
$value = $value[0];
|
||||
$key = $key[0];
|
||||
|
||||
|
||||
// bail early if $key is a not a field_key
|
||||
if( !acf_is_field_key($key) ) continue;
|
||||
|
||||
// Load field.
|
||||
$field = acf_get_field( $key );
|
||||
if( !$field ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// get field
|
||||
$field = acf_get_field( $key );
|
||||
$field_title = $field['label'] . ' (' . $name . ')';
|
||||
$field_order = $field['menu_order'];
|
||||
$ancestors = acf_get_field_ancestors( $field );
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@ msgstr ""
|
|||
"Project-Id-Version: Advanced Custom Fields Pro v5.8.5\n"
|
||||
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
||||
"POT-Creation-Date: 2020-08-17 10:46+0200\n"
|
||||
"PO-Revision-Date: 2020-08-17 10:13+0000\n"
|
||||
"Last-Translator: Maxime BJ <maxime@dysign.fr>\n"
|
||||
"PO-Revision-Date: 2020-09-11 10:26+0930\n"
|
||||
"Last-Translator: Elliot Condon <e@elliotcondon.com>\n"
|
||||
"Language-Team: Français\n"
|
||||
"Language: fr_FR\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
"X-Generator: Loco https://localise.biz/\n"
|
||||
"X-Generator: Poedit 1.8.1\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
||||
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
||||
|
|
@ -500,7 +500,8 @@ msgid "Review sites & upgrade"
|
|||
msgstr "Examiner les sites et mettre à niveau"
|
||||
|
||||
# @ acf
|
||||
#: includes/admin/admin.php:48 includes/admin/views/field-group-options.php:110
|
||||
#: includes/admin/admin.php:48
|
||||
#: includes/admin/views/field-group-options.php:110
|
||||
msgid "Custom Fields"
|
||||
msgstr "ACF"
|
||||
|
||||
|
|
@ -1370,7 +1371,8 @@ msgid "jQuery"
|
|||
msgstr "jQuery"
|
||||
|
||||
# @ acf
|
||||
#: includes/fields.php:354 includes/fields/class-acf-field-button-group.php:177
|
||||
#: includes/fields.php:354
|
||||
#: includes/fields/class-acf-field-button-group.php:177
|
||||
#: includes/fields/class-acf-field-checkbox.php:389
|
||||
#: includes/fields/class-acf-field-group.php:474
|
||||
#: includes/fields/class-acf-field-radio.php:290
|
||||
|
|
@ -1487,7 +1489,7 @@ msgstr "Valeur par défaut"
|
|||
#: includes/fields/class-acf-field-url.php:101
|
||||
#: includes/fields/class-acf-field-wysiwyg.php:372
|
||||
msgid "Appears when creating a new post"
|
||||
msgstr "Valeur affichée à la création d’une publicaiton"
|
||||
msgstr "Valeur affichée à la création d’une publication"
|
||||
|
||||
#: includes/fields/class-acf-field-button-group.php:183
|
||||
#: includes/fields/class-acf-field-checkbox.php:396
|
||||
|
|
@ -2749,8 +2751,8 @@ msgid "Validate Email"
|
|||
msgstr "Valider l’e-mail"
|
||||
|
||||
# @ acf
|
||||
#: includes/forms/form-front.php:104 pro/fields/class-acf-field-gallery.php:510
|
||||
#: pro/options-page.php:81
|
||||
#: includes/forms/form-front.php:104
|
||||
#: pro/fields/class-acf-field-gallery.php:510 pro/options-page.php:81
|
||||
msgid "Update"
|
||||
msgstr "Mise à jour"
|
||||
|
||||
|
|
@ -2995,7 +2997,8 @@ msgid "<b>Error</b>. Could not connect to update server"
|
|||
msgstr "<b>Erreur</b>. Impossible de joindre le serveur"
|
||||
|
||||
# @ acf
|
||||
#: pro/admin/admin-updates.php:118 pro/admin/views/html-settings-updates.php:12
|
||||
#: pro/admin/admin-updates.php:118
|
||||
#: pro/admin/views/html-settings-updates.php:12
|
||||
msgid "Updates"
|
||||
msgstr "Mises à jour"
|
||||
|
||||
|
|
@ -3026,12 +3029,12 @@ msgstr "Informations sur la licence"
|
|||
#, php-format
|
||||
msgid ""
|
||||
"To unlock updates, please enter your license key below. If you don't have a "
|
||||
"licence key, please see <a href=\"%s\" target=\"_blank\">details & "
|
||||
"pricing</a>."
|
||||
"licence key, please see <a href=\"%s\" target=\"_blank\">details & pricing</"
|
||||
"a>."
|
||||
msgstr ""
|
||||
"Pour débloquer les mises à jour, veuillez entrer votre clé de licence ci-"
|
||||
"dessous. Si vous n’en possédez pas encore une, jetez un oeil à nos <a "
|
||||
"href=\"%s\" target=\"_blank\">détails & tarifs</a>."
|
||||
"dessous. Si vous n’en possédez pas encore une, jetez un oeil à nos <a href="
|
||||
"\"%s\" target=\"_blank\">détails & tarifs</a>."
|
||||
|
||||
# @ acf
|
||||
#: pro/admin/views/html-settings-updates.php:28
|
||||
|
|
@ -3414,9 +3417,9 @@ msgstr "Options mises à jour"
|
|||
#: pro/updates.php:97
|
||||
#, php-format
|
||||
msgid ""
|
||||
"To enable updates, please enter your license key on the <a href=\"%s\">"
|
||||
"Updates</a> page. If you don't have a licence key, please see <a href=\"%s\">"
|
||||
"details & pricing</a>."
|
||||
"To enable updates, please enter your license key on the <a href=\"%s"
|
||||
"\">Updates</a> page. If you don't have a licence key, please see <a href=\"%s"
|
||||
"\">details & pricing</a>."
|
||||
msgstr ""
|
||||
"Pour activer les mises à jour, veuillez entrer votre clé de licence sur la "
|
||||
"page <a href=\"%s\">Mises à jour</a>. Si vous n’en possédez pas encore une, "
|
||||
|
|
|
|||
179
lang/acf.pot
179
lang/acf.pot
|
|
@ -3,7 +3,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: Advanced Custom Fields\n"
|
||||
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
||||
"POT-Creation-Date: 2020-08-18 08:57+1000\n"
|
||||
"POT-Creation-Date: 2020-10-29 10:30+0930\n"
|
||||
"PO-Revision-Date: 2015-06-11 13:00+1000\n"
|
||||
"Last-Translator: Elliot Condon <e@elliotcondon.com>\n"
|
||||
"Language-Team: Elliot Condon <e@elliotcondon.com>\n"
|
||||
|
|
@ -16,11 +16,12 @@ msgstr ""
|
|||
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
||||
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"X-Poedit-Basepath: ../\n"
|
||||
"X-Poedit-WPHeader: acf.php\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
||||
"X-Poedit-SearchPathExcluded-1: tests\n"
|
||||
|
||||
#: acf.php:68
|
||||
msgid "Advanced Custom Fields"
|
||||
|
|
@ -69,7 +70,7 @@ msgstr ""
|
|||
|
||||
#: acf.php:380 includes/admin/admin-field-group.php:232
|
||||
#: includes/admin/admin-field-groups.php:262
|
||||
#: pro/fields/class-acf-field-clone.php:811
|
||||
#: pro/fields/class-acf-field-clone.php:808
|
||||
msgid "Fields"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -236,7 +237,7 @@ msgstr ""
|
|||
#: includes/admin/views/field-group-field-conditional-logic.php:151
|
||||
#: includes/admin/views/field-group-locations.php:29
|
||||
#: includes/admin/views/html-location-group.php:3
|
||||
#: includes/api/api-helpers.php:3675
|
||||
#: includes/api/api-helpers.php:3646
|
||||
msgid "or"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -760,7 +761,7 @@ msgid "Label"
|
|||
msgstr ""
|
||||
|
||||
#: includes/admin/views/field-group-fields.php:6
|
||||
#: includes/fields/class-acf-field-taxonomy.php:936
|
||||
#: includes/fields/class-acf-field-taxonomy.php:926
|
||||
#: pro/fields/class-acf-field-flexible-content.php:597
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
|
@ -1088,42 +1089,42 @@ msgstr ""
|
|||
msgid "Full Size"
|
||||
msgstr ""
|
||||
|
||||
#: includes/api/api-helpers.php:1632 includes/api/api-term.php:147
|
||||
#: pro/fields/class-acf-field-clone.php:996
|
||||
#: includes/api/api-helpers.php:1632 includes/api/api-term.php:145
|
||||
#: pro/fields/class-acf-field-clone.php:993
|
||||
msgid "(no title)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/api/api-helpers.php:3596
|
||||
#: includes/api/api-helpers.php:3567
|
||||
#, php-format
|
||||
msgid "Image width must be at least %dpx."
|
||||
msgstr ""
|
||||
|
||||
#: includes/api/api-helpers.php:3601
|
||||
#: includes/api/api-helpers.php:3572
|
||||
#, php-format
|
||||
msgid "Image width must not exceed %dpx."
|
||||
msgstr ""
|
||||
|
||||
#: includes/api/api-helpers.php:3617
|
||||
#: includes/api/api-helpers.php:3588
|
||||
#, php-format
|
||||
msgid "Image height must be at least %dpx."
|
||||
msgstr ""
|
||||
|
||||
#: includes/api/api-helpers.php:3622
|
||||
#: includes/api/api-helpers.php:3593
|
||||
#, php-format
|
||||
msgid "Image height must not exceed %dpx."
|
||||
msgstr ""
|
||||
|
||||
#: includes/api/api-helpers.php:3640
|
||||
#: includes/api/api-helpers.php:3611
|
||||
#, php-format
|
||||
msgid "File size must be at least %s."
|
||||
msgstr ""
|
||||
|
||||
#: includes/api/api-helpers.php:3645
|
||||
#: includes/api/api-helpers.php:3616
|
||||
#, php-format
|
||||
msgid "File size must not exceed %s."
|
||||
msgstr ""
|
||||
|
||||
#: includes/api/api-helpers.php:3679
|
||||
#: includes/api/api-helpers.php:3650
|
||||
#, php-format
|
||||
msgid "File type must be %s."
|
||||
msgstr ""
|
||||
|
|
@ -1134,13 +1135,13 @@ msgstr ""
|
|||
|
||||
#: includes/assets.php:344 includes/fields/class-acf-field-true_false.php:79
|
||||
#: includes/fields/class-acf-field-true_false.php:159
|
||||
#: pro/admin/views/html-settings-updates.php:88
|
||||
#: pro/admin/views/html-settings-updates.php:86
|
||||
msgid "Yes"
|
||||
msgstr ""
|
||||
|
||||
#: includes/assets.php:345 includes/fields/class-acf-field-true_false.php:80
|
||||
#: includes/fields/class-acf-field-true_false.php:174
|
||||
#: pro/admin/views/html-settings-updates.php:98
|
||||
#: pro/admin/views/html-settings-updates.php:96
|
||||
msgid "No"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1216,7 +1217,7 @@ msgstr ""
|
|||
#: includes/fields/class-acf-field-checkbox.php:389
|
||||
#: includes/fields/class-acf-field-group.php:474
|
||||
#: includes/fields/class-acf-field-radio.php:290
|
||||
#: pro/fields/class-acf-field-clone.php:843
|
||||
#: pro/fields/class-acf-field-clone.php:840
|
||||
#: pro/fields/class-acf-field-flexible-content.php:554
|
||||
#: pro/fields/class-acf-field-flexible-content.php:603
|
||||
#: pro/fields/class-acf-field-repeater.php:449
|
||||
|
|
@ -1291,14 +1292,14 @@ msgstr ""
|
|||
#: includes/fields/class-acf-field-post_object.php:411
|
||||
#: includes/fields/class-acf-field-radio.php:244
|
||||
#: includes/fields/class-acf-field-select.php:382
|
||||
#: includes/fields/class-acf-field-taxonomy.php:781
|
||||
#: includes/fields/class-acf-field-taxonomy.php:771
|
||||
#: includes/fields/class-acf-field-user.php:63
|
||||
msgid "Allow Null?"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-button-group.php:168
|
||||
#: includes/fields/class-acf-field-checkbox.php:380
|
||||
#: includes/fields/class-acf-field-color_picker.php:131
|
||||
#: includes/fields/class-acf-field-color_picker.php:127
|
||||
#: includes/fields/class-acf-field-email.php:118
|
||||
#: includes/fields/class-acf-field-number.php:127
|
||||
#: includes/fields/class-acf-field-radio.php:281
|
||||
|
|
@ -1341,7 +1342,7 @@ msgstr ""
|
|||
#: includes/fields/class-acf-field-file.php:214
|
||||
#: includes/fields/class-acf-field-link.php:166
|
||||
#: includes/fields/class-acf-field-radio.php:304
|
||||
#: includes/fields/class-acf-field-taxonomy.php:826
|
||||
#: includes/fields/class-acf-field-taxonomy.php:816
|
||||
msgid "Return Value"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1368,7 +1369,7 @@ msgid "Both (Array)"
|
|||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-checkbox.php:25
|
||||
#: includes/fields/class-acf-field-taxonomy.php:768
|
||||
#: includes/fields/class-acf-field-taxonomy.php:758
|
||||
msgid "Checkbox"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1413,20 +1414,28 @@ msgstr ""
|
|||
msgid "Color Picker"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-color_picker.php:68
|
||||
#: includes/fields/class-acf-field-color_picker.php:64
|
||||
msgid "Clear"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-color_picker.php:69
|
||||
#: includes/fields/class-acf-field-color_picker.php:65
|
||||
msgid "Clear color"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-color_picker.php:66
|
||||
msgid "Default"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-color_picker.php:70
|
||||
#: includes/fields/class-acf-field-color_picker.php:67
|
||||
msgid "Select default color"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-color_picker.php:68
|
||||
msgid "Select Color"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-color_picker.php:71
|
||||
msgid "Current Color"
|
||||
#: includes/fields/class-acf-field-color_picker.php:69
|
||||
msgid "Color value"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-date_picker.php:25
|
||||
|
|
@ -1812,12 +1821,12 @@ msgid "Sub Fields"
|
|||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-group.php:475
|
||||
#: pro/fields/class-acf-field-clone.php:844
|
||||
#: pro/fields/class-acf-field-clone.php:841
|
||||
msgid "Specify the style used to render the selected fields"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-group.php:480
|
||||
#: pro/fields/class-acf-field-clone.php:849
|
||||
#: pro/fields/class-acf-field-clone.php:846
|
||||
#: pro/fields/class-acf-field-flexible-content.php:615
|
||||
#: pro/fields/class-acf-field-repeater.php:457
|
||||
#: pro/locations/class-acf-location-block.php:20
|
||||
|
|
@ -1825,14 +1834,14 @@ msgid "Block"
|
|||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-group.php:481
|
||||
#: pro/fields/class-acf-field-clone.php:850
|
||||
#: pro/fields/class-acf-field-clone.php:847
|
||||
#: pro/fields/class-acf-field-flexible-content.php:614
|
||||
#: pro/fields/class-acf-field-repeater.php:456
|
||||
msgid "Table"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-group.php:482
|
||||
#: pro/fields/class-acf-field-clone.php:851
|
||||
#: pro/fields/class-acf-field-clone.php:848
|
||||
#: pro/fields/class-acf-field-flexible-content.php:616
|
||||
#: pro/fields/class-acf-field-repeater.php:458
|
||||
msgid "Row"
|
||||
|
|
@ -2016,7 +2025,7 @@ msgstr ""
|
|||
|
||||
#: includes/fields/class-acf-field-page_link.php:262
|
||||
#: includes/fields/class-acf-field-post_object.php:267
|
||||
#: includes/fields/class-acf-field-taxonomy.php:958
|
||||
#: includes/fields/class-acf-field-taxonomy.php:948
|
||||
msgid "Parent"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -2133,7 +2142,7 @@ msgstr ""
|
|||
|
||||
#: includes/fields/class-acf-field-relationship.php:589
|
||||
#: includes/fields/class-acf-field-taxonomy.php:28
|
||||
#: includes/fields/class-acf-field-taxonomy.php:751
|
||||
#: includes/fields/class-acf-field-taxonomy.php:741
|
||||
#: includes/locations/class-acf-location-taxonomy.php:20
|
||||
msgid "Taxonomy"
|
||||
msgstr ""
|
||||
|
|
@ -2163,7 +2172,7 @@ msgstr[0] ""
|
|||
msgstr[1] ""
|
||||
|
||||
#: includes/fields/class-acf-field-select.php:25
|
||||
#: includes/fields/class-acf-field-taxonomy.php:773
|
||||
#: includes/fields/class-acf-field-taxonomy.php:763
|
||||
msgctxt "noun"
|
||||
msgid "Select"
|
||||
msgstr ""
|
||||
|
|
@ -2268,88 +2277,88 @@ msgid ""
|
|||
"group of tabs."
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:711
|
||||
#: includes/fields/class-acf-field-taxonomy.php:701
|
||||
#, php-format
|
||||
msgctxt "No terms"
|
||||
msgid "No %s"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:752
|
||||
#: includes/fields/class-acf-field-taxonomy.php:742
|
||||
msgid "Select the taxonomy to be displayed"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:761
|
||||
#: includes/fields/class-acf-field-taxonomy.php:751
|
||||
msgid "Appearance"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:762
|
||||
#: includes/fields/class-acf-field-taxonomy.php:752
|
||||
msgid "Select the appearance of this field"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:767
|
||||
#: includes/fields/class-acf-field-taxonomy.php:757
|
||||
msgid "Multiple Values"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:769
|
||||
#: includes/fields/class-acf-field-taxonomy.php:759
|
||||
msgid "Multi Select"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:771
|
||||
#: includes/fields/class-acf-field-taxonomy.php:761
|
||||
msgid "Single Value"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:772
|
||||
#: includes/fields/class-acf-field-taxonomy.php:762
|
||||
msgid "Radio Buttons"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:796
|
||||
#: includes/fields/class-acf-field-taxonomy.php:786
|
||||
msgid "Create Terms"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:797
|
||||
#: includes/fields/class-acf-field-taxonomy.php:787
|
||||
msgid "Allow new terms to be created whilst editing"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:806
|
||||
#: includes/fields/class-acf-field-taxonomy.php:796
|
||||
msgid "Save Terms"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:807
|
||||
#: includes/fields/class-acf-field-taxonomy.php:797
|
||||
msgid "Connect selected terms to the post"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:816
|
||||
#: includes/fields/class-acf-field-taxonomy.php:806
|
||||
msgid "Load Terms"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:817
|
||||
#: includes/fields/class-acf-field-taxonomy.php:807
|
||||
msgid "Load value from posts terms"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:831
|
||||
#: includes/fields/class-acf-field-taxonomy.php:821
|
||||
msgid "Term Object"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:832
|
||||
#: includes/fields/class-acf-field-taxonomy.php:822
|
||||
msgid "Term ID"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:882
|
||||
#: includes/fields/class-acf-field-taxonomy.php:872
|
||||
#, php-format
|
||||
msgid "User unable to add new %s"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:892
|
||||
#: includes/fields/class-acf-field-taxonomy.php:882
|
||||
#, php-format
|
||||
msgid "%s already exists"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:924
|
||||
#: includes/fields/class-acf-field-taxonomy.php:914
|
||||
#, php-format
|
||||
msgid "%s added"
|
||||
msgstr ""
|
||||
|
||||
#: includes/fields/class-acf-field-taxonomy.php:970
|
||||
#: includes/fields/class-acf-field-taxonomy.php:960
|
||||
#: includes/locations/class-acf-location-user-form.php:66
|
||||
msgid "Add"
|
||||
msgstr ""
|
||||
|
|
@ -2763,68 +2772,68 @@ msgid ""
|
|||
"a>."
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/html-settings-updates.php:28
|
||||
#: pro/admin/views/html-settings-updates.php:26
|
||||
msgid "License Key"
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/html-settings-updates.php:60
|
||||
#: pro/admin/views/html-settings-updates.php:58
|
||||
msgid "Update Information"
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/html-settings-updates.php:67
|
||||
#: pro/admin/views/html-settings-updates.php:65
|
||||
msgid "Current Version"
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/html-settings-updates.php:75
|
||||
#: pro/admin/views/html-settings-updates.php:73
|
||||
msgid "Latest Version"
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/html-settings-updates.php:83
|
||||
#: pro/admin/views/html-settings-updates.php:81
|
||||
msgid "Update Available"
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/html-settings-updates.php:91
|
||||
#: pro/admin/views/html-settings-updates.php:89
|
||||
msgid "Update Plugin"
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/html-settings-updates.php:93
|
||||
#: pro/admin/views/html-settings-updates.php:91
|
||||
msgid "Please enter your license key above to unlock updates"
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/html-settings-updates.php:99
|
||||
#: pro/admin/views/html-settings-updates.php:97
|
||||
msgid "Check Again"
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/html-settings-updates.php:106
|
||||
#: pro/admin/views/html-settings-updates.php:104
|
||||
msgid "Changelog"
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/html-settings-updates.php:116
|
||||
#: pro/admin/views/html-settings-updates.php:114
|
||||
msgid "Upgrade Notice"
|
||||
msgstr ""
|
||||
|
||||
#: pro/blocks.php:36
|
||||
#: pro/blocks.php:37
|
||||
msgid "Block type name is required."
|
||||
msgstr ""
|
||||
|
||||
#: pro/blocks.php:43
|
||||
#: pro/blocks.php:44
|
||||
#, php-format
|
||||
msgid "Block type \"%s\" is already registered."
|
||||
msgstr ""
|
||||
|
||||
#: pro/blocks.php:418
|
||||
#: pro/blocks.php:444
|
||||
msgid "Switch to Edit"
|
||||
msgstr ""
|
||||
|
||||
#: pro/blocks.php:419
|
||||
#: pro/blocks.php:445
|
||||
msgid "Switch to Preview"
|
||||
msgstr ""
|
||||
|
||||
#: pro/blocks.php:420
|
||||
#: pro/blocks.php:446
|
||||
msgid "Change content alignment"
|
||||
msgstr ""
|
||||
|
||||
#: pro/blocks.php:423
|
||||
#: pro/blocks.php:449
|
||||
#, php-format
|
||||
msgid "%s settings"
|
||||
msgstr ""
|
||||
|
|
@ -2834,53 +2843,53 @@ msgctxt "noun"
|
|||
msgid "Clone"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:812
|
||||
#: pro/fields/class-acf-field-clone.php:809
|
||||
msgid "Select one or more fields you wish to clone"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:829
|
||||
#: pro/fields/class-acf-field-clone.php:826
|
||||
msgid "Display"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:830
|
||||
#: pro/fields/class-acf-field-clone.php:827
|
||||
msgid "Specify the style used to render the clone field"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:835
|
||||
#: pro/fields/class-acf-field-clone.php:832
|
||||
msgid "Group (displays selected fields in a group within this field)"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:836
|
||||
#: pro/fields/class-acf-field-clone.php:833
|
||||
msgid "Seamless (replaces this field with selected fields)"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:857
|
||||
#: pro/fields/class-acf-field-clone.php:854
|
||||
#, php-format
|
||||
msgid "Labels will be displayed as %s"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:860
|
||||
#: pro/fields/class-acf-field-clone.php:857
|
||||
msgid "Prefix Field Labels"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:871
|
||||
#: pro/fields/class-acf-field-clone.php:868
|
||||
#, php-format
|
||||
msgid "Values will be saved as %s"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:874
|
||||
#: pro/fields/class-acf-field-clone.php:871
|
||||
msgid "Prefix Field Names"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:992
|
||||
#: pro/fields/class-acf-field-clone.php:989
|
||||
msgid "Unknown field"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:1031
|
||||
#: pro/fields/class-acf-field-clone.php:1028
|
||||
msgid "Unknown field group"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/class-acf-field-clone.php:1035
|
||||
#: pro/fields/class-acf-field-clone.php:1032
|
||||
#, php-format
|
||||
msgid "All fields from %s field group"
|
||||
msgstr ""
|
||||
|
|
@ -3117,14 +3126,6 @@ msgid ""
|
|||
"\">details & pricing</a>."
|
||||
msgstr ""
|
||||
|
||||
#: tests/basic/test-blocks.php:279
|
||||
msgid "Hero"
|
||||
msgstr ""
|
||||
|
||||
#: tests/basic/test-blocks.php:280
|
||||
msgid "Display a random hero image."
|
||||
msgstr ""
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "https://www.advancedcustomfields.com"
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -5,6 +5,7 @@ defined( 'ABSPATH' ) || exit;
|
|||
|
||||
// Register store.
|
||||
acf_register_store( 'block-types' );
|
||||
acf_register_store( 'block-cache' );
|
||||
|
||||
/**
|
||||
* acf_register_block_type
|
||||
|
|
@ -52,7 +53,7 @@ function acf_register_block_type( $block ) {
|
|||
if( function_exists('register_block_type') ) {
|
||||
register_block_type($block['name'], array(
|
||||
'attributes' => acf_get_block_type_default_attributes( $block ),
|
||||
'render_callback' => 'acf_rendered_block',
|
||||
'render_callback' => 'acf_render_block_callback',
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -283,24 +284,47 @@ function acf_prepare_block( $block ) {
|
|||
}
|
||||
|
||||
/**
|
||||
* acf_rendered_block
|
||||
* The render callback for all ACF blocks.
|
||||
*
|
||||
* Returns the HTML from acf_render_block().
|
||||
* @date 28/10/20
|
||||
* @since 5.9.2
|
||||
*
|
||||
* @param array $attributes The block attributes.
|
||||
* @param string $content The block content.
|
||||
* @param WP_Block $wp_block The block instance (since WP 5.5).
|
||||
* @return string The block HTML.
|
||||
*/
|
||||
function acf_render_block_callback( $attributes, $content = '', $wp_block = null ) {
|
||||
$is_preview = false;
|
||||
$post_id = get_the_ID();
|
||||
|
||||
// Set preview flag to true when rendering for the block editor.
|
||||
if( is_admin() && acf_is_block_editor() ) {
|
||||
$is_preview = true;
|
||||
}
|
||||
|
||||
// Return rendered block HTML.
|
||||
return acf_rendered_block( $attributes, $content, $is_preview, $post_id, $wp_block );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rendered block HTML.
|
||||
*
|
||||
* @date 28/2/19
|
||||
* @since 5.7.13
|
||||
* @see acf_render_block() for list of parameters.
|
||||
*
|
||||
* @return string
|
||||
* @param array $attributes The block attributes.
|
||||
* @param string $content The block content.
|
||||
* @param bool $is_preview Whether or not the block is being rendered for editing preview.
|
||||
* @param int $post_id The current post being edited or viewed.
|
||||
* @param WP_Block $wp_block The block instance (since WP 5.5).
|
||||
* @return string The block HTML.
|
||||
*/
|
||||
function acf_rendered_block( $block, $content = '', $is_preview = false, $post_id = 0 ) {
|
||||
|
||||
// Gutenberg plugin passes different parameters to core.
|
||||
$is_preview = is_bool( $is_preview ) ? $is_preview : false;
|
||||
function acf_rendered_block( $attributes, $content = '', $is_preview = false, $post_id = 0, $wp_block = null ) {
|
||||
|
||||
// Capture block render output.
|
||||
ob_start();
|
||||
acf_render_block( $block, $content, $is_preview, $post_id );
|
||||
acf_render_block( $attributes, $content, $is_preview, $post_id, $wp_block );
|
||||
$html = ob_get_clean();
|
||||
|
||||
// Replace <InnerBlocks /> placeholder on front-end.
|
||||
|
|
@ -309,27 +333,29 @@ function acf_rendered_block( $block, $content = '', $is_preview = false, $post_i
|
|||
$content = str_replace( '$', '\$', $content );
|
||||
$html = preg_replace( '/<InnerBlocks([\S\s]*?)\/>/', $content, $html );
|
||||
}
|
||||
|
||||
// Store in cache for preloading.
|
||||
acf_get_store( 'block-cache' )->set( $attributes['id'], $html );
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* acf_render_block
|
||||
*
|
||||
* Renders the block HTML.
|
||||
*
|
||||
* @date 19/2/19
|
||||
* @since 5.7.12
|
||||
*
|
||||
* @param array $block The block props.
|
||||
* @param string $content The block content (emtpy string).
|
||||
* @param bool $is_preview True during AJAX preview.
|
||||
* @param int $post_id The post being edited.
|
||||
* @param array $attributes The block attributes.
|
||||
* @param string $content The block content.
|
||||
* @param bool $is_preview Whether or not the block is being rendered for editing preview.
|
||||
* @param int $post_id The current post being edited or viewed.
|
||||
* @param WP_Block $wp_block The block instance (since WP 5.5).
|
||||
* @return void
|
||||
*/
|
||||
function acf_render_block( $block, $content = '', $is_preview = false, $post_id = 0 ) {
|
||||
function acf_render_block( $attributes, $content = '', $is_preview = false, $post_id = 0, $wp_block = null ) {
|
||||
|
||||
// Prepare block ensuring all settings and attributes exist.
|
||||
$block = acf_prepare_block( $block );
|
||||
$block = acf_prepare_block( $attributes );
|
||||
if( !$block ) {
|
||||
return '';
|
||||
}
|
||||
|
|
@ -347,7 +373,7 @@ function acf_render_block( $block, $content = '', $is_preview = false, $post_id
|
|||
|
||||
// Call render_callback.
|
||||
if( is_callable( $block['render_callback'] ) ) {
|
||||
call_user_func( $block['render_callback'], $block, $content, $is_preview, $post_id );
|
||||
call_user_func( $block['render_callback'], $block, $content, $is_preview, $post_id, $wp_block );
|
||||
|
||||
// Or include template.
|
||||
} elseif( $block['render_template'] ) {
|
||||
|
|
@ -412,7 +438,7 @@ function acf_get_block_fields( $block ) {
|
|||
* @return void
|
||||
*/
|
||||
function acf_enqueue_block_assets() {
|
||||
|
||||
|
||||
// Localize text.
|
||||
acf_localize_text(array(
|
||||
'Switch to Edit' => __('Switch to Edit', 'acf'),
|
||||
|
|
@ -437,6 +463,7 @@ function acf_enqueue_block_assets() {
|
|||
'cellspacing' => 'cellSpacing',
|
||||
'class' => 'className',
|
||||
'colspan' => 'colSpan',
|
||||
'datetime' => 'dateTime',
|
||||
'for' => 'htmlFor',
|
||||
'hreflang' => 'hrefLang',
|
||||
'readonly' => 'readOnly',
|
||||
|
|
@ -454,6 +481,15 @@ function acf_enqueue_block_assets() {
|
|||
|
||||
// Enqueue block assets.
|
||||
array_map( 'acf_enqueue_block_type_assets', $block_types );
|
||||
|
||||
// During the edit screen loading, WordPress renders all blocks in its own attempt to preload data.
|
||||
// Retrieve any cached block HTML and include this in the localized data.
|
||||
if( defined('ACF_EXPERIMENTAL_PRELOAD_BLOCKS') && ACF_EXPERIMENTAL_PRELOAD_BLOCKS ) {
|
||||
$preloaded_blocks = acf_get_store( 'block-cache' )->get_data();
|
||||
acf_localize_data(array(
|
||||
'preloadedBlocks' => $preloaded_blocks
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -194,30 +194,27 @@ class acf_field_clone extends acf_field {
|
|||
$this->cloning[ $field['key'] ] = 1;
|
||||
|
||||
|
||||
// loop
|
||||
// Loop over selectors and load fields.
|
||||
foreach( $field['clone'] as $selector ) {
|
||||
|
||||
// field group
|
||||
// Field Group selector.
|
||||
if( acf_is_field_group_key($selector) ) {
|
||||
|
||||
// vars
|
||||
$field_group = acf_get_field_group($selector);
|
||||
$field_group_fields = acf_get_fields($field_group);
|
||||
$field_group = acf_get_field_group( $selector );
|
||||
if( !$field_group ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$field_group_fields = acf_get_fields( $field_group );
|
||||
if( !$field_group_fields ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// bail early if no fields
|
||||
if( !$field_group_fields ) continue;
|
||||
$fields = array_merge( $fields, $field_group_fields );
|
||||
|
||||
|
||||
// append
|
||||
$fields = array_merge($fields, $field_group_fields);
|
||||
|
||||
// field
|
||||
// Field selector.
|
||||
} elseif( acf_is_field_key($selector) ) {
|
||||
|
||||
// append
|
||||
$fields[] = acf_get_field($selector);
|
||||
|
||||
$fields[] = acf_get_field( $selector );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
19
readme.txt
19
readme.txt
|
|
@ -67,6 +67,25 @@ From your WordPress dashboard
|
|||
|
||||
== Changelog ==
|
||||
|
||||
= 5.9.3 =
|
||||
*Release Date - 3 November 2020*
|
||||
|
||||
* Fix - Fixed bug causing Revision meta to incorrectly update the parent Post meta.
|
||||
* Fix - Fixed bug breaking "Filter by Post Type" and "Filter by Taxonomy" Field settings.
|
||||
|
||||
= 5.9.2 =
|
||||
*Release Date - 29 October 2020*
|
||||
|
||||
* Enhancement - Added experiment for preloading block HTML and reducing AJAX requests on page load.
|
||||
* Fix - Added boolean attribute value detection to JSX parser (fixes issue with templateLock="false").
|
||||
* Fix - Added "dateTime" attribute to JSX parser ruleset.
|
||||
* Fix - Fixed unresponsive Select2 instances after duplicating a row or layout.
|
||||
* Fix - Added missing Color Picker script translations for previous WordPress versions.
|
||||
* Fix - Fixed bug in Clone Field causing potential PHP error if cloning a Field Group that no longer exists.
|
||||
* Fix - Fixed PHP warning logged when comparing a revision that contains values for a Field that no longer exist.
|
||||
* Dev - Added `$wp_block` parameter to block render_callback and render_template (unavailable during AJAX preview requests).
|
||||
* Dev - Deprecated `acf_get_term_post_id()` function.
|
||||
|
||||
= 5.9.1 =
|
||||
*Release Date - 8 September 2020*
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue