AnsPress_Query::__construct( array $args = array() )
Description #
Initialize the class.
Parameters #
- $argsarray (Optional) Arguments. Default value: array()
Source #
File: includes/class-query.php
public function __construct( $args = array() ) {
$this->paged = isset( $args['paged'] ) ? (int) $args['paged'] : 1;
$this->offset = $this->per_page * ( $this->paged - 1 );
$this->args = wp_parse_args(
$args,
array(
'user_id' => get_current_user_id(),
'number' => $this->per_page,
'offset' => $this->offset,
'order' => 'DESC',
)
);
$this->per_page = $this->args['number'];
$this->query();
}
Expand full source code Collapse full source code View on GitHub: includes/class-query.php:137
Add your comment