Cách tùy chỉnh-phân loại-hình ảnh-tùy chọn-trong-bảng quản trị với các ví dụ

Trong bài viết này, tôi sẽ trả lời câu hỏi Cách phân loại tùy chỉnh-phân loại-hình ảnh-tùy chọn-trong-bảng quản trị bằng ví dụ với . Hy vọng bài viết sẽ giúp bạn thao tác nhanh hơn

Cách tùy chỉnh-phân loại-hình ảnh-tùy chọn-trong-bảng quản trị với các ví dụ
you want to upload image so we create a js file and write some code in functions.php.

But first we create custom upload meta field.

In your function.php or where you write a code for register custom taxonomy and write this code:

First we create custom meta term field

add_action['product_categories_add_form_fields', 'add_term_image', 10, 2];
function add_term_image[$taxonomy]{
    ?>
    
Upload and Image
Same as above write your taxonomy name after created_ in add_action Like created_product_categories Now we create meta term field for edit add_action['product_categories_edit_form_fields', 'edit_image_upload', 10, 2]; function edit_image_upload[$term, $taxonomy] { // get current group $txt_upload_image = get_term_meta[$term->term_id, 'term_image', true]; ?>
Upload and Image

Chủ Đề