Skip to content

Instantly share code, notes, and snippets.

@ootput
Created June 25, 2010 13:44
Show Gist options
  • Select an option

  • Save ootput/452857 to your computer and use it in GitHub Desktop.

Select an option

Save ootput/452857 to your computer and use it in GitHub Desktop.
*** system/themes/k2/theme.php 2010-06-21 22:15:10.587118909 +0800
--- user/themes/k2/theme.php 2010-06-23 20:00:35.488368879 +0800
***************
*** 46,51 ****
--- 46,70 ----
* template. So the values here, unless checked, will overwrite any existing
* values.
*/
+
+ /**
+ * Filter the parameters being passed to Posts::get()
+ *
+ * @param array $filters The parameters to be passed to Posts::get()
+ *
+ * @return array The updated parameters
+ */
+ public function filter_template_where_filters( $filters )
+ {
+
+ if( isset( $filters['content_type'] ) ) {
+ $types = Utils::single_array( $filters->offsetGet( 'content_type' ) );
+ $types[] = Post::type( 'page' );
+ $filters->offsetSet( 'content_type', $types );
+ }
+ return $filters;
+ }
+
public function add_template_vars()
{
//Theme Options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment