wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_post_custom › WordPress Function

Od1.2.0
Przestarzałyn/a
get_post_custom ( $post_id = 0 )
Parametry:
  • (int) $post_id Optional. Post ID. Default is the ID of the global `$post`.
    Wymagane: Nie
    Domyślny:
Powrót:
  • (mixed) An array of values. False for an invalid `$post_id` (non-numeric, zero, or negative value). An empty string if a valid but non-existing post ID is passed.
Zdefiniowane na:
Codex:

Retrieves post meta fields, based on post ID.

The post meta fields are retrieved from the cache where possible, so the function is optimized to be called more than once.


Źródło

function get_post_custom( $post_id = 0 ) {
	$post_id = absint( $post_id );

	if ( ! $post_id ) {
		$post_id = get_the_ID();
	}

	return get_post_meta( $post_id );
}