wolfiesites/yaml-to-wordpress

Manage wordpress with yaml. Create settings pages and metaboxes for posts and terms. Add pages to admin menu. Register custom post types and taxonomies via config.yaml file. Use it in all ur plugins or themes. Unleash full power of wordpress quickly.

1.0.0 2023-12-31 15:10 UTC

This package is auto-updated.

Last update: 2024-05-01 00:12:13 UTC


README

Manage your whole wordpress using single or multiple yaml files. You can:

  • make settings pages
  • register custom post types
  • register custom taxonomies
  • add metaboxes for: post_meta, user_meta, term_meta, comment_meta

tip: you can reinstall and use it in all ur seperate wordpress plugins and themes.

requirement

  • php >= 7.4

how to install?

via composer package

  1. Go to your active theme directory or custom plugin and run:

    composer require wolfiesites/yaml-to-wordpress
  2. Add this to ur main plugin-file.php or functions.php

    // This if prevents an error if you use the same composer packages and versions
    if (!class_exists('ComposerAutoloaderInit228a8406a34a58cdfa0baa1563d5478e')) {
        require_once(__DIR__.'/vendor/autoload.php');
    }
    new Wolfiesites\YamlToWp(__DIR__ .'/config.yaml');
  3. Create config.yaml

    touch config.yaml
  4. This is a good starter point (paste with command to config.yaml: (optional)

    curl -sSL "https://raw.githubusercontent.com/wolfiesites/yaml-to-wordpress/main/examples/6.%20mix_of_examples/books__cpt_with_post_meta%2Btaxonomies/config.yaml" >> config.yaml

    All examples can be found here:

  5. Adjust and enjoy! :)

want to load another config.yaml file?

instead of first configuration u can paste below:

// this if, prevents from error if u use same composer packages and same versions
if (!class_exists('ComposerAutoloaderInit228a8406a34a58cdfa0baa1563d5478e')) {
  require_once(__DIR__.'/vendor/autoload.php');
}
$plugin_prefix_y2wp = new Wolfiesites\YamlToWp(__DIR__ .'/config.yaml');
$plugin_prefix_y2wp->add_config(__DIR__.'/another.yaml');

You can add as many config.yaml files as u like!

documentation:

https://github.com/wolfiesites/yaml-to-wordpress/tree/main/examples

special thanks to:


wihtout those three amazing packages it wouldn't be possible.

support me:

This plugin has to be GPL cause of wordpress restrictions but PLEASE consider it as MIT.
If u build on top of it, IT is greatly advisable to mention authors of all the packages.
you may buy me a coffe soon here: https://wolfiesites.com

future features:

  • registering sidebars
  • registering templates (and for certain post types)
  • registering gutenberg blocks and easier their development