getolympus / olympus-zeus-core
Olympus Zeus framework core system used to make all your WordPress plugins and themes developments easier and efficient.
Fund package maintenance!
Issuehunt
Installs: 405
Dependents: 13
Suggesters: 0
Security: 0
Stars: 8
Watchers: 3
Forks: 0
Open Issues: 4
Type:framework
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
- v1.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-10-22 03:14:17 UTC
README
Olympus Zeus Core is a framework which allows you to make all your WordPress plugins and themes developments easier and efficient.
composer require getolympus/olympus-zeus-core
Features
- Better and secure folder structure
- All Olympus fields integrated by default
- Olympus Hera Renderer and Hermes Translator
- Symfony HTTP Foundation and Class loader components
- Dependency management with Composer
- And more...
Initialization
To initialize Zeus Core
from your functions.php
WordPress theme file or main plugin php file:
// 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();
A custom post type example
Assuming you need a new Movie
custom post type, here is the controllers/posttypes/MoviePosttype.php
content file:
// 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'), ]), // (...) ]); } }
Release History
See CHANGELOG.md for all details.
Contributing
- Fork it (https://github.com/GetOlympus/Zeus-Core/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
Built with ♥ by Achraf Chouk ~ (c) since a long time.