Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

wordpress query to get posts by post meta

 $args = array(
        'post_type'     => 'event_user',
        'meta_key'      => 'event_code',
        'meta_value'    => $fields[6]['value'],
        'meta_compare'  => '=='
    );

    $query = new WP_Query( $args );

// Other meta_compares
!=, LIKE, ==
 
PREVIOUS NEXT
Tagged: #wordpress #query #posts #post #meta
ADD COMMENT
Topic
Name
9+5 =