mercredi 8 novembre 2017

conditional statement in an array

I want to add conditional statement in author. something like if the author is an admin set this to null. is this possible?

    $args     = apply_filters( 'job_manager_get_dashboard_jobs_args', array(
        'post_type'           => 'job_listing',
        'post_status'         => array( 'publish', 'expired', 'pending' ),
        'ignore_sticky_posts' => 1,
        'posts_per_page'      => $posts_per_page,
        'offset'              => ( max( 1, get_query_var('paged') ) - 1 ) * $posts_per_page,
        'orderby'             => 'date',
        'order'               => 'desc',
        'author'              => get_current_user_id()

    ) );

Aucun commentaire:

Enregistrer un commentaire