Here’s my script in php

$pages = get_pages(); 
    foreach ($pages as $pagg) {
        $html .= '<option value="'.get_page_link($pagg->ID).'"' . selected( $hero_options['pp_dropdown_link_'.$i.''], ''.get_page_link($pagg->ID).'', false) . '>';
        if (isset($hero_options['pp_dropdown_link_1'])){
            $html .= $hero_options['pp_dropdown_link_1'];
        }
        else{
            $html.= $pagg->post_title;
        }

Is there anyway that I can add this to jquery? Basically I need to create a drop down list but I use query to clone the form and it needs to populate the drop down list.

Here’s the query I have so far

var pptoappend='
<div id="ppclonedInput1" class="ppclonedInput">
<input id="cs_product_menu_pp_src_1" type="text" size="36" name="hero_options[upload_pp_link_1]" value="" />
<input id="cs_product_menu_pp_src_1_ppbutton" type="button" value="Add / Change" class="button-secondary pp-upload-button" />
<div class="button ppremove">-</div> 
<input id="pp_text_box1" class="pp_text_box" type="text" size="15" name="hero_options[pp_text_box_1]" value="" />
<select id="pp_dropdown_link" name="hero_options[pp_dropdown_link_1]">
  <option value="default">Select page</option>
  <option>wp_list_pages();</option>
</select>'

Read more here: Populate a drop down list in query using some php


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , ,

Wordpress related questions and answers: