0
votes

I'm using a plugin that allows you to create tabs via short code. I created a short code to a form but when I put this short code between the short code of the plugin that generates tabs, the form is out of the tabs.

Shorcode form:

<?php
function test()
{
?>
<h1>Datos de Usiario</h1>
<form id="" action="" method="" >
<fieldset >
<legend>User Data</legend>
<input type='hidden' name='id_wp' value="<?php echo $user_id ?>" value='1'/>
<label for='nombre' >First Name*: </label>
<input type='text' name='nombre' id='' maxlength="50" />
<label for='apellido' >Last Name*: </label>
<input type='text' name='apellido' id='' maxlength="50" />
<label for='email' >Email Address*:</label>
<input type='text' name='emaild' id='' maxlength="50" />
<label for='ciudad' >City*: </label>
<input type='text' name='ciudad' id='' maxlength="50" />

<input type='submit' name='Submit' value='Submit' />

</fieldset>
</form>
<?php
}
?>

and shorcode

function _test_() {

    return test();
}
add_shortcode('test', '_test_');

on page I put this

[fusion_tabs design="classic" layout="horizontal" justified="yes" backgroundcolor="" inactivecolor="" bordercolor="" class="" id=""]
[fusion_tab title="Datos Usuario" icon="fa-user"]

Hello!!


[/fusion_tab]
[fusion_tab title="Registrar Pedido" icon="fa-plus-circle"]

[test]

[/fusion_tab]
[fusion_tab title="Estatus Pedidos" icon="fa-question-circle"]

any!!

[/fusion_tab]
[/fusion_tabs]

and this is the result

image click here

1
Is that really your shortcode code? return rest();? What's rest()? - rnevius
sorry, test not rest - metalbox
Why not just get rid of test(), and put the html within _test_()? If not, you need to have test() return all of that html... - rnevius
answers in new post under this - metalbox

1 Answers

0
votes

You need to return the html in your callback function, e.g.:

function test()
{
    $html = '';
    $html .= '<h1>Datos de Usiario</h1>';
    $html .= '<form id="" action="" method="">';
    // etc.

    return $html;
}