¿Es posible crear un botón personalizado con funcionalidad propia?
Sí. Es posible añadir su propia funcionalidad y usarla como shortcode.
Ejemplo: (añada el siguiente código al archivo functions.php)
add_shortcode('woot_custom_button', function() {
woot()->include_assets();
return WOOT_HELPER::draw_html_item('a', array(
'href' => 'javascript: woot_helper.call_popup("call_action_custom1",{a:1,b:2,c:"hello",not_paste:1},"asd","Hello World 2020!!"); void(0);',
'title' => '',
'class' => 'woot-btn'
), 'click on this button');
});
add_action('call_action_custom1', function($args, $call_id) {
print_r($args);
return "It is custom action in functions.php";
}, 10, 2);Resultado: un botón que, al hacer clic, muestra una ventana emergente con datos