ACF_Local_JSON::__constructpublicACF 5.9.0

Constructor.

Method of the class: ACF_Local_JSON{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ACF_Local_JSON = new ACF_Local_JSON();
$ACF_Local_JSON->__construct();

Changelog

Since 5.9.0 Introduced.

ACF_Local_JSON::__construct() code ACF 6.8.8

public function __construct() {

	// Update settings.
	acf_update_setting( 'save_json', get_stylesheet_directory() . '/acf-json' );
	acf_append_setting( 'load_json', get_stylesheet_directory() . '/acf-json' );

	// Add listeners.
	add_action( 'acf/update_field_group', array( $this, 'update_field_group' ) );
	add_action( 'acf/untrash_field_group', array( $this, 'update_field_group' ) );
	add_action( 'acf/trash_field_group', array( $this, 'delete_field_group' ) );
	add_action( 'acf/delete_field_group', array( $this, 'delete_field_group' ) );
	add_action( 'acf/update_post_type', array( $this, 'update_internal_post_type' ) );
	add_action( 'acf/untrash_post_type', array( $this, 'update_internal_post_type' ) );
	add_action( 'acf/trash_post_type', array( $this, 'delete_internal_post_type' ) );
	add_action( 'acf/delete_post_type', array( $this, 'delete_internal_post_type' ) );
	add_action( 'acf/update_taxonomy', array( $this, 'update_internal_post_type' ) );
	add_action( 'acf/untrash_taxonomy', array( $this, 'update_internal_post_type' ) );
	add_action( 'acf/trash_taxonomy', array( $this, 'delete_internal_post_type' ) );
	add_action( 'acf/delete_taxonomy', array( $this, 'delete_internal_post_type' ) );

	// Include fields.
	add_action( 'acf/include_fields', array( $this, 'include_fields' ) );
	add_action( 'acf/include_post_types', array( $this, 'include_post_types' ) );
	add_action( 'acf/include_taxonomies', array( $this, 'include_taxonomies' ) );

	if ( is_admin() ) {
		add_filter( 'redirect_post_location', array( $this, 'redirect_post_location' ) );
		add_action( 'current_screen', array( $this, 'maybe_show_save_failure_notice' ) );
	}
}