99 * Plugin Name: Advanced Custom Fields
1010 * Plugin URI: https://www.advancedcustomfields.com
1111 * Description: Customize WordPress with powerful, professional and intuitive fields.
12- * Version: 6.3.10
12+ * Version: 6.3.11
1313 * Author: WP Engine
1414 * Author URI: https://wpengine.com/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=plugin_directory&utm_content=advanced_custom_fields
1515 * Update URI: false
@@ -36,7 +36,7 @@ class ACF {
3636 *
3737 * @var string
3838 */
39- public $ version = '6.3.10 ' ;
39+ public $ version = '6.3.11 ' ;
4040
4141 /**
4242 * The plugin settings array.
@@ -799,33 +799,40 @@ public function acf_plugin_activated() {
799799 }
800800 }
801801
802- /**
803- * The main function responsible for returning the acf_updates singleton.
804- * Use this function like you would a global variable, except without needing to declare the global.
805- *
806- * Example: <?php $acf_updates = acf_updates(); ?>
807- *
808- * @since 5.5.12
809- *
810- * @return ACF\Updater The singleton instance of Updater.
811- */
812- function acf_updates () {
813- global $ acf_updates ;
814- if ( ! isset ( $ acf_updates ) ) {
815- $ acf_updates = new ACF \Updater ();
802+ if ( ! class_exists ( 'ACF_Updates ' ) ) {
803+ /**
804+ * The main function responsible for returning the acf_updates singleton.
805+ * Use this function like you would a global variable, except without needing to declare the global.
806+ *
807+ * Example: <?php $acf_updates = acf_updates(); ?>
808+ *
809+ * @since 5.5.12
810+ *
811+ * @return ACF\Updater The singleton instance of Updater.
812+ */
813+ function acf_updates () {
814+ global $ acf_updates ;
815+ if ( ! isset ( $ acf_updates ) ) {
816+ $ acf_updates = new ACF \Updater ();
817+ }
818+ return $ acf_updates ;
816819 }
817- return $ acf_updates ;
818- }
819820
820- /**
821- * Alias of acf_updates()->add_plugin().
822- *
823- * @since 5.5.10
824- *
825- * @param array $plugin Plugin data array.
826- */
827- function acf_register_plugin_update ( $ plugin ) {
828- acf_updates ()->add_plugin ( $ plugin );
821+ /**
822+ * Alias of acf_updates()->add_plugin().
823+ *
824+ * @since 5.5.10
825+ *
826+ * @param array $plugin Plugin data array.
827+ */
828+ function acf_register_plugin_update ( $ plugin ) {
829+ acf_updates ()->add_plugin ( $ plugin );
830+ }
831+
832+ /**
833+ * Register a dummy ACF_Updates class for back compat.
834+ */
835+ class ACF_Updates {} //phpcs:ignore -- Back compat.
829836 }
830837
831838 /**
@@ -838,24 +845,24 @@ function acf_register_plugin_update( $plugin ) {
838845 * @return string $home_url The output from home_url, sans known third party filters which cause license activation issues.
839846 */
840847 function acf_get_home_url () {
841- // Disable WPML and TranslatePress's home url overrides for our license check.
842- add_filter ( 'wpml_get_home_url ' , 'acf_pro_license_ml_intercept ' , 99 , 2 );
843- add_filter ( 'trp_home_url ' , 'acf_pro_license_ml_intercept ' , 99 , 2 );
844-
845848 if ( acf_is_pro () ) {
849+ // Disable WPML and TranslatePress's home url overrides for our license check.
850+ add_filter ( 'wpml_get_home_url ' , 'acf_pro_license_ml_intercept ' , 99 , 2 );
851+ add_filter ( 'trp_home_url ' , 'acf_pro_license_ml_intercept ' , 99 , 2 );
852+
846853 if ( acf_pro_is_legacy_multisite () && acf_is_multisite_sub_site () ) {
847854 $ home_url = get_home_url ( get_main_site_id () );
848855 } else {
849856 $ home_url = home_url ();
850857 }
858+
859+ // Re-enable WPML and TranslatePress's home url overrides.
860+ remove_filter ( 'wpml_get_home_url ' , 'acf_pro_license_ml_intercept ' , 99 );
861+ remove_filter ( 'trp_home_url ' , 'acf_pro_license_ml_intercept ' , 99 );
851862 } else {
852863 $ home_url = home_url ();
853864 }
854865
855- // Re-enable WPML and TranslatePress's home url overrides.
856- remove_filter ( 'wpml_get_home_url ' , 'acf_pro_license_ml_intercept ' , 99 );
857- remove_filter ( 'trp_home_url ' , 'acf_pro_license_ml_intercept ' , 99 );
858-
859866 return $ home_url ;
860867 }
861868
0 commit comments