Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the acf domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u378631216/domains/wphai.com/public_html/wp-includes/functions.php on line 6131

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the easy-watermark domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u378631216/domains/wphai.com/public_html/wp-includes/functions.php on line 6131

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the shortcodes-ultimate domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u378631216/domains/wphai.com/public_html/wp-includes/functions.php on line 6131

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the limit-login-attempts-reloaded domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u378631216/domains/wphai.com/public_html/wp-includes/functions.php on line 6131
wordpress后台编辑文章时不让已选分类显示在最上面的解决办法 - WP大海
大家都知道,我们在后台发布文章后再次编辑时,所选的分类会显示在分类目录列表的顶部,这样不方便我们查看其树状结构(也就是分类层级关系),那么如何能不让所选分类显示在顶部呢,还是像默认那样呈现树状层级关系。可以使用以下代码:

class Category_Checklist {

static function init() {

add_filter( 'wp_terms_checklist_args', array( __CLASS__, 'checklist_args' ) );

}


static function checklist_args( $args ) {

add_action( 'admin_footer', array( __CLASS__, 'script' ) );

$args['checked_ontop'] = false;

return $args;

}


// Scrolls to first checked category

static function script() {

?>

<script type="text/javascript">

jQuery(function(){

jQuery('[id$="-all"] > ul.categorychecklist').each(function() {

var $list = jQuery(this);

var $firstChecked = $list.find(':checkbox:checked').first();


if ( !$firstChecked.length )

return;


var pos_first = $list.find(':checkbox').position().top;

var pos_checked = $firstChecked.position().top;


$list.closest('.tabs-panel').scrollTop(pos_checked - pos_first + 5);

});

});

</script>

<?php

}

}


Category_Checklist::init();
有人会问,那如果分类多了的话,编辑文章时岂不是还得找所选分类?不是的,上面代码会自动定位到所选分类的位置。
常见问题
如何下载?
可以点击右侧边栏或者文章底部的【立即下载】按钮。然后按照【网盘地址】进行下载。
不是最新版本?
可以提交工单。或者发邮件到 uishop@qq.com。
声明:1、本站大部分资源均为网络采集所得,仅供用来学习研究,请于下载后的24h内自行删除,正式商用请购买正版。2、所有汉化类文件和个别标注了“原创”的产品均为本站原创发布,任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。3、如若本站内容侵犯了原著者的合法权益,请携带相关版权文件联系我们进行下架或删除。4、虚拟下载类资源具有可复制性,一经下载后本站有权拒绝退款或更换其他商品!
0

评论0

没有账号?注册  忘记密码?

社交账号快速登录