{"id":6730,"date":"2009-09-28T23:25:16","date_gmt":"2009-09-28T23:25:16","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/private-page-forbidden\/"},"modified":"2009-09-28T23:39:05","modified_gmt":"2009-09-28T23:39:05","slug":"private-page-forbidden","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/private-page-forbidden\/","author":186678,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.2","stable_tag":"trunk","tested":"2.8","requires":"2.7","requires_php":"","requires_plugins":"","header_name":"Private Page Forbidden","header_author":"Weston Ruter","header_description":"","assets_banners_color":"","last_updated":"2009-09-28 23:39:05","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/private-page-forbidden\/","header_author_uri":"http:\/\/weston.ruter.net\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":1454,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[14905,1912],"plugin_category":[],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-6730","plugin","type-plugin","status-publish","hentry","plugin_tags-14905","plugin_tags-access-control","plugin_committers-westonruter"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/private-page-forbidden.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p><em>This plugin is developed at <a href=\"http:\/\/www.shepherd-interactive.com\/\" title=\"Shepherd Interactive specializes in web design and development in Portland, Oregon\">Shepherd Interactive<\/a>\nfor the benefit of the community. No support is available. Please post any questions to the <a href=\"http:\/\/wordpress.org\/tags\/private-page-forbidden?forum_id=10\">support forum<\/a>.<\/em><\/p>\n <p>Instead of serving a 404 Not Found error with the <code>404.php<\/code> template, send a 403 Forbidden error and set <code>$wp_query-&gt;is_403<\/code> and load     403.php if it exists.<\/p>\n <p>Provides a filter <code>forbidden_redirect<\/code> which if results in a non-empty filtered value will result in the user being redirected if attempting to visit a forbidden page; the default value is <code>\"\"<\/code> (no redirect).<\/p>\n <p>Useful with a filter which selectively prevents a private post from being forbidden, so that the page will not show up in the navigation and won't be included in XML Sitemaps, for example.<\/p>\n <pre>function my_filter_private_posts($posts){     if(is_singular() &amp;&amp; $posts[0]-&gt;post_status == 'private'        &amp;&amp; #Now optionally allow\/disallow based on user session:        in_array($_SERVER['REQUEST_URI'], (array)@$_SESSION['allowed_private_uris']))     ){         header('Cache-Control: private'); #Prevent proxies from caching this private page         $posts[0]-&gt;post_status = 'publish';     }     return $posts; } add_filter('posts_results', 'my_filter_private_posts');<\/pre>\n\n<!--section=changelog-->\n<h4>2009-09-28: 0.2<\/h4>\n <ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Instead of serving a 404 Not Found error with the 404.php template, send a 403 Forbidden error and set $wp_query-&gt;is_403 and load 403.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/6730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=6730"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/westonruter"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=6730"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=6730"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=6730"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=6730"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=6730"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=6730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}