1. Go to this page and download the library: Download spock/shadow-taxonomies library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
spock / shadow-taxonomies example snippets
add_action( 'init', function() {
register_taxonomy(
'services-tax',
'staff-cpt',
array(
'label' => __( 'Services', 'text-domain' ),
'rewrite' => false,
'show_tagcloud' => false,
'hierarchical' => true,
)
);
// We will make our connection here in the next step.
});
wp shadow sync --cpt=cpt_slug --tax=taxonomy_slug
// Will sync all of the input custom post types by creating terms in the input taxonomy.
wp shadow sync --cpt=cpt_slug --tax=taxonomy_slug --dry-run
// Will output a table of the changes the script will make without actually making any changes.
wp shadow sync --cpt=cpt_slug --tax=taxonomy_slug --verbose
// Will sync the terms but also output more logs as it process your data.
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.