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

WP_Customize_Manager::find_changeset_post_id() public WP 4.7.0

Find the changeset post ID for a given changeset UUID.

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

Хуков нет.

Возвращает

Число/null. Returns post ID on success and null on failure.

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

$WP_Customize_Manager = new WP_Customize_Manager();
$WP_Customize_Manager->find_changeset_post_id( $uuid );
$uuid(строка) (обязательный)
Changeset UUID.

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

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

Код WP_Customize_Manager::find_changeset_post_id() WP 5.5.3

<?php
public function find_changeset_post_id( $uuid ) {
	$cache_group       = 'customize_changeset_post';
	$changeset_post_id = wp_cache_get( $uuid, $cache_group );
	if ( $changeset_post_id && 'customize_changeset' === get_post_type( $changeset_post_id ) ) {
		return $changeset_post_id;
	}

	$changeset_post_query = new WP_Query(
		array(
			'post_type'              => 'customize_changeset',
			'post_status'            => get_post_stati(),
			'name'                   => $uuid,
			'posts_per_page'         => 1,
			'no_found_rows'          => true,
			'cache_results'          => true,
			'update_post_meta_cache' => false,
			'update_post_term_cache' => false,
			'lazy_load_term_meta'    => false,
		)
	);
	if ( ! empty( $changeset_post_query->posts ) ) {
		// Note: 'fields'=>'ids' is not being used in order to cache the post object as it will be needed.
		$changeset_post_id = $changeset_post_query->posts[0]->ID;
		wp_cache_set( $uuid, $changeset_post_id, $cache_group );
		return $changeset_post_id;
	}

	return null;
}