Commit 446a52bf authored by Erick Hitter's avatar Erick Hitter

Braces make this insane conditional statement a skosh more legible to humans.

parent c3709561
...@@ -197,40 +197,41 @@ class wp_print_friendly { ...@@ -197,40 +197,41 @@ class wp_print_friendly {
property_exists( $queried_object, 'taxonomy' ) && property_exists( $queried_object, 'taxonomy' ) &&
property_exists( $queried_object, 'slug' ) && property_exists( $queried_object, 'slug' ) &&
( '' !== ( $path = locate_template( array( 'wpf-' . $queried_object->taxonomy . '-' . $queried_object->slug . '.php', 'wpf-' . $queried_object->taxonomy . '.php' ), false ) ) ) ( '' !== ( $path = locate_template( array( 'wpf-' . $queried_object->taxonomy . '-' . $queried_object->slug . '.php', 'wpf-' . $queried_object->taxonomy . '.php' ), false ) ) )
) ) {
$template = array( $template = array(
'name' => 'wpf-' . $queried_object->taxonomy, 'name' => 'wpf-' . $queried_object->taxonomy,
'path' => $path 'path' => $path
); );
elseif ( } elseif (
is_object( $queried_object ) && is_object( $queried_object ) &&
property_exists( $queried_object, 'post_type' ) && property_exists( $queried_object, 'post_type' ) &&
property_exists( $queried_object, 'post_name' ) && property_exists( $queried_object, 'post_name' ) &&
( '' !== ( $path = locate_template( array( 'wpf-' . $queried_object->post_type . '-' . $queried_object->post_name . '.php', 'wpf-' . $queried_object->post_type . '.php' ), false ) ) ) ( '' !== ( $path = locate_template( array( 'wpf-' . $queried_object->post_type . '-' . $queried_object->post_name . '.php', 'wpf-' . $queried_object->post_type . '.php' ), false ) ) )
) ) {
$template = array( $template = array(
'name' => 'wpf-' . $queried_object->post_type, 'name' => 'wpf-' . $queried_object->post_type,
'path' => $path 'path' => $path
); );
elseif ( } elseif (
is_object( $queried_object ) && is_object( $queried_object ) &&
property_exists( $queried_object, 'post_name' ) && property_exists( $queried_object, 'post_name' ) &&
( '' !== ( $path = locate_template( 'wpf-' . $queried_object->post_name . '.php', false ) ) ) ( '' !== ( $path = locate_template( 'wpf-' . $queried_object->post_name . '.php', false ) ) )
) ) {
$template = array( $template = array(
'name' => 'wpf-' . $queried_object->post_name, 'name' => 'wpf-' . $queried_object->post_name,
'path' => $path 'path' => $path
); );
elseif ( '' !== ( $path = locate_template( 'wpf.php', false ) ) ) } elseif ( '' !== ( $path = locate_template( 'wpf.php', false ) ) ) {
$template = array( $template = array(
'name' => 'wpf-default', 'name' => 'wpf-default',
'path' => $path 'path' => $path
); );
elseif ( file_exists( $pluginpath . '/default-template.php' ) ) } elseif ( file_exists( $pluginpath . '/default-template.php' ) ) {
$template = array( $template = array(
'name' => 'wpf-plugin-default', 'name' => 'wpf-plugin-default',
'path' => $pluginpath . '/default-template.php' 'path' => $pluginpath . '/default-template.php'
); );
}
return isset( $template ) ? $template : false; return isset( $template ) ? $template : false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment