Skip to content

Commit

Permalink
ACF 5.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgrshaw committed Jun 22, 2021
1 parent 5b3f4b8 commit ef029ce
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 647 deletions.
7 changes: 3 additions & 4 deletions acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Plugin Name: Advanced Custom Fields
Plugin URI: https://www.advancedcustomfields.com
Description: Customize WordPress with powerful, professional and intuitive fields.
Version: 5.9.6
Author: Elliot Condon
Version: 5.9.7
Author: Delicious Brains
Author URI: https://www.advancedcustomfields.com
Text Domain: acf
Domain Path: /lang
Expand All @@ -17,7 +17,7 @@
class ACF {

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

/** @var array The plugin settings array. */
var $settings = array();
Expand Down Expand Up @@ -137,7 +137,6 @@ function initialize() {
acf_include('includes/loop.php');
acf_include('includes/media.php');
acf_include('includes/revisions.php');
acf_include('includes/updates.php');
acf_include('includes/upgrades.php');
acf_include('includes/validation.php');

Expand Down
2 changes: 1 addition & 1 deletion includes/admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function admin_menu() {
$cap = acf_get_setting('capability');

// Add menu items.
add_menu_page( __("Custom Fields",'acf'), __("Custom Fields",'acf'), $cap, $slug, false, 'dashicons-welcome-widgets-menus', '80.025' );
add_menu_page( __("Custom Fields",'acf'), __("Custom Fields",'acf'), $cap, $slug, false, 'dashicons-welcome-widgets-menus', 80 );
add_submenu_page( $slug, __('Field Groups','acf'), __('Field Groups','acf'), $cap, $slug );
add_submenu_page( $slug, __('Add New','acf'), __('Add New','acf'), $cap, 'post-new.php?post_type=acf-field-group' );
}
Expand Down
8 changes: 4 additions & 4 deletions includes/api/api-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3436,13 +3436,13 @@ function acf_get_valid_terms( $terms = false, $taxonomy = 'category' ) {
/*
* acf_validate_attachment
*
* This function will validate an attachment based on a field's resrictions and return an array of errors
* This function will validate an attachment based on a field's restrictions and return an array of errors
*
* @type function
* @date 3/07/2015
* @since 5.2.3
*
* @param $attachment (array) attachment data. Cahnges based on context
* @param $attachment (array) attachment data. Changes based on context
* @param $field (array) field settings containing restrictions
* @param $context (string) $file is different when uploading / preparing
* @return $errors (array)
Expand Down Expand Up @@ -3478,7 +3478,7 @@ function acf_validate_attachment( $attachment, $field, $context = 'prepare' ) {
// prepare
} elseif( $context == 'prepare' ) {

$file['type'] = pathinfo($attachment['url'], PATHINFO_EXTENSION);
$file['type'] = pathinfo($attachment['filename'], PATHINFO_EXTENSION);
$file['size'] = acf_maybe_get($attachment, 'filesizeInBytes', 0);
$file['width'] = acf_maybe_get($attachment, 'width', 0);
$file['height'] = acf_maybe_get($attachment, 'height', 0);
Expand All @@ -3487,7 +3487,7 @@ function acf_validate_attachment( $attachment, $field, $context = 'prepare' ) {
} else {

$file = array_merge($file, $attachment);
$file['type'] = pathinfo($attachment['url'], PATHINFO_EXTENSION);
$file['type'] = pathinfo($attachment['filename'], PATHINFO_EXTENSION);

}

Expand Down
4 changes: 3 additions & 1 deletion includes/fields/class-acf-field-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ function render_field_settings( $field ) {
* @return bool|string
*/
public function validate_value( $valid, $value, $field, $input ) {
if ( $value && filter_var( wp_unslash($value), FILTER_VALIDATE_EMAIL ) === false ) {
$flags = defined( 'FILTER_FLAG_EMAIL_UNICODE' ) ? FILTER_FLAG_EMAIL_UNICODE : 0;

if ( $value && filter_var( wp_unslash($value), FILTER_VALIDATE_EMAIL, $flags ) === false ) {
return sprintf( __( "'%s' is not a valid email address", 'acf' ), esc_html( $value ) );
}

Expand Down
3 changes: 2 additions & 1 deletion includes/fields/class-acf-field-wysiwyg.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function render_field( $field ) {
}


// must be logged in tp upload
// must be logged in to upload
if( !current_user_can('upload_files') ) {

$field['media_upload'] = 0;
Expand All @@ -250,6 +250,7 @@ function render_field( $field ) {


// filter
add_filter( 'acf_the_editor_content', 'format_for_editor', 10, 2 );
$field['value'] = apply_filters( 'acf_the_editor_content', $field['value'], $default_editor );


Expand Down
Loading

0 comments on commit ef029ce

Please sign in to comment.