acf_revisions::__construct │ public │ ACF 1.0

Constructs the acf_revisions class.

Method of the class: acf_revisions{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

acf_revisions::__construct() code ACF 6.8.8

public function __construct() {
	add_action( 'wp_restore_post_revision', array( $this, 'wp_restore_post_revision' ), 10, 2 );
	add_filter( '_wp_post_revision_fields', array( $this, 'wp_preview_post_fields' ), 10, 2 );
	add_filter( '_wp_post_revision_fields', array( $this, 'wp_post_revision_fields' ), 10, 2 );
	add_filter( 'acf/validate_post_id', array( $this, 'acf_validate_post_id' ), 10, 2 );

	// WP 6.4+ handles things differently.
	if ( version_compare( get_bloginfo( 'version' ), '6.4', '>=' ) ) {
		add_action( '_wp_put_post_revision', array( $this, 'maybe_save_revision' ), 10, 2 );
		add_filter( 'wp_save_post_revision_post_has_changed', array( $this, 'check_acf_fields_have_changed' ), 9, 3 );
		add_filter( 'wp_post_revision_meta_keys', array( $this, 'wp_post_revision_meta_keys' ) );

		$this->register_meta();
	} else {
		add_filter( 'wp_save_post_revision_check_for_changes', array( $this, 'wp_save_post_revision_check_for_changes' ), 10, 3 );
	}
}