Plugin Directory

Changeset 968098


Ignore:
Timestamp:
08/19/2014 06:46:38 AM (12 years ago)
Author:
scriptrunner
Message:

hide posts from search results

Location:
private-posts-page/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • private-posts-page/trunk/private-posts-page.php

    r780704 r968098  
    66Plugin Name: Private Posts Page
    77Plugin URI: http://plugins.svn.wordpress.org/private-posts-page
    8 Description: Private Posts Page will force your designated posts page (blog) to behave like  any normal page that is set to private visibility. That is, for non-logged in users the page will return a 404 error and the posts page title will be removed from the menu. Additionally, all posts will set as private as well. The feed will similarly be disabled.
    9 Version: 1.0.0
     8Description: Private Posts Page will force your designated posts page (blog) to behave like any normal page that is set to private visibility. That is, for non-logged in users the page will return a 404 error and the posts page title will be removed from the menu. Additionally, all posts will set as private as well. The feed will similarly be disabled and search will not return private pages in results.
     9Version: 1.1.0
    1010Author: Doug Sparling
    1111Author URI: http://www.dougsparling.org
     
    3434            add_action( 'template_redirect', array( $this, 'make_posts_page_private' ) , 1000 );
    3535            add_filter( 'get_pages', array( $this, 'remove_posts_page_from_menu' ), 1000 );
    36             add_filter( 'wp_page_menu_args', array( $this, 'remove_home_menu_item'), 1000 );
     36            add_filter( 'wp_page_menu_args', array( $this, 'remove_home_menu_item' ), 1000 );
     37            //add_filter( 'widget_posts_args', array( $this, 'remove_posts_from_recent_posts_widget' ), 1000 );
    3738        }
    3839   
     
    4647                }
    4748                // Any type of post - return 404
    48                 if ( is_single() || is_archive() || is_category() || is_tag() || is_date() || is_author() ) {
     49                if ( is_single() || is_archive() || is_category() || is_tag() || is_date() || is_author() || is_search() ) {
    4950                    require TEMPLATEPATH . '/404.php';
    5051                    exit;
     
    8283            return $args;
    8384        }
     85   
     86        //public function remove_posts_from_recent_posts_widget( $args ) {
     87        //  $recent_posts = wp_get_recent_posts();
     88        //  $recent_posts_ids_arr = array();
     89        //  foreach( $recent_posts as $recent ){
     90        //      $recent_posts_ids_arr[] = $recent['ID'];
     91        //  }
     92        //  $args['post__not_in'] = $recent_posts_ids_arr;
     93        //  return $args;
     94        //}
    8495    }
    8596}
  • private-posts-page/trunk/readme.txt

    r780704 r968098  
    44Tags: private access, navigation, menu, exclude pages, hide pages, remove_feed
    55Requires at least: 2.7
    6 Tested up to: 3.6.1
    7 Stable tag: 1.0.0
     6Tested up to: 3.9.2
     7Stable tag: 1.1.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1313== Description ==
    1414
    15  Private Posts Page will force your designated posts page (blog) to behave like  any normal page that is set to private visibility. That is, for non-logged in users the page will return a 404 error and the posts page title will be removed from the menu. Additionally, all posts will set as private as well. The feed will similarly be disabled.
     15Private Posts Page will force your designated posts page (blog) to behave like any normal page that is set to private visibility. That is, for non-logged in users the page will return a 404 error and the posts page title will be removed from the menu. Additionally, all posts will be set as private as well. The feed will similarly be disabled and search will not return private pages in results.
    1616
    1717== Installation ==
     
    2525Private Post Pages was originally written to fill a specific need of mine and I decided to share my work. If there's something you would like added (and it makes sense in the context of what this plugin is trying to achieve), please let me know. That said, I eventually may add an options admin regardless. But your input is important!
    2626
     27**Q. From where will my posts be hidden?**
     28
     29None of your blog posts will be displayed on the front/home page or designated blog page. Posts will not be shown on the archive pages, authors page, category page, tag page and will also be removed from the feed and will not be displayed in search results. However, the posts title will be displayed in the default "Recent Posts" and "Recent Comments" widgets. If you're making your entire blog private, just remove these widgets from your theme.
     30
    2731== Screenshots ==
    2832
     
    3135== Changelog ==
    3236
     37= 1.1.0 =
     38
     39* Hide posts from search results.
     40
    3341= 1.0.0 =
    3442
Note: See TracChangeset for help on using the changeset viewer.