Skip to content

Instantly share code, notes, and snippets.

@jeffsebring
Created June 20, 2012 18:39
Show Gist options
  • Save jeffsebring/2961480 to your computer and use it in GitHub Desktop.
Save jeffsebring/2961480 to your computer and use it in GitHub Desktop.
rUtilities::filters
public static function filters( $filter = null, $value = null )
{ global $Render;
$value = apply_filters( 'render_' . $filter, $value );
if ( ! empty( $Render->template[ 'view' ] ) )
$filters[] = $Render->template[ 'view' ];
if ( ! empty( $Render->template[ 'post_type' ] ) )
$filters[] = $Render->template[ 'post_type' ];
if ( ! empty( $Render->template[ 'page_template' ] ) )
$filters[] = $Render->template[ 'page_template' ];
if ( ! empty( $Render->template[ 'format' ] ) )
$filters[] = $Render->template[ 'format' ];
if ( ! empty( $Render->template[ 'post_id' ] ) )
$filters[] = $Render->template[ 'post_id' ];
if ( ! empty( $filters ) )
foreach ( $filters as $filtered )
$value = apply_filters( 'render_' . $filter . '_' . $filtered, $value );
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment