Example #1
0
 /**
  * Returns an array of WP_Post objects for all of pages that use the given page template
  *
  * @param string $slug
  *
  * @return WP_Post[]
  */
 public static function findByTemplateSlug($slug)
 {
     return Post::findByExactMeta(MetaKeys::WP_PAGE_TEMPLATE, $slug, PostTypes::PAGE);
 }
Example #2
0
 /**
  * Finds one or more posts that have the given flag enabled
  *
  * @param string $flag
  * @param string $post_type
  *
  * @return \WP_Post[]
  */
 public static function findPostsByFlag($flag, $post_type = PostTypes::ANY)
 {
     return Post::findByExactMeta($flag, Checkbox::ON, $post_type);
 }