public static function query($args = null)
    {
        $args = is_array($args) ? $args : [];

        // Set the correct post type
        $args = array_merge($args, ['post_type' => static::getPostType()]);

        if (!isset($args['post_status'])) {
            $args['post_status'] = 'publish';
        }

        return static::posts($args);
    }
public static function query($args = null)
    {
        $args = is_array($args) ? $args : [];

        // Set the correct post type
        $args = array_merge($args, ['post_type' => static::getPostType()]);

        if (!isset($args['post_status'])) {
            $args['post_status'] = 'publish';
        }

        return static::posts($args);
    }
public static function query ( $ args = null ) { $ args = is_array ( $ args ) ? $ args : [ ] ; // Set the correct post type $ args = array_merge ( $ args , [ 'post_type' => static :: getPostType ( ) ] ) ; if ( ! isset ( $ args [ 'post_status' ] ) ) { $ args [ 'post_status' ] = 'publish' ; } return static :: posts ( $ args ) ; }
Convenience function that takes a standard set of WP_Query arguments but mixes it with
arguments that mean we're selecting the right post type

@param  array $args standard WP_Query array
@return Illuminate\Support\Collection
Convenience function that takes a standard set of WP_Query arguments but mixes it with arguments that mean we re selecting the right post type