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.
- php >= 7.4
-
Go to your active theme directory or custom plugin and run:
composer require wolfiesites/yaml-to-wordpress
-
Add this to ur main
plugin-file.php
orfunctions.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');
-
Create
config.yaml
touch config.yaml
-
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
- or manually here: Example: config.yaml
All examples can be found here:
-
Adjust and enjoy! :)
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!
https://github.com/wolfiesites/yaml-to-wordpress/tree/main/examples
wihtout those three amazing packages it wouldn't be possible.
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
- registering sidebars
- registering templates (and for certain post types)
- registering gutenberg blocks and easier their development