Last active
November 18, 2025 08:54
-
-
Save Crocoblock/788f1d736c0625cc4eed63c12d84a6e2 to your computer and use it in GitHub Desktop.
get label by glossary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'jet-form-builder/content-filters', function( $filters ) { | |
| class Get_Labels_By_Glossary extends \Jet_Form_Builder\Classes\Filters\Base_Filter { | |
| public function get_id(): string { | |
| return 'get_label_by_glossary'; | |
| } | |
| public function callback_args(): array { | |
| return array( ', ' ); | |
| } | |
| public function apply_macros( $value, ...$args ): string { | |
| list( $glossary ) = $args; | |
| if ( ! function_exists( 'jet_engine' ) || ! $glossary ) { | |
| return $value; | |
| } | |
| return jet_engine_label_by_glossary( $value, $glossary ); | |
| } | |
| } | |
| array_unshift( $filters, ( new Get_Labels_By_Glossary() ) ); | |
| return $filters; | |
| } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment