Sha256: 00c1a76f3ad7cf0b71f191b610f700b3ab305bd2118d68030ea7a06a2d10fe42
Contents?: true
Size: 583 Bytes
Versions: 6
Compression:
Stored size: 583 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() ); } else { $args["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