ACF_Ajax_Check_Screen::get_post_format_arg │ protected │ ACF 6.8.11

Returns a submitted post format if the post type supports it, or null.

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

Хуков нет.

Возвращает

string|null.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_post_format_arg( $post, $post_format );
$post(WP_Post) (обязательный)
The post being edited.
$post_format(разное) (обязательный)
The submitted post format.

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

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

Код ACF_Ajax_Check_Screen::get_post_format_arg() ACF 6.8.11

protected function get_post_format_arg( $post, $post_format ) {
	if ( is_string( $post_format ) && post_type_supports( $post->post_type, 'post-formats' ) && in_array( $post_format, get_post_format_slugs(), true ) ) {
		return $post_format;
	}

	return null;
}