PHP code example of outstand / term-selector
1. Go to this page and download the library: Download outstand/term-selector 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/ */
outstand / term-selector example snippets
register_taxonomy(
'region',
'post',
[
'hierarchical' => false,
'show_ui' => true,
'show_in_rest' => true,
'use_hierarchical_selector' => true,
]
);
add_filter(
'outstand_term_selector_taxonomies',
function ( $slugs ) {
$slugs[] = 'post_tag';
return array_values( array_diff( $slugs, [ 'region' ] ) );
}
);