Skip to content

Commit

Permalink
Merge pull request #5 from visual-framework/revert-4-acf-pro-plugin-u…
Browse files Browse the repository at this point in the history
…pdate-to-5.9.7

Revert "acf pro plugin update to 5.9.7"
  • Loading branch information
kasprzyk-sz authored Jun 29, 2021
2 parents 92f2dcd + c129a65 commit 07e8256
Showing 94 changed files with 2,219 additions and 2,551 deletions.
6 changes: 3 additions & 3 deletions advanced-custom-fields-pro/acf.php
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@
Plugin Name: Advanced Custom Fields PRO
Plugin URI: https://www.advancedcustomfields.com
Description: Customize WordPress with powerful, professional and intuitive fields.
Version: 5.9.7
Author: Delicious Brains
Version: 5.9.1
Author: Elliot Condon
Author URI: https://www.advancedcustomfields.com
Text Domain: acf
Domain Path: /lang
@@ -17,7 +17,7 @@
class ACF {

/** @var string The plugin version number. */
var $version = '5.9.7';
var $version = '5.9.1';

/** @var array The plugin settings array. */
var $settings = array();
2 changes: 1 addition & 1 deletion advanced-custom-fields-pro/assets/css/acf-global.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion advanced-custom-fields-pro/assets/css/acf-input.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -613,25 +613,25 @@
.acf-ui-datepicker .ui-corner-top,
.acf-ui-datepicker .ui-corner-left,
.acf-ui-datepicker .ui-corner-tl {
border-top-left-radius: 3px;
border-top-left-radius: 3;
}
.acf-ui-datepicker .ui-corner-all,
.acf-ui-datepicker .ui-corner-top,
.acf-ui-datepicker .ui-corner-right,
.acf-ui-datepicker .ui-corner-tr {
border-top-right-radius: 3px;
border-top-right-radius: 3;
}
.acf-ui-datepicker .ui-corner-all,
.acf-ui-datepicker .ui-corner-bottom,
.acf-ui-datepicker .ui-corner-left,
.acf-ui-datepicker .ui-corner-bl {
border-bottom-left-radius: 3px;
border-bottom-left-radius: 3;
}
.acf-ui-datepicker .ui-corner-all,
.acf-ui-datepicker .ui-corner-bottom,
.acf-ui-datepicker .ui-corner-right,
.acf-ui-datepicker .ui-corner-br {
border-bottom-right-radius: 3px;
border-bottom-right-radius: 3;
}

/* Overlays */

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified advanced-custom-fields-pro/assets/inc/select2/3/select2.css
100755 → 100644
Empty file.
Empty file modified advanced-custom-fields-pro/assets/inc/select2/3/select2.js
100755 → 100644
Empty file.
Empty file modified advanced-custom-fields-pro/assets/inc/select2/3/select2.min.js
100755 → 100644
Empty file.
Empty file modified advanced-custom-fields-pro/assets/inc/select2/3/select2.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified advanced-custom-fields-pro/assets/inc/select2/3/select2x2.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified advanced-custom-fields-pro/assets/inc/select2/4/select2.css
100755 → 100644
Empty file.
Empty file modified advanced-custom-fields-pro/assets/inc/select2/4/select2.full.js
100755 → 100644
Empty file.
Empty file.
Empty file modified advanced-custom-fields-pro/assets/inc/select2/4/select2.js
100755 → 100644
Empty file.
Empty file modified advanced-custom-fields-pro/assets/inc/select2/4/select2.min.css
100755 → 100644
Empty file.
Empty file modified advanced-custom-fields-pro/assets/inc/select2/4/select2.min.js
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion advanced-custom-fields-pro/assets/js/acf-field-group.js
Original file line number Diff line number Diff line change
@@ -724,7 +724,7 @@
var copy = acf.__('copy');

// increase suffix "1"
if( acf.isNumeric(end) ) {
if( $.isNumeric(end) ) {
var i = (end*1) + 1;
label = label.replace( end, i );
name = name.replace( end, i );

Large diffs are not rendered by default.

32 changes: 8 additions & 24 deletions advanced-custom-fields-pro/assets/js/acf-input.js
Original file line number Diff line number Diff line change
@@ -3434,8 +3434,7 @@
wait: 'load',

events: {
'removeField': 'onRemove',
'duplicateField': 'onDuplicate'
'removeField': 'onRemove'
},

$input: function(){
@@ -3475,13 +3474,6 @@
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');
}
}
});

