ACF::init()publicACF 5.0.0

Completes the setup process on "init" of earlier.

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

Возвращает

null. Ничего (null).

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

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

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

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

Код ACF::init() ACF 6.0.4

public function init() {

	// Bail early if called directly from functions.php or plugin file.
	if ( ! did_action( 'plugins_loaded' ) ) {
		return;
	}

	// This function may be called directly from template functions. Bail early if already did this.
	if ( acf_did( 'init' ) ) {
		return;
	}

	// Update url setting. Allows other plugins to modify the URL (force SSL).
	acf_update_setting( 'url', plugin_dir_url( __FILE__ ) );

	// Load textdomain file.
	acf_load_textdomain();

	// Include 3rd party compatiblity.
	acf_include( 'includes/third-party.php' );

	// Include wpml support.
	if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
		acf_include( 'includes/wpml.php' );
	}

	// Include fields.
	acf_include( 'includes/fields/class-acf-field-text.php' );
	acf_include( 'includes/fields/class-acf-field-textarea.php' );
	acf_include( 'includes/fields/class-acf-field-number.php' );
	acf_include( 'includes/fields/class-acf-field-range.php' );
	acf_include( 'includes/fields/class-acf-field-email.php' );
	acf_include( 'includes/fields/class-acf-field-url.php' );
	acf_include( 'includes/fields/class-acf-field-password.php' );
	acf_include( 'includes/fields/class-acf-field-image.php' );
	acf_include( 'includes/fields/class-acf-field-file.php' );
	acf_include( 'includes/fields/class-acf-field-wysiwyg.php' );
	acf_include( 'includes/fields/class-acf-field-oembed.php' );
	acf_include( 'includes/fields/class-acf-field-select.php' );
	acf_include( 'includes/fields/class-acf-field-checkbox.php' );
	acf_include( 'includes/fields/class-acf-field-radio.php' );
	acf_include( 'includes/fields/class-acf-field-button-group.php' );
	acf_include( 'includes/fields/class-acf-field-true_false.php' );
	acf_include( 'includes/fields/class-acf-field-link.php' );
	acf_include( 'includes/fields/class-acf-field-post_object.php' );
	acf_include( 'includes/fields/class-acf-field-page_link.php' );
	acf_include( 'includes/fields/class-acf-field-relationship.php' );
	acf_include( 'includes/fields/class-acf-field-taxonomy.php' );
	acf_include( 'includes/fields/class-acf-field-user.php' );
	acf_include( 'includes/fields/class-acf-field-google-map.php' );
	acf_include( 'includes/fields/class-acf-field-date_picker.php' );
	acf_include( 'includes/fields/class-acf-field-date_time_picker.php' );
	acf_include( 'includes/fields/class-acf-field-time_picker.php' );
	acf_include( 'includes/fields/class-acf-field-color_picker.php' );
	acf_include( 'includes/fields/class-acf-field-message.php' );
	acf_include( 'includes/fields/class-acf-field-accordion.php' );
	acf_include( 'includes/fields/class-acf-field-tab.php' );
	acf_include( 'includes/fields/class-acf-field-group.php' );

	/**
	 * Fires after field types have been included.
	 *
	 * @date    28/09/13
	 * @since   5.0.0
	 *
	 * @param   int ACF_FIELD_API_VERSION The field API version.
	 */
	do_action( 'acf/include_field_types', ACF_FIELD_API_VERSION );

	// Include locations.
	acf_include( 'includes/locations/class-acf-location-post-type.php' );
	acf_include( 'includes/locations/class-acf-location-post-template.php' );
	acf_include( 'includes/locations/class-acf-location-post-status.php' );
	acf_include( 'includes/locations/class-acf-location-post-format.php' );
	acf_include( 'includes/locations/class-acf-location-post-category.php' );
	acf_include( 'includes/locations/class-acf-location-post-taxonomy.php' );
	acf_include( 'includes/locations/class-acf-location-post.php' );
	acf_include( 'includes/locations/class-acf-location-page-template.php' );
	acf_include( 'includes/locations/class-acf-location-page-type.php' );
	acf_include( 'includes/locations/class-acf-location-page-parent.php' );
	acf_include( 'includes/locations/class-acf-location-page.php' );
	acf_include( 'includes/locations/class-acf-location-current-user.php' );
	acf_include( 'includes/locations/class-acf-location-current-user-role.php' );
	acf_include( 'includes/locations/class-acf-location-user-form.php' );
	acf_include( 'includes/locations/class-acf-location-user-role.php' );
	acf_include( 'includes/locations/class-acf-location-taxonomy.php' );
	acf_include( 'includes/locations/class-acf-location-attachment.php' );
	acf_include( 'includes/locations/class-acf-location-comment.php' );
	acf_include( 'includes/locations/class-acf-location-widget.php' );
	acf_include( 'includes/locations/class-acf-location-nav-menu.php' );
	acf_include( 'includes/locations/class-acf-location-nav-menu-item.php' );

	/**
	 * Fires after location types have been included.
	 *
	 * @date    28/09/13
	 * @since   5.0.0
	 *
	 * @param   int ACF_FIELD_API_VERSION The field API version.
	 */
	do_action( 'acf/include_location_rules', ACF_FIELD_API_VERSION );

	/**
	 * Fires during initialization. Used to add local fields.
	 *
	 * @date    28/09/13
	 * @since   5.0.0
	 *
	 * @param   int ACF_FIELD_API_VERSION The field API version.
	 */
	do_action( 'acf/include_fields', ACF_FIELD_API_VERSION );

	/**
	 * Fires after ACF is completely "initialized".
	 *
	 * @date    28/09/13
	 * @since   5.0.0
	 *
	 * @param   int ACF_MAJOR_VERSION The major version of ACF.
	 */
	do_action( 'acf/init', ACF_MAJOR_VERSION );
}