2017 © Pedro Peláez
 

library wp-theme

A starter lib for wordpress themes

image

owc/wp-theme

A starter lib for wordpress themes

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 10 % Grown

The README.md

Oakwood Wordpress Theme Framework

Latest Stable Version Total Downloads License, (*1)

Installation

Add owc/wp-theme as a requirement to composer.json:, (*2)

{
    "require": {
        "owc/wp-theme": "dev-master"
    }
}

Update your packages with composer update or install with composer install., (*3)

You can also add the package using composer require owc/wp-theme and later specifying the version you want (for now, dev-master is your best bet)., (*4)

Documentation

Getting Started

Oakwood Wordpress Theme Framework offers 3 main abstract classes to extend:, (*5)

Oakwood\AbstractTheme; # Handles theme related filters, actions & functions
Oakwood\AbstractAdmin; # Handles Wordpress admin related filters, actions & functions
Oakwood\AbstractCron;  # Handles background jobs for Wordpress

Theme

To implement the Theme class extend Oakwood\AbstractTheme in you theme. Preferably in /wp-content/themes/[your-theme]/src/[your-namespace]/Theme.php, (*6)

namespace MyNamespace;

class Theme extends \Oakwood\AbstractTheme {

    public function get_filters( $filters = array() ) {
        // $filters['wordpress_filter'] => 'my_filter';

        // return your custom theme filters
        return $filters;
    }

    public function get_actions( $actions = array() ) {
        // $actions['wordpress_action'] => 'my_action';

        // return your custom theme actions
        return $actions;
    }

    public function get_widgets( $widgets = array() ) {
        // $widgets['MyWidget'] => true;

        // return your custom theme widgets
        return $widgets;
    }

    public function get_styles( $styles = array() ) {
        // $styles['my_css'] => 'path/to/my/css';

        // return your custom theme styles
        return $styles;
    }

    public function get_scripts( $scripts = array() ) {
        // $scripts['my_js'] => 'path/to/my/js';

        // return your custom theme scripts
        return $scripts;
    }

}

Admin

To implement the Admin class extend Oakwood\AbstractAdmin in you theme. Preferably in /wp-content/themes/[your-theme]/src/[your-namespace]/Admin.php, (*7)

namespace MyNamespace;

class Admin extends \Oakwood\AbstractAdmin {

    public function get_filters( $filters = array() ) {
        // $filters['wordpress_filter'] => 'my_filter';

        // return your custom theme filters
        return $filters;
    }

    public function get_actions( $actions = array() ) {
        // $actions['wordpress_action'] => 'my_action';

        // return your custom theme actions
        return $actions;
    }

}

Cron

Not yet documented, (*8)

The Versions

25/08 2015

dev-master

9999999-dev

A starter lib for wordpress themes

  Sources   Download

MIT

The Requires