• Resolved nikolasmaker

    (@nikolasmaker)


    Hello
    The first thing I want to do is to express my gratitude to the developers. The plugin is really the best on the market!

    I had one small problem I made some pages private – person need a password to access.
    But a problem appears when searching – if I just go to the page https: //*******.com/search-videos/
    I see absolutely all videos – even those on pages with password access.
    As far as I understand, search works with requests like this https: //*******.com/search-videos/?Vi=hello
    How to make it so that if the user just went to https: //*******.com/search-videos/ he was redirected to the main page of the site, or in general that the search page would not be available to the user without a search request.

    I would also like to clarify – is it possible to make the search work only in one category.
    For example, if we display a shortcode for the category “leaves”, then what would the search on this page work only in this category?
    If so, how to implement it?

    Thank you

    thanks for the help

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor wpvideogallery

    (@wpvideogallery)

    Thanks for your feedback:)

    Q1. How to make it so that if the user just went to https: //*******.com/search-videos/ he was redirected to the main page of the site, or in general that the search page would not be available to the user without a search request.

    Kindly try adding the following code to the bottom of your theme’s functions.php file.

    function aiovg_custom_restrict_search_page( $output, $tag, $attr ) {
    	if ( 'aiovg_search' == $tag ) {
    		if ( ! isset( $_GET['vi'] ) || empty( $_GET['vi'] ) ) {
    			$output = "<p>Sorry, you don't have sufficient permission to access this page.</p>";
    		}
    	}
    
    	return $output;
    }
    add_filter( 'do_shortcode_tag', 'aiovg_custom_restrict_search_page', 10, 3 );

    Q2. I would also like to clarify – is it possible to make the search work only in one category. For example, if we display a shortcode for the category “leaves”, then what would the search on this page work only in this category?

    Very Sorry, this is not possible through our current version. But, I have taken a note of this now. So, we would have an option for this in the future.

    Our TO-DO lists are quite large. So, this needs some time. Kindly be patient.

    • This reply was modified 3 years, 2 months ago by wpvideogallery.
    • This reply was modified 3 years, 2 months ago by wpvideogallery. Reason: typo
    Thread Starter nikolasmaker

    (@nikolasmaker)

    Many thanks!
    Your solution to the problem works great!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirecting from the search page and search in category’ is closed to new replies.