Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created November 5, 2013 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/7325390 to your computer and use it in GitHub Desktop.
Save jchristopher/7325390 to your computer and use it in GitHub Desktop.
<?php
function mySearchIncludeIds( $ids, $engine, $terms )
{
$ids = get_page_ids_user_can_access(); // returns array of post IDs that the user has access to
return $ids;
}
add_filter( 'searchwp_include', 'my_limit_search_results', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment