← Back
Editing: terms.php
<?php /** * Author preview grab with URL as the value * for choices in a select */ add_action( 'cs_dynamic_content_register', function() { cs_dynamic_content_register_dynamic_option('terms', [ 'filter' => function($results, $args) { $terms = cornerstone('Locator')->find_terms([]); $out = [ [ 'value' => '', 'label' => __('Select a Term', 'cornerstone'), ], ]; foreach ($terms as $term) { // Setup select value $out[] = [ 'value' => $term->term_id, 'label' => $term->name, ]; } return $out; }, ]); });
Save File
Cancel