Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Latest commit

 

History

History
47 lines (33 loc) · 1.61 KB

File metadata and controls

47 lines (33 loc) · 1.61 KB

Query

Make a query in the database to get some posts back. The posts are in WPS_Post format. This class does not allow to use the traditional the_title(), the_content, etc... In order to get the post you have to do it like in the sample bellow.

Parameters

Name Type Description Status Default
$args { Array } The arguments to pass to the WP_Query constructor required

Example

	$query = new \WPS\Query($myArgs);
while($query->have_posts()) {
    $query->the_post();
    $post = $query->post;
    // do something with your WPS_Post $post
}

Author : Olivier Bossel olivier.bossel@gmail.com https://olivierbossel.com

See : See more : https://codex.wordpress.org/Class_Reference/WP_Query

Extends \WP_Query

Constructor

Construct the WPS_Query with some arguments. The arguments are the same as the WP_Query ones

Parameters

Name Type Description Status Default
$args { Array } The arguments to pass to the WP_Query class required

Example

	$query = new \WPS\Query($myArgs);

Author : Olivier Bossel olivier.bossel@gmail.com https://olivierbossel.com

Public