Viewing 1 replies (of 1 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi!

    Yes, there is! The filter “asl_pagepost_results”.

    Here is a sample skeleton code how to use it:

    add_filter( 'asl_pagepost_results', 'asp_my_custom_function', 1, 1 );
    
    function asp_my_custom_function( $results ) {
    
      $new_results = array();
    
      foreach ($results as $k=>$v) {
    
        // Access the fields as following:
        //  $results[$k]->id, the post ID
        //  $results[$k]->title, the post title, etc..
    
        // Put a check here, and append the current result to a new array
        // if true
        if ( $desired_language )
          $new_results[] = $results[$k];
      }
    
      // Return the desired results only
      return $new_results;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Filter to confirm/exclude posts in results’ is closed to new replies.