WPCF7_ContactForm::retrieve_property
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() WPCF7 ContactForm::retrieve property CF7 6.1.4
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;
}