Code Monkey home page Code Monkey logo

justinadlock-hybrid-core's Introduction

Hybrid Core: WordPress Framework

Hybrid Core is a framework for developing WordPress plugins and themes.

The core package is the application layer that primarily consists of a service container. It can be used alone or alongside any of the available Hybrid packages.

The framework simplifies many of the complexities of WordPress development and helps you write more modern PHP code. Its goal is to provide elegant functions, classes, and interfaces for writing code without the need to rebuild everything from scratch with each project.

Requirements

  • WordPress 5.7+
  • PHP 7.0+
  • Composer 2.0+

Donations

Hybrid Core is free. However, donations to the project are also welcome.

Documentation

The documentation is handled via Hybrid Core's wiki. This is community-contributed documentation that I hope you will add to if you use the framework.

Installation

Use the following command from your preferred command line utility to install the package.

composer require themehybrid/hybrid-core

If bundling this directly in your plugin, add the following code.

For plugins:

if ( file_exists( 'vendor/autoload.php' ) ) {
        require_once 'vendor/autoload.php';
}

For themes:

if ( file_exists( get_parent_theme_file_path( 'vendor/autoload.php' ) ) ) {
	require_once( get_parent_theme_file_path( 'vendor/autoload.php' ) );
}

Bootstrapping Hybrid Core

Hybrid Core isn't launched until an instance of its Hybrid\Core\Application class is created and its boot() method has been called.

Because the Application class can be called multiple times via both plugins and themes, developers need to check the Hybrid\booted() function before attempting to create a new app. If one exists, they should use the existing instance via the Hybrid\app() helper function.

// Create a new application.
$slug = \Hybrid\booted() ? \Hybrid\app() : new \Hybrid\Core\Application();

// Add service providers.
$slug->provider( \YourProject\Provider::class );

// Bootstrap the application.
$slug->boot();

Copyright and License

This project is licensed under the GNU GPL, version 2 or later.

2008 – 2021 © Justin Tadlock.

justinadlock-hybrid-core's People

Contributors

justintadlock avatar m-e-h avatar nextgenthemes avatar oakwoodgates avatar rarst avatar riyaku avatar robneu avatar saas786 avatar samikeijonen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.