digitalunited/wp-base

This package is abandoned and no longer maintained. No replacement package was suggested.

Utiltiy for revisioning of acf and cpt-ui configurations and some other awesomeness

Installs: 426

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 7

Forks: 0

Open Issues: 1

Type:wordpress-plugin

0.2.5 2014-12-18 12:03 UTC

This package is not auto-updated.

Last update: 2017-09-03 16:17:32 UTC


README

Digital United uses this plugin to gain a standard approach to WordPress development with Advanced Custom (ACF) and Custom Post UI (CPT-UI). We don't think these configurations belongs to a database storage but the tools used is great! This plugin offers a way to store, version control and synchronize these settings generated via ACF and CPT-UI.

Status

This WordPress plugin is in experimental phase.

How to get started

This plugin has no user interface.

  1. The plugin should be installed in the standard plugins folder. Don't activate, yet!
  2. Run composer in the plugin root, ´composer install´. We will provide a distributed version later on.
  3. Make sure you have defined WP_DEBUG in wp_config.php, define('WP_DEBUG', true);
  4. Create a writable folder in your theme named 'wp-base-config', eg /wp-content/themes/your-theme/wp-base-config.
  5. Activate the plugin!
  6. Update your ACF or CPT-UI and take a look in the wp-base-config folder.

Advanced Custom Fields

When updating ACF, two files per group will be created/updated.

  1. {key}.json with the group data for backup as import file.
  2. {key}.php as possible include to test and production environment.

Now it's possible for your team to version control the ACF definitions.

Custom Post Type UI

When updating CPT UI, two files per type will be created/updated.

  1. type_{cpt_name}.php as register post type
  2. type_{cpt_name}.json as the data file for the cpt

...or if updating a taxonomy:

  1. taxonomy_{cpt_name}.php as register taxonomy type
  2. taxonomy_{cpt_name}.json as the data file for the cpt-taxonomy

Now it's possible for your team to version control the CPT definitions.

Corcel

There are some experimental tests around Corcel that creates models for every CPT. (more info later on)

Custom configuration

Make your custom settings to the plugins configuration via definitions in the project code.

Example: I would like the plugin to generate the code in a different folder/location.

Place a define within the project, eg:

define( 'WPBASE_CONFIGURATION_FOLDER_PATH', dirname(__FILE__) . '/structure/wpbase' );

Bootstrap

If you like to autoload your settings (Acf AND Cpt) in test/stage/production environments and don´t want to activate WP-Base as plugin then you need to create a bootstrap loading. Here is an example to place in your functions file:

$production_server_names = array(
    'test.company.com',
    'stage.company.com',
    'www.company.com'
);

if ( in_array( $_SERVER['SERVER_NAME'], $production_server_names ) ) {
    $files = glob( __DIR__ . '/.wpbase/**/*.php' );
    foreach ($files as $file) {
        include $file;
    }
}

In that way all the necessary files are loaded for the Acf and Cpt.

Other

Fork and contribute via pull requests to make your improvements!

Good luck! Please, leave your feedback!

Troubleshooting

No files generated, please take a look at the defined path/folder permissions!

Contact

Developer: Digital United, Care Of Haus