We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8661be commit 1e59b84Copy full SHA for 1e59b84
wordpress/themes/coderintros/inc/passwords.php
@@ -1,9 +1,11 @@
1
<?php
2
3
-// don't show password protected posts in feeds
+// by default, don't show password protected posts
4
+// this keeps password-protected posts out of our feed and xmlrpc list
5
+// we'll still need to manually filter for REST requests
6
// https://codex.wordpress.org/Using_Password_Protection
7
add_action( 'pre_get_posts', function ( $query ) {
- if ( is_feed() ) {
8
+ if ( !is_single() && !is_page() && !is_admin() && !REST_REQUEST ) {
9
add_filter( 'posts_where', function ( $where ) {
10
global $wpdb;
11
return $where .= " AND {$wpdb->posts}.post_password = '' ";
0 commit comments