Sha256: c8ff1885808f8d22f1b671181a4365498ed6a1e923f6f91116f3ef572b69b655
Contents?: true
Size: 519 Bytes
Versions: 6
Compression:
Stored size: 519 Bytes
Contents
<?php /* Custom WP Query */ class Post { public static function find($args = null) { wp_reset_postdata(); if(empty($args) ) { $args = array( "post_type" => get_called_class() ); } return new WP_Query($args); } public static function find_by($key, $value) { wp_reset_postdata(); $args = array( $key => $value, "post_type" => get_called_class() ); return new WP_Query($args); } } class Page extends Post {}
Version data entries
6 entries across 6 versions & 1 rubygems