PHP code example of getolympus / olympus-zeus-core
1. Go to this page and download the library: Download getolympus/olympus-zeus-core library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
getolympus / olympus-zeus-core example snippets
// file: functions.php
namespace MyThemeName;
/**
* Everything starts here.
*
* @package MyThemeName
* @author Your Name <[email protected]>
* @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')) {