Skip to content

Commit

Permalink
v0.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
sincspecv committed May 4, 2022
1 parent a4b3202 commit 1e9676d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions classes/Base/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ class Group {
*/
protected $post_types;

/**
* Page Types on which to display group
*
* @var $page_types array
*/
protected $page_types;

/**
* Templates on which to display group
*
Expand Down Expand Up @@ -191,6 +198,16 @@ public function setPostTypes( $post_types = [] ) {
$this->post_types = $post_types;
}

/**
* Set the post types on which to show the group
*
* @param array $post_types
* @since 0.1.0
*/
public function setPageTypes( $page_types = [] ) {
$this->page_types = $page_types;
}

/**
* Set the post types on which to ignore the group
*
Expand Down Expand Up @@ -317,6 +334,18 @@ public function getLocations() {
}
}

if( ! empty( $this->page_types ) ) {
foreach( $this->page_types as $page_type) {
$toAdd =
[
'param' => 'page_type',
'operator' => '==',
'value' => $page_type,
];
array_push($results, $toAdd);
}
}

return [$results];
}

Expand Down

0 comments on commit 1e9676d

Please sign in to comment.