Created
May 2, 2024 12:09
-
-
Save jechazelle/cb8fc04936dbf49b50e6f2c0f51f1be5 to your computer and use it in GitHub Desktop.
Revisions
-
jechazelle created this gist
May 2, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,60 @@ <?php add_action( 'jet-engine/register-macros', function(){ //class My_JE_Macros extends \Jet_Engine_Base_Macros { class My_JE_Macros extends \Jet_Engine_Base_Macros { /** * Returns macros tag * * @return string */ public function macros_tag() { return 'my_macros'; } /** * Returns macros name * * @return string */ public function macros_name() { return 'My Macros'; } /** * Callback function to return macros value * * @return string */ public function macros_callback( $args = array() ) { var_dump( $args ); return 'macros value'; } /** * Optionally return custom macros attributes array * * @return array */ public function macros_args() { return array( 'arg_1' => array( 'label' => __( 'Arg 1', 'jet-engine' ), 'type' => 'text', 'default' => '', ), 'arg_2' => array( 'label' => __( 'Arg 2', 'jet-engine' ), 'type' => 'text', 'default' => '', ) ); } } new My_JE_Macros (); } );