Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

wordpress get_posts custom posts by meta key

/* Query args. */
$args = array(
    'post_type' => 'reviews',
    'posts_per_page' => -1,
    'meta_key' => 'location', 
    'meta_value' => 'berkshire'
);

/* Get Reviews */
$reviews = get_posts( $args );
Source by wordpress.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #wordpress #custom #posts #meta #key
ADD COMMENT
Topic
Name
2+1 =