Request: a filter hook for $oenology_404_noresults? #67

gregory-hk opened this Issue Apr 20, 2012 · 3 comments


None yet
2 participants

hi Chip.

might it be possible to add a filter hook to $oenology_404_noresults in custom.php?

I'd like to add a note to explain that we have just migrated to a new system, and that the link they clicked no longer works, etc.



chipbennett commented Apr 20, 2012

The hook should already be there. The post 404 output is generated by oenology_hook_post_404(), which is defined in functions/hooks.php:

function oenology_hook_post_404() { 
    $post_404 = oenology_get_404_content();
    echo apply_filters( 'oenology_hook_post_404', $post_404 );

See also oenology_hook_loop_no_posts(), defined in functions/hooks.php, for the corollary posts index no-posts filter:

function oenology_hook_loop_no_posts() {    
    $loop_no_posts = '';
    $loop_no_posts .= '<h2 class="center">' . __( 'Not Found', 'oenology' ) . '</h2>';
    $loop_no_posts .= '<p class="center">' . __( 'Sorry, but you are looking for something that isn\'t here.', 'oenology' ) . '</p>';
    echo apply_filters( 'oenology_hook_loop_no_posts', $loop_no_posts );

hi chip.

gotcha. there is however no way to know if $oenology404noresults was true or false although I could search the returned text for signature phrases like 'For the life of me' :-)


chipbennett reopened this Apr 20, 2012


chipbennett commented Apr 20, 2012

Oh, I get it: you want filters for each of the variables used to construct the eventual output. Yeah, I can do that. :)

Would you mind posting the syntax error as a separate issue, so I can track its resolution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment