8a614988 by Jeff Balicki

set_exclude_from_search

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent fb5a1a18
...@@ -42,3 +42,19 @@ function wptp_add_tags_to_attachments() { ...@@ -42,3 +42,19 @@ function wptp_add_tags_to_attachments() {
42 add_action( 'init' , 'wptp_add_tags_to_attachments' ); 42 add_action( 'init' , 'wptp_add_tags_to_attachments' );
43 43
44 44
45
46
47
48 add_action('init','set_exclude_from_search');
49 function set_exclude_from_search()
50 {
51 if ($_GET['var'] =='set_exclude_from_search') {
52 global $post;
53 $args = array( 'posts_per_page' => -1, 'post_status'=> 'publish', 'post_type' => 'page');
54
55 $pages = get_posts( $args );
56 foreach ( $pages as $page ){
57 update_post_meta($page->ID, 'exclude_from_search', 0 );
58 }
59 }
60 }
......