WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

ACF::initialize() public ACF 5.0.0

Sets up the ACF plugin.

{} Это метод класса: ACF{}

Хуков нет.

Возвращает

null.

Использование

$ACF = new ACF();
$ACF->initialize();

Список изменений

С версии 5.0.0 Введена.

Код ACF::initialize() ACF 5.9.1

<?php
function initialize() {
	
	// Define constants.
	$this->define( 'ACF', true );
	$this->define( 'ACF_PATH', plugin_dir_path( __FILE__ ) );
	$this->define( 'ACF_BASENAME', plugin_basename( __FILE__ ) );
	$this->define( 'ACF_VERSION', $this->version );
	$this->define( 'ACF_MAJOR_VERSION', 5 );
	
	// Define settings.
	$this->settings = array(
		'name'						=> __('Advanced Custom Fields', 'acf'),
		'slug'						=> dirname( ACF_BASENAME ),
		'version'					=> ACF_VERSION,
		'basename'					=> ACF_BASENAME,
		'path'						=> ACF_PATH,
		'file'						=> __FILE__,
		'url'						=> plugin_dir_url( __FILE__ ),
		'show_admin'				=> true,
		'show_updates'				=> true,
		'stripslashes'				=> false,
		'local'						=> true,
		'json'						=> true,
		'save_json'					=> '',
		'load_json'					=> array(),
		'default_language'			=> '',
		'current_language'			=> '',
		'capability'				=> 'manage_options',
		'uploader'					=> 'wp',
		'autoload'					=> false,
		'l10n'						=> true,
		'l10n_textdomain'			=> '',
		'google_api_key'			=> '',
		'google_api_client'			=> '',
		'enqueue_google_maps'		=> true,
		'enqueue_select2'			=> true,
		'enqueue_datepicker'		=> true,
		'enqueue_datetimepicker'	=> true,
		'select2_version'			=> 4,
		'row_index_offset'			=> 1,
		'remove_wp_meta_box'		=> true
	);
	
	// Include utility functions.
	include_once( ACF_PATH . 'includes/acf-utility-functions.php');
	
	// Include previous API functions.
	acf_include('includes/api/api-helpers.php');
	acf_include('includes/api/api-template.php');
	acf_include('includes/api/api-term.php');
	
	// Include classes.
	acf_include('includes/class-acf-data.php');
	acf_include('includes/fields/class-acf-field.php');
	acf_include('includes/locations/abstract-acf-legacy-location.php');
	acf_include('includes/locations/abstract-acf-location.php');
	
	// Include functions.
	acf_include('includes/acf-helper-functions.php');
	acf_include('includes/acf-hook-functions.php');
	acf_include('includes/acf-field-functions.php');
	acf_include('includes/acf-field-group-functions.php');
	acf_include('includes/acf-form-functions.php');
	acf_include('includes/acf-meta-functions.php');
	acf_include('includes/acf-post-functions.php');
	acf_include('includes/acf-user-functions.php');
	acf_include('includes/acf-value-functions.php');
	acf_include('includes/acf-input-functions.php');
	acf_include('includes/acf-wp-functions.php');
	
	// Include core.
	acf_include('includes/fields.php');
	acf_include('includes/locations.php');
	acf_include('includes/assets.php');
	acf_include('includes/compatibility.php');
	acf_include('includes/deprecated.php');
	acf_include('includes/l10n.php');
	acf_include('includes/local-fields.php');
	acf_include('includes/local-meta.php');
	acf_include('includes/local-json.php');
	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');
	
	// Include ajax.
	acf_include('includes/ajax/class-acf-ajax.php');
	acf_include('includes/ajax/class-acf-ajax-check-screen.php');
	acf_include('includes/ajax/class-acf-ajax-user-setting.php');
	acf_include('includes/ajax/class-acf-ajax-upgrade.php');
	acf_include('includes/ajax/class-acf-ajax-query.php');
	acf_include('includes/ajax/class-acf-ajax-query-users.php');
	acf_include('includes/ajax/class-acf-ajax-local-json-diff.php');
	
	// Include forms.
	acf_include('includes/forms/form-attachment.php');
	acf_include('includes/forms/form-comment.php');
	acf_include('includes/forms/form-customizer.php');
	acf_include('includes/forms/form-front.php');
	acf_include('includes/forms/form-nav-menu.php');
	acf_include('includes/forms/form-post.php');
	acf_include('includes/forms/form-gutenberg.php');
	acf_include('includes/forms/form-taxonomy.php');
	acf_include('includes/forms/form-user.php');
	acf_include('includes/forms/form-widget.php');
	
	// Include admin.
	if( is_admin() ) {
		acf_include('includes/admin/admin.php');
		acf_include('includes/admin/admin-field-group.php');
		acf_include('includes/admin/admin-field-groups.php');
		acf_include('includes/admin/admin-notices.php');
		acf_include('includes/admin/admin-tools.php');
		acf_include('includes/admin/admin-upgrade.php');
	}
	
	// Include legacy.
	acf_include('includes/legacy/legacy-locations.php');
	
	// Include PRO.
	acf_include('pro/acf-pro.php');
	
	// Include tests.
	if( defined('ACF_DEV') && ACF_DEV ) {
		acf_include('tests/tests.php');
	}
	
	// Add actions.
	add_action( 'init', array($this, 'init'), 5 );
	add_action( 'init', array($this, 'register_post_types'), 5 );
	add_action( 'init', array($this, 'register_post_status'), 5 );
	
	// Add filters.
	add_filter( 'posts_where', array($this, 'posts_where'), 10, 2 );
}