內容簡介
Devel 具有針對開發者和高級使用者的開發導向管理組件,可讓他們更好地控制其 WordPress 網站。
功能分為組件,可以啟用或停用。此外,devel 具有直觀的 API,可使用 devel 組件 API 添加自己的自定義組件。
打包的組件
預設情況下,devel 附帶:
自定義字段管理器 - 允許您管理站點中的所有自定義字段。
未來的版本逐漸增加其他組件。如果您有任何建議的組件,請訪問 論壇。
組件 API
使用組件 API,您可以將自己的組件添加到 devel。
添加組件:
add_action( 'devel_register_components', 'register_my_components' );
function register_my_components() {
register_devel_component( array( 'id' => 'debug', 'label' => 'Debug', 'callback' => 'debug_callback', 'description' => 'This is a custom component.' ) );
}
在您的回調函數中:
function debug_callback() {
if ( is_active_devel_component( 'debug' ) ) {
require_once( TEMPLATEPATH . '/devel-component-debug.php' );
}
}
在 devel-component-debug.php 中,您可以連接到 devel 菜單:
add_action( 'admin_menu', 'custom_fields_init' );
function custom_fields_init() {
add_submenu_page( 'devel', 'Debug', 'Debug', 'manage_options', 'debug-component', 'debug_admin_page' );
}
function debug_admin_page() { ?>
<div class="class">
<?php screen_icon('tools'); ?>
<h2>Debug</h2>
</div>
<?php
}
外掛標籤
開發者團隊
原文外掛簡介
Devel is made up of development oriented administrative components for developers and power users who need more control over their WordPress site.
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.
Bundled Components
By default, devel comes packaged with:
Custom Fields Manager – Allows to you manage all custom fields in your site.
Additional components will be added gradually throughout future releases. If you have any component suggestions, please visit the forums.
Components API
Using the components API, you can add your own components to devel.
Add a component:
add_action( 'devel_register_components', 'register_my_components' );
function register_my_components() {
register_devel_component( array( 'id' => 'debug', 'label' => 'Debug', 'callback' => 'debug_callback', 'description' => 'This is a custom component.' ) );
}
In your callback function:
function debug_callback() {
if ( is_active_devel_component( 'debug' ) ) {
require_once( TEMPLATEPATH . '/devel-component-debug.php' );
}
}
In devel-component-debug.php you can hook into the devel menu:
add_action( 'admin_menu', 'custom_fields_init' );
function custom_fields_init() {
add_submenu_page( 'devel', 'Debug', 'Debug', 'manage_options', 'debug-component', 'debug_admin_page' );
}
function debug_admin_page() { ?>
Debug
