在WordPress Customizer上禁用WordPress自定义CSS seciton

任何人都可以帮助我锁定/禁用外观->定制程序->其他CSS区域。在Wp-admin上。

屏幕截图

我读过此编解码器https://codex.wordpress.org/Theme_Customization_API, 但是没有禁用它的任何钩子或函数。实际上, 我不需要此功能, 任何开发人员都可以从此处添加不必要的CSS, 并将此保存在数据库中。请提出任何解决方案, 如果可能的话。

预先感谢你的宝贵答复。


#1


你可以尝试使用WP Customizer函数挂钩删除该部分:

function mytheme_customize_register( $wp_customize )
{
   $wp_customize->remove_section('custom_css');
}
add_action( 'customize_register', 'mytheme_customize_register' );

显然, 你可以命名该函数以适合你, 但可以在主题的functions.php文件中调用此块, 并且应该删除此管理部分(它最有可能具有” custom_css”的ID, 但可能会有所不同)

来源:https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/remove_section#Parameters

来源:

https://www.srcmini02.com/64972.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_37361.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?