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.
Requires
- php: >=7.4
- htmlburger/carbon-fields: ^3.6
- symfony/yaml: ^5.4
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
-
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! :)
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