Devel is made up of development oriented administrative components for developers and power users who need more control over their WordPress site.
Devel em>由面向开发的管理组件组成,面向需要对WordPress网站进行更多控制的开发人员和高级用户。 p>Features are seperated into components which can be enabled or disabled.
功能分为可启用或禁用的组件。
In addition, devel has an intuitive API for adding your own custom components into the mix using the devel components API.
此外,devel具有直观的API,可使用devel组件API将自己的自定义组件添加到混合中。 p>
Bundled Components
捆绑的组件 strong> p>By default, devel comes packaged with:
默认情况下,devel随附于: p>
- Custom Fields Manager – Allows to you manage all custom fields in your site.
- 自定义字段管理器 em> –允许您管理站点中的所有自定义字段。 li>
ul>
Additional components will be added gradually throughout future releases.
在将来的发行版中将逐渐添加其他组件。
If you have any component suggestions, please visit the forums.
如果您有任何组件建议,请访问论坛。 p>
Components API
组件API h4>
Using the components API, you can add your own components to devel.
使用组件API,您可以将自己的组件添加到开发中。 p>
Add a component:
添加组件: p>
add_action( 'devel_register_components', 'register_my_components' ); add_action('devel_register_components','register_my_components');function register_my_components() {
函数register_my_components(){
register_devel_component( array( 'id' => 'debug', 'label' => 'Debug', 'callback' => 'debug_callback', 'description' => 'This is a custom component.' ) );
register_devel_component(array('id'=>'debug','label'=>'Debug','callback'=>'debug_callback','description'=>'这是一个自定义组件。'));
}
}
code> pre>
In your callback function:
在您的回调函数中: p>
function debug_callback() { function debug_callback(){ if ( is_active_devel_component( 'debug' ) ) {
如果(is_active_devel_component('debug')){
require_once( TEMPLATEPATH . '/devel-component-debug.php' );
require_once(TEMPLATEPATH。'/devel-component-debug.php');
}
}
}
}
code> pre>
In devel-component-debug.php
you can hook into the devel menu:
在 devel-component-debug.php code>中,您可以进入开发菜单: p>add_action( 'admin_menu', 'custom_fields_init' ); add_action('admin_menu','custom_fields_init');function custom_fields_init() {
函数custom_fields_init(){
add_submenu_page( 'devel', 'Debug', 'Debug', 'manage_options', 'debug-component', 'debug_admin_page' );
add_submenu_page('devel','Debug','Debug','manage_options','debug-component','debug_admin_page');
}
}
function debug_admin_page() { ?>
函数debug_admin_page(){?>
<?php screen_icon('tools');
?>
?>
Debug
调试 h2>
div>
<?php
}
}
code> pre>