getolympus / olympus-hera
此软件包已被废弃且不再维护。作者建议使用 getolympus/olympus-zeus-core 软件包。
Olympus Zeus 框架核心系统,使您的所有 WordPress 插件和主题开发变得更加简单高效。
v2.3.8
2024-03-22 02:01 UTC
Requires
- behat/transliterator: ^1.0
- getolympus/olympus-dionysos-field-background: ^0.0.3
- getolympus/olympus-dionysos-field-code: ^0.0.12
- getolympus/olympus-dionysos-field-color: ^0.0.13
- getolympus/olympus-dionysos-field-content: ^0.0.11
- getolympus/olympus-dionysos-field-font: ^0.0.2
- getolympus/olympus-dionysos-field-link: ^0.0.21
- getolympus/olympus-dionysos-field-oembed: ^0.0.3
- getolympus/olympus-dionysos-field-radio: ^0.0.16
- getolympus/olympus-dionysos-field-select: ^0.0.11
- getolympus/olympus-dionysos-field-text: ^0.0.19
- getolympus/olympus-dionysos-field-textarea: ^0.0.14
- getolympus/olympus-dionysos-field-toggle: ^0.0.15
- getolympus/olympus-dionysos-field-upload: ^0.0.16
- getolympus/olympus-dionysos-field-wordpress: ^0.0.20
- getolympus/olympus-hera-renderer: ^0.0.6
- getolympus/olympus-hermes-translator: ^0.0.2
- getolympus/olympus-poseidon-customizer: ^0.0.1
- symfony/http-foundation: ^5.0
Requires (Dev)
- phpunit/phpunit: ^9.3
- squizlabs/php_codesniffer: ^3.4
- v2.3.8
- v2.3.7
- v2.3.6
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.7
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.1
- v2.0.0
- v1.1.0
- 1.0.0
- dev-master / 0.x-dev
- v0.0.49
- v0.0.48
- v0.0.47
- v0.0.46
- v0.0.45
- v0.0.44
- v0.0.43
- v0.0.42
- v0.0.41
- v0.0.40
- v0.0.39
- v0.0.38
- v0.0.37
- v0.0.36
- v0.0.35
- v0.0.34
- v0.0.33
- v0.0.32
- v0.0.31
- v0.0.30
- v0.0.29
- v0.0.28
- v0.0.27
- v0.0.26
- v0.0.25
- v0.0.24
- v0.0.23
- v0.0.22
- v0.0.21
- v0.0.20
- v0.0.19
- v0.0.18
- v0.0.17
- v0.0.16
- v0.0.15
- v0.0.14
- v0.0.13
- v0.0.12
- v0.0.11
- v0.0.10
- v0.0.9
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-develop
- dev-dependabot/npm_and_yarn/load-grunt-config-4.0.0
- dev-dependabot/add-v2-config-file
- dev-dependabot/npm_and_yarn/grunt-contrib-less-3.0.0
- dev-dependabot/npm_and_yarn/grunt-contrib-cssmin-4.0.0
This package is auto-updated.
Last update: 2024-03-22 02:02:17 UTC
README
Olympus Zeus Core 是一个框架,使您所有 WordPress 插件和主题的开发更加简单高效。
composer require getolympus/olympus-zeus-core
特性
- 更好的安全文件夹结构
- 默认集成所有 Olympus 字段
- Olympus Hera Renderer 和 Hermes Translator
- Symfony HTTP Foundation 和 类加载器 组件
- 使用 Composer 进行依赖管理
- 更多...
初始化
要从 WordPress 主题的 functions.php
文件或主插件 php 文件初始化 Zeus Core
// file: functions.php namespace MyThemeName; /** * Everything starts here. * * @package MyThemeName * @author Your Name <yourmail@domain-name.ext> * @since x.y.z * */ // Directory separator and Vendor path. defined('S') or define('S', DIRECTORY_SEPARATOR); // Provided by Olympus container defined('VENDORPATH') or define('VENDORPATH', realpath(dirname(__DIR__)).S.'vendor'.S); // Provided by Olympus container /** * MyThemeName class definition */ if (!class_exists('MyThemeName')) { /** * Use of Zeus abstract PHP class to initialize everything. */ class MyThemeName extends \GetOlympus\Zeus\Zeus { /** * Define all useful folders */ // Load option admin pages protected $adminpages = __DIR__.S.'controllers'.S.'adminpages'; // Load scheduled actions protected $crons = __DIR__.S.'controllers'.S.'crons'; // Load custom post types protected $posttypes = __DIR__.S.'controllers'.S.'posttypes'; // Load custom terms protected $terms = __DIR__.S.'controllers'.S.'terms'; // Load options for users protected $users = __DIR__.S.'controllers'.S.'users'; // Load custom widgets protected $widgets = __DIR__.S.'controllers'.S.'widgets'; /** * Define WordPress optimizations and configurations in a single var. */ protected $configurations = [ 'AccessManagement' => [/*...*/], 'Assets' => [/*...*/], 'Clean' => [/*...*/], 'Menus' => [/*...*/], 'Settings' => [/*...*/], 'Shortcodes' => [/*...*/], 'Sidebars' => [/*...*/], 'Sizes' => [/*...*/], 'Supports' => [/*...*/], ]; /** * Main function which defines vendors path * and some useful actions needed by your application */ protected function setVars() { // Load Zeus framework vendors. if (file_exists($autoload = VENDORPATH.'autoload.php')) { include $autoload; } // Add custom actions. } } } // Instanciate MyThemeName return new MyThemeName();
自定义帖子类型示例
假设您需要一个新的 Movie
自定义帖子类型,以下是 controllers/posttypes/MoviePosttype.php
内容文件
// file: controllers/posttypes/MoviePosttype.php namespace MyThemeName\Controllers\Posttypes; /** * Extends main \GetOlympus\Zeus\Posttype\Posttype class to use all functionalities */ class MoviePosttype extends \GetOlympus\Zeus\Posttype\Posttype { /** * @var array */ protected $args = [ 'menu_icon' => 'dashicons-video-alt3', 'supports' => ['title', 'excerpt', 'thumbnail'], 'taxonomies' => ['post_tag'], 'rewrite' => [ 'slug' => 'movie', 'with_front' => true, ], ]; /** * @var string */ protected $slug = 'movie'; /** * Prepare variables. */ public function setVars() { // Update labels $this->setLabels([ 'name' => __('Movies', 'mythemename'), 'singular_name' => __('Movie', 'mythemename'), ]); // Add metabox $this->addMetabox(__('Details', 'mythemename'), [ \GetOlympus\Dionysos\Field\Text::build('link', [ 'title' => __('Movie source URL', 'mythemename'), ]), \GetOlympus\Dionysos\Field\Text::build('length', [ 'title' => __('Length in seconds', 'mythemename'), ]), \GetOlympus\Dionysos\Field\Text::build('author', [ 'title' => __('Author name', 'mythemename'), ]), // (...) ]); } }
发布历史
查看 CHANGELOG.md 了解所有详细信息。
贡献
- 分叉它 (https://github.com/GetOlympus/Zeus-Core/fork)
- 创建您的功能分支 (
git checkout -b feature/fooBar
) - 提交您的更改 (
git commit -am 'Add some fooBar'
) - 将更改推送到分支 (
git push origin feature/fooBar
) - 创建一个新的拉取请求
由 Achraf Chouk 建造,自很久以前以来。