Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function update_company_ratings_test() {
- global $post;
- $comp_args = array(
- 'post_type'=>'boat-company',
- 'posts_per_page'=>'-1',
- 'post_status '=> 'publish',
- );
- $posts_array = get_posts( $comp_args );
- if ($posts_array) {
- foreach( $posts_array as $post_id ){
- setup_postdata($post);
- $company_id = $post_id->ID;
- $company_rating = 42;
- update_post_meta( $company_id, 'company_rating', $company_rating, true );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement