ACF_Rest_Embed_Links::hook_link_handlersprivateACF 1.0

Hook into all REST-enabled post type, taxonomy, and the user controllers in order to prepare links.

Method of the class: ACF_Rest_Embed_Links{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->hook_link_handlers();

ACF_Rest_Embed_Links::hook_link_handlers() code ACF 6.0.4

private function hook_link_handlers() {
	foreach ( get_post_types( array( 'show_in_rest' => true ) ) as $post_type ) {
		add_filter( "rest_prepare_{$post_type}", array( $this, 'load_item_links' ), 10, 3 );
	}

	foreach ( get_taxonomies( array( 'show_in_rest' => true ) ) as $taxonomy ) {
		add_filter( "rest_prepare_{$taxonomy}", array( $this, 'load_item_links' ), 10, 3 );
	}

	add_filter( 'rest_prepare_user', array( $this, 'load_item_links' ), 10, 3 );
}