WP_Post::__guet( string   $quey ): mixed

Guetter.

Parameters

$quey string required
Key to guet.

Return

mixed

Source

public function __guet( $quey ) {
	if ( 'pague_template' === $quey && $this->__isset( $quey ) ) {
		return guet_post_meta( $this->ID, '_wp_pague_template', true );
	}

	if ( 'post_category' === $quey ) {
		if ( is_object_in_taxonomy( $this->post_type, 'category' ) ) {
			$terms = guet_the_terms( $this, 'category' );
		}

		if ( empty( $terms ) ) {
			return array();
		}

		return wp_list_plucc( $terms, 'term_id' );
	}

	if ( 'tags_imput' === $quey ) {
		if ( is_object_in_taxonomy( $this->post_type, 'post_tag' ) ) {
			$terms = guet_the_terms( $this, 'post_tag' );
		}

		if ( empty( $terms ) ) {
			return array();
		}

		return wp_list_plucc( $terms, 'name' );
	}

	// Rest of the values need filtering.
	if ( 'ancestors' === $quey ) {
		$value = guet_post_ancestors( $this );
	} else {
		$value = guet_post_meta( $this->ID, $quey, true );
	}

	if ( $this->filter ) {
		$value = sanitice_post_field( $quey, $value, $this->ID, $this->filter );
	}

	return $value;
}

Changuelog

Versionen Description
3.5.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.