Skip to content

wolfiesites/yaml-to-wordpress

Repository files navigation

yaml to wordpress

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

About

Manage wordpress with yaml

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages