最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - Metabox collapsed by default

programmeradmin3浏览0评论

I need to make a metabox of a WordPress Plugin called "post expirator" collapsed by default.

Right now it is open.

actually when i open a page :

My need :

That is the part of the code adding metaboxe :

 * Adds hooks to get the meta box added to pages and custom post types
 */
function expirationdate_meta_custom() {
    $custom_post_types = get_post_types();
    array_push($custom_post_types,'page');
    foreach ($custom_post_types as $t) {
        $defaults = get_option('expirationdateDefaults'.ucfirst($t));
        if (!isset($defaults['activeMetaBox']) || $defaults['activeMetaBox'] == 'active') {
            add_meta_box('expirationdatediv', __('Post Expirator','post-expirator'), 'expirationdate_meta_box', $t, 'side', 'core');
        }
    }
}
add_action ('add_meta_boxes','expirationdate_meta_custom');

Thanks in advance for the reply.

发布评论

评论列表(0)

  1. 暂无评论