@@ -5369,7 +5361,7 @@
label: __('Value is equal to'),
fieldTypes: [ 'text', 'textarea', 'number', 'range', 'email', 'url', 'password' ],
match: function( rule, field ){
if( acf.isNumeric(rule.value) ) {
if( $.isNumeric(rule.value) ) {
return isEqualToNumber( rule.value, field.val() );
} else {
return isEqualTo( rule.value, field.val() );
@@ -5565,8 +5557,8 @@

// append
choices.push({
id: line[0].trim(),
text: line[1].trim()
id: $.trim( line[0] ),
text: $.trim( line[1] )
});
});

@@ -6066,7 +6058,7 @@

var getPostID = function() {
var postID = acf.get('post_id');
return acf.isNumeric(postID) ? postID : 0;
return $.isNumeric(postID) ? postID : 0;
}


@@ -7776,12 +7768,9 @@
});
}

// Temporarily remove conflicting attribute.
var attrAjax = $select.attr( 'data-ajax' );
if( attrAjax !== undefined ) {
$select.removeData('ajax');
$select.removeAttr('data-ajax');
}
// remove conflicting atts
$select.removeData('ajax');
$select.removeAttr('data-ajax');

// ajax
if( this.get('ajax') ) {
@@ -7842,11 +7831,6 @@
// 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);
},
8 changes: 4 additions & 4 deletions advanced-custom-fields-pro/assets/js/acf-input.min.js

Large diffs are not rendered by default.

20 changes: 1 addition & 19 deletions advanced-custom-fields-pro/assets/js/acf.js
Original file line number Diff line number Diff line change
@@ -2522,20 +2522,6 @@

}

/**
* Returns true if value is a number or a numeric string.
*
* @date 30/11/20
* @since 5.9.4
* @link https://stackoverflow.com/questions/9716468/pure-javascript-a-function-like-jquerys-isnumeric/9716488#9716488
*
* @param mixed n The variable being evaluated.
* @return bool.
*/
acf.isNumeric = function( n ){
return !isNaN(parseFloat(n)) && isFinite(n);
}

/**
* Triggers a "refresh" action used by various Components to redraw the DOM.
*
@@ -2556,11 +2542,7 @@
});

$(window).on('load', function(){

// Use timeout to ensure action runs after Gutenberg has modified DOM elements during "DOMContentLoaded".
setTimeout(function(){
acf.doAction('load');
});
acf.doAction('load');
});

$(window).on('beforeunload', function(){
2 changes: 1 addition & 1 deletion advanced-custom-fields-pro/assets/js/acf.min.js

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions advanced-custom-fields-pro/includes/acf-field-functions.php
Original file line number Diff line number Diff line change
@@ -1203,24 +1203,6 @@ function acf_untrash_field( $id = 0 ) {
return true;
}

/**
* Filter callback which returns the previous post_status instead of "draft" for the "acf-field" post type.
*
* Prior to WordPress 5.6.0, this filter was not needed as restored posts were always assigned their original status.
*
* @since 5.9.5
*
* @param string $new_status The new status of the post being restored.
* @param int $post_id The ID of the post being restored.
* @param string $previous_status The status of the post at the point where it was trashed.
* @return string.
*/
function _acf_untrash_field_post_status( $new_status, $post_id, $previous_status ) {
return ( get_post_type( $post_id ) === 'acf-field' ) ? $previous_status : $new_status;
}

add_action( 'wp_untrash_post_status', '_acf_untrash_field_post_status', 10, 3 );

/**
* acf_prefix_fields
*
18 changes: 0 additions & 18 deletions advanced-custom-fields-pro/includes/acf-field-group-functions.php
Original file line number Diff line number Diff line change
@@ -763,24 +763,6 @@ function acf_untrash_field_group( $id = 0 ) {
return true;
}

/**
* Filter callback which returns the previous post_status instead of "draft" for the "acf-field-group" post type.
*
* Prior to WordPress 5.6.0, this filter was not needed as restored posts were always assigned their original status.
*
* @since 5.9.5
*
* @param string $new_status The new status of the post being restored.
* @param int $post_id The ID of the post being restored.
* @param string $previous_status The status of the post at the point where it was trashed.
* @return string.
*/
function _acf_untrash_field_group_post_status( $new_status, $post_id, $previous_status ) {
return ( get_post_type( $post_id ) === 'acf-field-group' ) ? $previous_status : $new_status;
}

