I try create code on site where user can give advertise. Program is for user which don’t have account on site but they want add adverts. i want, program first advert must send to moderator which check it, if all will be okay he publish it and if user want add next advert and use the same email, adverts will be add automatical.

My code at the moment:

$posts = get_posts( array(
    'author' => get_current_user_id(),
        'post_type' => 'advert',
        'post_status' => array("publish", "expired"),
        'posts_per_page' => 1
    ) );
$args = array(
    'post_type' => 'advert',
    'meta_query' => array(
        array(
            'key' => 'adverts_email' == $adverts_email,
            'value' => 'yes',
  if( false ) {
        return $out;
    }

        )
    )
 );
$postslist = get_posts( $args );

  if( empty( $posts ) ) {
        return $out;
    }

Please, if someona know how make it. i start programing and i want learn but i try find answer on this 2 day and i found nothing.

Thanks and sorry for waste you time.

Read more here: i have php program for wordpres site with adverts but he doesn’t work


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: