acf_field_post_object::get_post_title()publicACF 5.0.0

get_post_title

This function returns the HTML for a result

@type    function

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

Возвращает

(Строку).

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

$acf_field_post_object = new acf_field_post_object();
$acf_field_post_object->get_post_title( $post, $field, $post_id, $is_search );
$post (обязательный)
-
$field (обязательный)
-
$post_id **
-
$is_search **
-

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

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

Код acf_field_post_object::get_post_title() ACF 5.10.2

function get_post_title( $post, $field, $post_id = 0, $is_search = 0 ) {

	// get post_id
	if ( ! $post_id ) {
		$post_id = acf_get_form_data( 'post_id' );
	}

	// vars
	$title = acf_get_post_title( $post, $is_search );

	// filters
	$title = apply_filters( 'acf/fields/post_object/result', $title, $post, $field, $post_id );
	$title = apply_filters( 'acf/fields/post_object/result/name=' . $field['_name'], $title, $post, $field, $post_id );
	$title = apply_filters( 'acf/fields/post_object/result/key=' . $field['key'], $title, $post, $field, $post_id );

	// return
	return $title;
}