File "ACF.php"
Full Path: /home/romayxjt/public_html/wp-content/plugins/the-events-calendar/src/Tribe/Integrations/ACF/ACF.php
File size: 1.18 KB
MIME-type: text/x-php
Charset: utf-8
<?php
/**
* Class Tribe__Events__Integrations__ACF__ACF
*
* Handles the integration between The Events Calendar plugin and Advanced Custom Fields.
*
* This class is meant to be an entry point hooking specialized classes and not
* a logic hub per se.
*/
class Tribe__Events__Integrations__ACF__ACF {
/**
* @var Tribe__Events__Integrations__ACF__ACF
*/
protected static $instance;
/**
* @return Tribe__Events__Integrations__ACF__ACF
*/
public static function instance() {
if ( empty( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Hooks the filters and actions needed for this integration to work.
*
* @since 4.6.3
*/
public function hook() {
add_action( 'admin_enqueue_scripts', [ $this, 'load_compat_js' ] );
}
/**
* Load our compatibility JS script to supplement the events-admin.js script.
*
* @since 4.6.3
*/
public function load_compat_js() {
$admin_helpers = Tribe__Admin__Helpers::instance();
if ( $admin_helpers->is_post_type_screen() ) {
wp_enqueue_script(
'tribe-admin-acf-compat',
plugin_dir_url( 'build/tribe-admin-acf-compat.js' ),
[ 'jquery' ],
'1.0.0',
true
);
}
}
}