Skip to content

Commit

Permalink
Updates to 6.3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
ACF committed Dec 30, 2024
1 parent 637ca1c commit cf89855
Show file tree
Hide file tree
Showing 219 changed files with 14,543 additions and 49,534 deletions.
91 changes: 87 additions & 4 deletions acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* Plugin Name: Advanced Custom Fields PRO
* Plugin URI: https://www.advancedcustomfields.com
* Description: Customize WordPress with powerful, professional and intuitive fields.
* Version: 6.3.4
* Version: 6.3.11
* Author: WP Engine
* Author URI: https://wpengine.com/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=plugin_directory&utm_content=advanced_custom_fields
* Update URI: https://www.advancedcustomfields.com/pro
* Update URI: false
* Text Domain: acf
* Domain Path: /lang
* Requires PHP: 7.4
Expand All @@ -36,7 +36,7 @@ class ACF {
*
* @var string
*/
public $version = '6.3.4';
public $version = '6.3.11';

/**
* The plugin settings array.
Expand Down Expand Up @@ -130,6 +130,7 @@ public function initialize() {
'enable_shortcode' => true,
'enable_bidirection' => true,
'enable_block_bindings' => true,
'enable_meta_box_cb_edit' => true,
);

// Include utility functions.
Expand Down Expand Up @@ -227,6 +228,9 @@ public function initialize() {
// Include legacy.
acf_include( 'includes/legacy/legacy-locations.php' );

// Include updater.
acf_include( 'includes/Updater/Updater.php' );

// Include PRO.
acf_include( 'pro/acf-pro.php' );

Expand Down Expand Up @@ -391,12 +395,24 @@ public function init() {
*/
do_action( 'acf/include_taxonomies', ACF_MAJOR_VERSION );

// If we're on 6.5 or newer, load block bindings. This will move to an autoloader in 6.3.
// If we're on 6.5 or newer, load block bindings. This will move to an autoloader in 6.4.
if ( version_compare( get_bloginfo( 'version' ), '6.5-beta1', '>=' ) ) {
acf_include( 'includes/Blocks/Bindings.php' );
new ACF\Blocks\Bindings();
}

// If we're ACF free, register the updater.
if ( function_exists( 'acf_is_pro' ) && ! acf_is_pro() ) {
acf_register_plugin_update(
array(
'id' => 'acf',
'slug' => acf_get_setting( 'slug' ),
'basename' => acf_get_setting( 'basename' ),
'version' => acf_get_setting( 'version' ),
)
);
}

/**
* Fires after ACF is completely "initialized".
*
Expand Down Expand Up @@ -783,6 +799,73 @@ public function acf_plugin_activated() {
}
}

if ( ! class_exists( 'ACF_Updates' ) ) {
/**
* The main function responsible for returning the acf_updates singleton.
* Use this function like you would a global variable, except without needing to declare the global.
*
* Example: <?php $acf_updates = acf_updates(); ?>
*
* @since 5.5.12
*
* @return ACF\Updater The singleton instance of Updater.
*/
function acf_updates() {
global $acf_updates;
if ( ! isset( $acf_updates ) ) {
$acf_updates = new ACF\Updater();
}
return $acf_updates;
}

/**
* Alias of acf_updates()->add_plugin().
*
* @since 5.5.10
*
* @param array $plugin Plugin data array.
*/
function acf_register_plugin_update( $plugin ) {
acf_updates()->add_plugin( $plugin );
}

/**
* Register a dummy ACF_Updates class for back compat.
*/
class ACF_Updates {} //phpcs:ignore -- Back compat.
}

/**
* An ACF specific getter to replace `home_url` in our license checks to ensure we can avoid third party filters.
*
* @since 6.0.1
* @since 6.2.8 - Renamed to acf_pro_get_home_url to match pro exclusive function naming.
* @since 6.3.10 - Renamed to acf_get_home_url now updater logic applies to free.
*
* @return string $home_url The output from home_url, sans known third party filters which cause license activation issues.
*/
function acf_get_home_url() {
if ( acf_is_pro() ) {
// Disable WPML and TranslatePress's home url overrides for our license check.
add_filter( 'wpml_get_home_url', 'acf_pro_license_ml_intercept', 99, 2 );
add_filter( 'trp_home_url', 'acf_pro_license_ml_intercept', 99, 2 );

if ( acf_pro_is_legacy_multisite() && acf_is_multisite_sub_site() ) {
$home_url = get_home_url( get_main_site_id() );
} else {
$home_url = home_url();
}

// Re-enable WPML and TranslatePress's home url overrides.
remove_filter( 'wpml_get_home_url', 'acf_pro_license_ml_intercept', 99 );
remove_filter( 'trp_home_url', 'acf_pro_license_ml_intercept', 99 );
} else {
$home_url = home_url();
}

return $home_url;
}

/**
* The main function responsible for returning the one true acf Instance to functions everywhere.
* Use this function like you would a global variable, except without needing to declare the global.
Expand Down
Loading

0 comments on commit cf89855

Please sign in to comment.