add_action( 'wp_untrash_post_status', '_acf_untrash_field_group_post_status', 10, 3 );

/**
* acf_is_field_group
*
40 changes: 4 additions & 36 deletions advanced-custom-fields-pro/includes/acf-helper-functions.php
Original file line number Diff line number Diff line change
@@ -124,20 +124,6 @@ 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' );

@@ -363,7 +349,9 @@ function acf_slugify( $str = '', $glue = '-' ) {
}

/**
* Returns a string with correct full stop punctuation.
* acf_punctify
*
* Returns a string with correct full stop puctuation.
*
* @date 12/7/19
* @since 5.8.2
@@ -372,10 +360,7 @@ function acf_slugify( $str = '', $glue = '-' ) {
* @return string
*/
function acf_punctify( $str = '' ) {
if ( substr( trim( strip_tags( $str ) ), -1) !== '.' ) {
return trim( $str ) . '.';
}
return trim( $str );
return trim($str, '.') . '.';
}

/**
@@ -450,21 +435,4 @@ function acf_doing_action( $action ) {
return $wp_filter[ $action ]->current_priority();
}
return false;
}

/**
* Returns the current URL.
*
* @date 23/01/2015
* @since 5.1.5
*
* @param void
* @return string
*/
function acf_get_current_url() {
// Ensure props exist to avoid PHP Notice during CLI commands.
if( isset( $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'] ) ) {
return ( is_ssl() ? 'https' : 'http' ) . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
return '';
}
78 changes: 18 additions & 60 deletions advanced-custom-fields-pro/includes/acf-input-functions.php
Original file line number Diff line number Diff line change
@@ -64,68 +64,26 @@ function acf_esc_attrs( $attrs ) {
return trim( $html );
}

if ( defined('ACF_EXPERIMENTAL_ESC_HTML') && ACF_EXPERIMENTAL_ESC_HTML ) {

/**
* Sanitizes text content and strips out disallowed HTML.
*
* This function emulates `wp_kses_post()` with a context of "acf" for extensibility.
*
* @date 16/4/21
* @since 5.9.6
*
* @param string $string
* @return string
*/
function acf_esc_html( $string = '' ) {
return wp_kses( (string) $string, 'acf' );
}

/**
* Private callback for the "wp_kses_allowed_html" filter used to return allowed HTML for "acf" context.
*
* @date 16/4/21
* @since 5.9.6
*
* @param array $tags An array of allowed tags.
* @param string $context The context name.
* @return array.
*/

function _acf_kses_allowed_html( $tags, $context ) {
global $allowedposttags;

if( $context === 'acf' ) {
return $allowedposttags;
}
return $tags;
}

add_filter( 'wp_kses_allowed_html', '_acf_kses_allowed_html', 0, 2 );

} else {
/**
* acf_esc_html
*
* Encodes <script> tags for safe HTML output.
*
* @date 12/6/19
* @since 5.8.1
*
* @param string $string
* @return string
*/
function acf_esc_html( $string = '' ) {
$string = strval($string);

/**
* acf_esc_html
*
* Encodes <script> tags for safe HTML output.
*
* @date 12/6/19
* @since 5.8.1
*
* @param string $string
* @return string
*/
function acf_esc_html( $string = '' ) {
$string = strval($string);

// Encode "<script" tags to invalidate DOM elements.
if( strpos($string, '<script') !== false ) {
$string = str_replace('<script', htmlspecialchars('<script'), $string);
$string = str_replace('</script', htmlspecialchars('</script'), $string);
}
return $string;
// Encode "<script" tags to invalidate DOM elements.
if( strpos($string, '<script') !== false ) {
$string = str_replace('<script', htmlspecialchars('<script'), $string);
$string = str_replace('</script', htmlspecialchars('</script'), $string);
}
return $string;
}

/**
Loading

0 comments on commit 07e8256

Please sign in to comment.