Skip to content

Commit

Permalink
A bit more cleanup of oenology_get_404_content()
Browse files Browse the repository at this point in the history
  • Loading branch information
chipbennett committed Apr 20, 2012
1 parent 87f6935 commit 8bd4ebf
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions functions/custom.php
Expand Up @@ -656,9 +656,17 @@ function oenology_get_404_content() {
// Variable to hold function output // Variable to hold function output
$oenology_404 = ''; $oenology_404 = '';


// Variables to hold contextual output parts
$oenology_404_intro = '';
$oenology_404_posts = '';
$oenology_404_pages = '';
$oenology_404_category = '';
$oenology_404_tag = '';
$oenology_404_results = '';
$oenology_404_noresults = '';

// Intro text // Intro text


$oenology_404_intro = '';
$oenology_404_intro .= '<p>'; $oenology_404_intro .= '<p>';
$oenology_404_intro .= __( 'Oh no, not again.', 'oenology' ); $oenology_404_intro .= __( 'Oh no, not again.', 'oenology' );
$oenology_404_intro .= '</p>'; $oenology_404_intro .= '</p>';
Expand Down Expand Up @@ -702,13 +710,10 @@ function oenology_get_404_content() {


if ( ! isset ( $oenology404suggestions ) || ! is_array( $oenology404suggestions ) || count( $oenology404suggestions ) == 0 ) { if ( ! isset ( $oenology404suggestions ) || ! is_array( $oenology404suggestions ) || count( $oenology404suggestions ) == 0 ) {
$oenology404nopostsorpages = true; $oenology404nopostsorpages = true;
$oenology_404_posts = '';
$oenology_404_pages = '';
} else { } else {
$oenology404nopostsorpages = false; $oenology404nopostsorpages = false;


// Display list of post suggestions // Display list of post suggestions
$oenology_404_posts = '';
$suggestedposts = $oenology404postsuggestions; $suggestedposts = $oenology404postsuggestions;
if ( $suggestedposts > 0 ) { if ( $suggestedposts > 0 ) {


Expand Down Expand Up @@ -739,7 +744,6 @@ function oenology_get_404_content() {
} }


// Display list of page suggestions // Display list of page suggestions
$oenology_404_pages = '';
$suggestedpages = $oenology404pagesuggestions; $suggestedpages = $oenology404pagesuggestions;
if ( $suggestedpages > 0 ) { if ( $suggestedpages > 0 ) {


Expand Down Expand Up @@ -771,7 +775,6 @@ function oenology_get_404_content() {
} }


// See if we've matched a category // See if we've matched a category
$oenology_404_category = '';
$oenology404nocategories = true; $oenology404nocategories = true;
$categories = get_categories( array ( "name__like" => $search ) ); $categories = get_categories( array ( "name__like" => $search ) );
if ( count( $categories ) > 0 ) { if ( count( $categories ) > 0 ) {
Expand All @@ -786,7 +789,6 @@ function oenology_get_404_content() {
$oenology_404_category .= '</ul>'; $oenology_404_category .= '</ul>';
} }
// See if we've matched a tag // See if we've matched a tag
$oenology_404_tag = '';
$oenology404notags = true; $oenology404notags = true;
$tags = get_tags( array ( "name__like" => $search ) ); $tags = get_tags( array ( "name__like" => $search ) );
if ( count( $tags ) > 0 ) { if ( count( $tags ) > 0 ) {
Expand All @@ -802,7 +804,6 @@ function oenology_get_404_content() {
} }


// Define "no results" output // Define "no results" output
$oenology_404_noresults = '';
$oenology_404_noresults .= '<p>'; $oenology_404_noresults .= '<p>';
$oenology_404_noresults .= __( 'I apologize.', 'oenology' ) . ' '; $oenology_404_noresults .= __( 'I apologize.', 'oenology' ) . ' ';
$oenology_404_noresults .= __( 'For the life of me, I am unable to figure out what you were trying to find.', 'oenology' ) . ' '; $oenology_404_noresults .= __( 'For the life of me, I am unable to figure out what you were trying to find.', 'oenology' ) . ' ';
Expand Down

0 comments on commit 8bd4ebf

Please sign in to comment.