1
我试图删除在Wordpress网站中更改“网站图标”的能力,除非用户是“超级管理员”。如何删除在WordPress中更改“网站图标”的功能?
我的第一个念头就是想在这里修改该代码段位于** /可湿性粉剂包含/类WP-定制-manager.php
$this->add_setting('site_icon', array(
'type' => 'option',
'capability' => 'manage_options',
'transport' => 'postMessage', // Previewed with JS in the Customizer controls window.
));
$this->add_control(new WP_Customize_Site_Icon_Control($this, 'site_icon', array(
'label' => __('Site Icon'),
'description' => sprintf(
/* translators: %s: site icon size in pixels */
__('The Site Icon is used as a browser and app icon for your site. Icons must be square, and at least %s pixels wide and tall.'),
'<strong>512</strong>'
),
'section' => 'title_tagline',
'priority' => 60,
'height' => 512,
'width' => 512,
)));
但我不想更改任何核心/交付的文件。有没有其他方法可以实现这一点?也许在主题的functions.php文件中?
另外,我目前使用WordPress 4.5.2和第二十二个主题。