2017-11-10 6 views

답변

1

예 다음 두 가지 기능을 사용하면 완전히 가능합니다.

// Add a custom tab to WooCommerce Status section 
add_filter('woocommerce_admin_status_tabs','add_custom_admin_status_tabs', 10, 1); 
function add_custom_admin_status_tabs($tabs){ 
    $tabs['custom_slug'] = __('Custom Title', 'woocommerce'); 
    return $tabs; 
} 

// Add the content of the custom tab to WooCommerce Status section 
// (HERE the hook is maid of 'woocommerce_admin_status_content_' + the slug of this tab) 
add_action('woocommerce_admin_status_content_custom_slug', 'add_custom_admin_status_content_custom_slug'); 
function add_custom_admin_status_content_custom_slug(){ 
    $key_slug = 'custom_slug'; 
    ?> 
    <table class="wc_status_table wc_status_table--<?php echo $key_slug; ?> widefat" cellspacing="0"> 
     <tbody class="<?php echo $key_slug; ?>"> 
      <tr class="section-name-1" > 
       <th valign="top" width="20%"> 
        <p><strong class="name"><?php _e('Section name 1', 'woocommerce'); ?></strong></p> 
       </th> 
       <td valign="top" class="content-section-1"> 
        <p><?php _e('Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.', 'woocommerce'); ?></p> 
       </td> 
      </tr> 
     </tbody> 
    </table> 
    <?php 
} 

코드는 플러그인 파일도 function.php의 활성 자식 테마 (또는 테마)의 파일이나 간다.

테스트를 거쳐 작동합니다. 받게 될 내용은 다음과 같습니다.

enter image description here

+0

감사합니다. – Carl