AnsPress_Reputation_Query::__construct( array $args = array() )

Description #

Initialize the class.

Parameters #

  • $args
    array (Optional) Arguments. Default value: array()

Source #

File: includes/reputation.php

	public function __construct( $args = array() ) {
		$this->events = ap_get_reputation_events();
		$this->get_events_with_zero_points();

		$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' => 0,
				'number'  => $this->per_page,
				'offset'  => $this->offset,
				'order'   => 'DESC',
			)
		);

		$this->per_page = $this->args['number'];
		$this->query();
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment