WPCF7_ContactForm::retrieve_property()privateCF7 1.0

Retrieves contact form property of the specified name from the database.

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

Хуков нет.

Возвращает

Массив|Строку|null. Property value. Null if property does not exist.

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

// private - только в коде основоного (родительского) класса
$result = $this->retrieve_property( $name );
$name(строка) (обязательный)
Property name.

Код WPCF7_ContactForm::retrieve_property() CF7 5.9.3

private function retrieve_property( $name ) {
	$property = null;

	if ( ! $this->initial() ) {
		$post_id = $this->id;

		if ( metadata_exists( 'post', $post_id, '_' . $name ) ) {
			$property = get_post_meta( $post_id, '_' . $name, true );
		} elseif ( metadata_exists( 'post', $post_id, $name ) ) {
			$property = get_post_meta( $post_id, $name, true );
		}
	}

	return $property;
}