示例#1
0
文件: Page.php 项目: jmversteeg/jvwp
 /**
  * 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);
 }
示例#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);
 }