lundi 2 mars 2015

How to get the id of each form?


I want to get the id of each form, but displayed only the id of the first form.



add_shortcode( 'form','form_shortcode' );

global $form;


function form_shortcode($atts)
{
global $form;

$defaults = array(
'id' => '0',
'open_trigger' => '',
'type' => 'button',
'text' => 'open');
extract( shortcode_atts( $defaults, $atts ) );

wp_parse_args($atts, $defaults);

$form = $atts;

return get_form();
}

function get_megapoll_id()
{
global $form;
echo $form['id'];
}


How to get in the template file each id of the form?



plugin/form/template/default/template.php

<div id="<?php get_form_id(); ?>">

</div>


I want it to be so.



[form id="1"]
[form id="2"]

<div id="1">

</div>

<div id="2">

</div>


Sorry for my english.





Aucun commentaire:

Enregistrer un commentaire