0
我试图删除部分WordPress新闻在我的仪表板通过创建一个简单的插件。首先,我做了下面的目录中的PHP文件:为什么remove_meta_box()函数在我的插件中不起作用?
的wp-content /插件/基本-plugin.php
在该基本plugin.php文件我有以下代码块:
<?php
/*
Plugin Name: Basic Plugin
Plugin URI: http://wordpress.org/plugins/basic-plugin/
Description: My first plugin for creating and displaying job opportunities
Author: Rumen Panchev
Version: 1.0
License: GPLv2
*/
function ru_remove_dashboard_widget() {
remove_meta_box('dashboard_primary', 'dashboard', 'post_container_1');
}
add_action('wp_dashboard_setup', 'ru_remove_dashboard_widget');
问题是该部分仍在仪表板中。 Im新的WordPress开发,并不确定为什么会发生这种情况?
帮了不少忙。谢谢。 –