Function reference/wp get object terms

  -  
PHPhường wp_get_object_terms - 30 examples found. These are the top rated real world PHPhường examples of wp_get_object_terms extracted from open source projects. You can rate examples to lớn help us improve sầu the unique of examples.


Bạn đang xem: Function reference/wp get object terms

*
report this ad


Xem thêm: Mua Bán Nhà Mặt Tiền Quận Gò Vấp Giá Rẻ Tháng 05/2021, Mua Bán Nhà Mặt Tiền Quận Gò Vấp Giá Rẻ T6/2021

function manage_screen_options_columns($column, $post_id) global $post; $chosen_client_id = get_post_meta($post_id, 'chosen_client', true); switch ($column) case 'invnumber': $invnumber = get_post_meta($post_id, 'invoice_serial_number', true); echo "№ " . str_pad($invnumber, 10, "0", STR_PAD_LEFT); break; case 'company_name': $company_name = get_post_meta($chosen_client_id, 'company_name', true); if (empty($company_name)) eđến __('Unknown'); else eđến __($company_name); break; case 'status': $status = wp_get_object_terms($post_id, 'status'); if (empty($status)) eđến __(' - '); else foreach ($status as $the_status) emang lại $the_status->name . " "; default: break;


Xem thêm: Tài Liệu Hướng Dẫn Cài Đặt Centos 6, Hướng Dẫn Cài Đặt Centos 6

public function prepare_items() if (!empty($this->items)) return; $per_page = $this->get_items_per_page('edit_wpsc-product-variations_per_page'); $per_page = apply_filters('edit_wpsc_product_variations_per_page', $per_page); $this->args = array('post_type' => 'wpsc-product', 'orderby' => 'menu_order title', 'post_parent' => $this->product_id, 'post_status' => 'publish, inherit', 'numberposts' => -1, 'order' => "ASC", 'posts_per_page' => $per_page); if (isset($_REQUEST<'post_status'>)) $this->args<'post_status'> = $_REQUEST<'post_status'>; if (isset($_REQUEST<'s'>)) $this->args<'s'> = $_REQUEST<'s'>; if (isset($_REQUEST<'paged'>)) $this->args<'paged'> = $_REQUEST<'paged'>; $query = new WP_Query($this->args); $this->items = $query->posts; $total_items = $query->found_posts; $total_pages = $query->max_num_pages; $this->set_pagination_args(array('total_items' => $total_items, 'total_pages' => $total_pages, 'per_page' => $per_page)); if (empty($this->items)) return; $ids = wp_list_pluck($this->items, 'ID'); $object_terms = wp_get_object_terms($ids, 'wpsc-variation', array('fields' => 'all_with_object_id')); foreach ($object_terms as $term) if (!array_key_exists($term->object_id, $this->object_terms_cache)) $this->object_terms_cache<$term->object_id> = array(); $this->object_terms_cache<$term->object_id><$term->parent> = $term->name;