e545bf88 by Jeff Balicki

wpml

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 0bdbeed5
......@@ -48,13 +48,23 @@ add_action( 'init' , 'wptp_add_tags_to_attachments' );
add_action('init','set_exclude_from_search');
function set_exclude_from_search()
{
if ($_GET['var'] =='set_exclude_from_search') {
if ($_GET['var'] =='set_wpml_from_search') {
global $post;
$args = array( 'posts_per_page' => -1, 'post_status'=> 'publish', 'post_type' => 'page');
$args = array( 'posts_per_page' => -1, 'post_type' => 'documents');
$pages = get_posts( $args );
error_log(print_r($pages,true));
foreach ( $pages as $page ){
update_post_meta($page->ID, 'exclude_from_search', 0 );
error_log($page->ID);
update_post_meta($page->ID, 'wpml', "EN" );
}
$args = array( 'posts_per_page' => -1, 'post_type' => 'attachment');
$pages = get_posts( $args );
error_log(print_r($pages,true));
foreach ( $pages as $page ){
error_log($page->ID);
update_post_meta($page->ID, 'wpml', "EN" );
}
}
}
......