wpml
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
1 changed file
with
13 additions
and
3 deletions
| ... | @@ -48,13 +48,23 @@ add_action( 'init' , 'wptp_add_tags_to_attachments' ); | ... | @@ -48,13 +48,23 @@ add_action( 'init' , 'wptp_add_tags_to_attachments' ); |
| 48 | add_action('init','set_exclude_from_search'); | 48 | add_action('init','set_exclude_from_search'); |
| 49 | function set_exclude_from_search() | 49 | function set_exclude_from_search() |
| 50 | { | 50 | { |
| 51 | if ($_GET['var'] =='set_exclude_from_search') { | 51 | if ($_GET['var'] =='set_wpml_from_search') { |
| 52 | global $post; | 52 | global $post; |
| 53 | $args = array( 'posts_per_page' => -1, 'post_status'=> 'publish', 'post_type' => 'page'); | 53 | $args = array( 'posts_per_page' => -1, 'post_type' => 'documents'); |
| 54 | 54 | ||
| 55 | $pages = get_posts( $args ); | 55 | $pages = get_posts( $args ); |
| 56 | error_log(print_r($pages,true)); | ||
| 56 | foreach ( $pages as $page ){ | 57 | foreach ( $pages as $page ){ |
| 57 | update_post_meta($page->ID, 'exclude_from_search', 0 ); | 58 | error_log($page->ID); |
| 59 | update_post_meta($page->ID, 'wpml', "EN" ); | ||
| 60 | } | ||
| 61 | $args = array( 'posts_per_page' => -1, 'post_type' => 'attachment'); | ||
| 62 | |||
| 63 | $pages = get_posts( $args ); | ||
| 64 | error_log(print_r($pages,true)); | ||
| 65 | foreach ( $pages as $page ){ | ||
| 66 | error_log($page->ID); | ||
| 67 | update_post_meta($page->ID, 'wpml', "EN" ); | ||
| 58 | } | 68 | } |
| 59 | } | 69 | } |
| 60 | } | 70 | } | ... | ... |
-
Please register or sign in to post a comment