Support » Plugin: Single Post Search Result » Error after upgrade

  • Hi,

    after plugin update all my sites with this plugin installed are throwing the following error:
    PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘skeleton_single_post_search_result’ not found or invalid function name in /home/bettonipens/public_html/wp-includes/plugin.php on line 524

    Nenad

    • This topic was modified 4 years, 3 months ago by nmotika.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    That same problem

    I fixed it on my site this way

    /**
    * This function will redirect any search results that only have a single post
    * to the single post page that was returned in the search.
    *
    * @since 1.0.0
    */
    function wp_single_post_search_result() {

    if ( is_search() ) {

    global $wp_query;

    if ( $wp_query->post_count == 1 ) {
    wp_redirect( get_permalink( $wp_query->posts[‘0’]->ID ) );
    }

    }

    }

    /**
    * This fires the template_redirect action for the wpskeleton_single_post_search_result() function.
    *
    * @since 1.0.0
    */
    add_action( ‘template_redirect’, ‘wp_single_post_search_result’ );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error after upgrade’ is closed to new replies.