2017 © Pedro Peláez
 

library wpkit

Object-oriented development framework for WordPress

image

redink-no/wpkit

Object-oriented development framework for WordPress

  • Thursday, July 26, 2018
  • by Shtrih
  • Repository
  • 10 Watchers
  • 23 Stars
  • 241 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

WPKit

Object-oriented development framework for WordPress to simplify developers life., (*1)

Now you can spend less time for routine operations like creating post-types, taxonomies, meta-boxes. WPKit will help you write less code -> drink more beer :), (*2)

Powered by Redink AS, (*3)

License

The WPKit framework is open-source software and distributed under the GPL-2+ license. See LICENSE for more information., (*4)

Initalization

Just include WPKit autoloader, (*5)

require_once __DIR__ . '/WPKit/init_autoloader.php';

and you can start using it. We recommend use module structure fully supported by WPKit., (*6)

Usage example

Post type

Lets create post type Cars. You just need create new instance of PostType with slug and single name in parameters., (*7)

$cars_post_type = new WPKit\PostType\PostType('car','Car');

Metabox

Now we need add some custom fields. First of all we need create metabox, (*8)

$metabox = new WPKit\PostType\MetaBox('data','Properties');

And then we need add this metabox to our post type, (*9)

$cars_post_type->add_metabox( $metabox );

or, (*10)

$metabox->add_post_type( $cars_post_type );

You can add one matabox to several post types., (*11)

Fields

$metabox->add_field( 'reg_no', 'Registration #' );  // By default Text field will be used
$metabox->add_field( 'year', 'Year', 'Number' );    // You can set Field in 3rd parameter as string
$metabox->add_field( 'color', 'Color', function(){  // Or use more flexible callback function
    $filed = new WPKit\Fields\Select();
    $filed->set_options([                           // Like settings options and other
        'red',
        'black',
        'white',
        'yellow'
    ]);

    return $filed;                                  // Function should always return created filed
} );

, (*12)

To get value of custom fields use MetaBox::get() method., (*13)

<?php $year = WPKit\PostType\MetaBox::get( get_the_ID(), 'data', 'year' ); ?>

Tests

You can use WP_Mock. There are an example of bootstrap file for tests:, (*14)

require_once 'vendor/autoload.php';

WP_Mock::bootstrap();

define( 'TEMPLATEPATH', __DIR__ );
$loader = new \WPKit\Module\Loader();
$loader->phpunit_load_modules();

#

More features will come in Wiki or just explore code ;), (*15)

Release History

Version 1.7.0, (*16)

  • New options for OptionPage, Taxonomy
  • DateTime and PostSelect field added
  • Api key for google maps field
  • Unit Testing with WP_Mock added
  • Fix ssl assets load
  • Fix for using WPKit in child themes
  • Select2 updated to 4.0.3 version
  • Placeholder fix for Select2
  • Fix problem with several Select2 on page

Version 1.6.3, (*17)

  • Fixes on repeatable
  • Fix with http/https select2 assets loading

Version 1.6.2, (*18)

  • Default values for repeatable metabox
  • Auto add 'http://' in Url field
  • Default value in Option::get method
  • Remove srcset from image in Image field
  • Composer rename
  • Fixes

Version: 1.6, (*19)

  • PostLoader for huge homepages builders to reduce SQL queries
  • MetaBox Related Posts limit parameter added
  • PostType show_in_menu, public parameters added
  • MetaBoxRepeatable - added vertical layout and some improvements
  • Taxonomy show_ui parameter added
  • PostType has_archive type fix
  • Video field changed to use oEmbed
  • File field fix for SVG support
  • WP 4.5 improvements
  • TaxonomyMeta deprecated due to core WP functionality
  • PHP 7 preparation

Version: 1.5.6, (*20)

  • Youtube API key fix

Version: 1.5.5, (*21)

  • APSIS integration
  • Fixes on youtube and instagram integrations
  • PHPDoc description added

Version: 1.5, (*22)

  • WPEditor params added
  • Additional request parameters in Instagram
  • Added add_action add_filter into autoread Initialization
  • Add Transient cache
  • Added JS triggers on repeatable actions
  • Fixes in repeatable metabox
  • Fix for multiple image/file buttons on screen

Version: 1.3, (*23)

  • Added rewrite for post types
  • Added select2 for select field
  • Added localizations
  • Added limits for metabox Repeatable
  • Added Users meta box
  • Implemented Youtube integration class
  • Implemented Instagram integration class
  • Reload JS on fields
  • Object cache support
  • More table bulk action fix
  • Repeatable metabox save fixes

Version: 1.2.1, (*24)

  • Added rewrite options for post type
  • Table bulk action fix
  • AbstractWidget AJAX fix

Version: 1.2, (*25)

  • Context to metaboxes
  • Multiple select support
  • YouTube integration class
  • MetaBox Related Posts
  • Wrong url in enqueue inline script
  • No results message for Map field

Version: 1.1, (*26)

  • Added Fields
    • Date
    • File
    • Map
    • WPEditor
    • Hidden
    • Number
  • Repeatable/Sortable fields set
  • Table order fix

Version: 1.0.4, (*27)

  • first version

The Versions

26/07 2018

dev-develop

dev-develop

Object-oriented development framework for WordPress

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.4.0

 

by Oleksandr Strikha
by Vitaly Nikolaev
by Viktor Kuliebiakin

wordpress wpkit

31/07 2017

dev-master

9999999-dev

Object-oriented development framework for WordPress

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.4.0

 

by Oleksandr Strikha
by Vitaly Nikolaev
by Viktor Kuliebiakin

wordpress wpkit

22/04 2016

dev-feature/tax_meta_to_taxmeta

dev-feature/tax_meta_to_taxmeta

Object-oriented development framework for WordPress

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.4.0

 

by Oleksandr Strikha
by Vitaly Nikolaev
by Viktor Kuliebiakin

wordpress wpkit

04/11 2015

dev-feature/composer

dev-feature/composer

Object-oriented development framework for WordPress

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.4.0

 

by Oleksandr Strikha
by Vitaly Nikolaev
by Viktor Kuliebiakin

wordpress wpkit