tuend-work / wp-codestar-framework
Codestar 框架的 Composer 包
1.0.5
2022-12-26 06:19 UTC
README
wp-codestar-framework
使用 Composer 命令将此库导入到您的项目中
composer require tuend-work/wp-codestar-framework
使用示例
/**
* Plugin Name: My Basics Plugin
* Plugin URI: https://example.com/plugins/the-basics/
* Description: Handle the basics with this plugin.
* Version: 1.10.3
* Requires at least: 5.2
* Requires PHP: 7.2
* Author: John Smith
* Author URI: https://author.example.com/
* License: GPL v2 or later
* License URI: https://gnu.ac.cn/licenses/gpl-2.0.html
* Update URI: https://example.com/my-plugin/
* Text Domain: my-basics-plugin
* Domain Path: /languages
*/
require __DIR__ . '/vendor/autoload.php';
// Control core classes for avoid errors
if( class_exists( 'CSF' ) ) {
//
// Set a unique slug-like ID
$prefix = 'my_framework';
//
// Create options
CSF::createOptions( $prefix, array(
'menu_title' => 'My Framework',
'menu_slug' => 'my-framework',
) );
//
// Create a section
CSF::createSection( $prefix, array(
'title' => 'Tab Title 1',
'fields' => array(
//
// A text field
array(
'id' => 'opt-text',
'type' => 'text',
'title' => 'Simple Text',
),
)
) );
//
// Create a section
CSF::createSection( $prefix, array(
'title' => 'Tab Title 2',
'fields' => array(
// A textarea field
array(
'id' => 'opt-textarea',
'type' => 'textarea',
'title' => 'Simple Textarea',
),
)
) );
}
获取更多元素: https://codestarframework.com/documentation/#/configurations 在 WordPress 网站上查看实时演示: http://codestarthemes.com/plugins/codestar-framework/wp-login.php