plugin updates

This commit is contained in:
Tony Volpe
2024-10-29 13:49:07 -04:00
parent 66268c4512
commit 9000316050
41 changed files with 916 additions and 570 deletions

View File

@@ -9,7 +9,7 @@
* Plugin Name: Advanced Custom Fields PRO
* Plugin URI: https://www.advancedcustomfields.com
* Description: Customize WordPress with powerful, professional and intuitive fields.
* Version: 6.3.9
* Version: 6.3.10
* 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: false
@@ -36,7 +36,7 @@ if ( ! class_exists( 'ACF' ) ) {
*
* @var string
*/
public $version = '6.3.9';
public $version = '6.3.10';
/**
* The plugin settings array.
@@ -130,6 +130,7 @@ if ( ! class_exists( 'ACF' ) ) {
'enable_shortcode' => true,
'enable_bidirection' => true,
'enable_block_bindings' => true,
'enable_meta_box_cb_edit' => true,
);
// Include utility functions.
@@ -227,15 +228,13 @@ if ( ! class_exists( 'ACF' ) ) {
// 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' );
if ( is_admin() && function_exists( 'acf_is_pro' ) && ! acf_is_pro() ) {
// Include WPE update system.
acf_include( 'includes/class-PluginUpdater.php' );
acf_include( 'includes/acf-upgrades.php' );
acf_include( 'includes/admin/admin-options-pages-preview.php' );
}
@@ -396,12 +395,24 @@ if ( ! class_exists( 'ACF' ) ) {
*/
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".
*
@@ -788,6 +799,66 @@ if ( ! class_exists( 'ACF' ) ) {
}
}
/**
* 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 );
}
/**
* 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() {
// 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_is_pro() ) {
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();
}
} 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 );
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.