• Resolved Cliff

    (@drrichbunk)


    As far as I can tell, there’s no built in way to filter out password protected posts. Is there a way to add this through functions.php, or a plan to add this functionality to the free or paid version of the plugin in the future?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brecht

    (@brechtvds)

    You’re right, we don’t have an option for that at the moment. I can look into it for the next update.

    As a temporary solution, try adding the following code to the functions.php file:

    function wpupg_query_post_args( $args ) {
    	$args['has_password'] = false;
    	return $args;
    }
    add_filter( 'wpupg_query_post_args', 'wpupg_query_post_args' );
    Thread Starter Cliff

    (@drrichbunk)

    Thanks Brecht! I’ll try that out later this week and let you know if it works.

    Thread Starter Cliff

    (@drrichbunk)

    Just an update on this. I suspect that the code probably works in general. It didn’t work for me, but that was my fault.

    I’m using the plugin to display a grid of WP Recipe Maker recipes, and although the grid links to posts for the recipes, the grid itself is made up of content from the recipe post type, which doesn’t have a password protection option, so the new code never really had the opportunity to work.

    My solution was to create a new keyword in the recipe plugin called “hidden” and apply that to the password protected recipes. Then I used the WPUPG filters to remove any recipe that had the hidden keyword. By doing that, everything worked like I needed it to.

    Thanks again for your help!

    Plugin Author Brecht

    (@brechtvds)

    Oh right. It’s indeed not the recipes itself that are password protected in this case. Only when using posts as a data source.

    Happy to hear you found a solution that works for you though!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Filter out password protected posts’ is closed to new replies.