Plugin Directory

Changeset 954745


Ignore:
Timestamp:
07/25/2014 12:34:50 PM (12 years ago)
Author:
quartz
Message:

fix select query for options list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wordpress-custom-fields/trunk/wp-customfields.php

    r780356 r954745  
    124124                    where
    125125                    option_name like 'wpcf_%' and option_name != 'wpcf_activation'";
    126             $result_posts = mysql_query($sql);
     126            $options = $wpdb->get_results($sql);
     127
    127128            $i = 0;
    128             while ($row_post = mysql_fetch_assoc($result_posts)) {
     129            foreach ($options as $option) {
    129130                print '<div style="margin-bottom:30px;" id="d' . $i . '">';
    130                 print '<strong>name : ' . str_replace('wpcf_', '', $row_post["option_name"]) . '</strong>';
     131                print '<strong>name : ' . str_replace('wpcf_', '', $option->option_name) . '</strong>';
    131132                print '<br/>';
    132                 print '<input type="hidden" id="i' . $i . '" name="wpcf[]" value="' . stripslashes($row_post["option_name"]) . '"/>';
    133                 print '<strong>value : </strong><textarea id="tb' . $i . '" name="wpcfv[]">' . stripslashes($row_post["option_value"]) . '</textarea>';
     133                print '<input type="hidden" id="i' . $i . '" name="wpcf[]" value="' . stripslashes($option->option_name) . '"/>';
     134                print '<strong>value : </strong><textarea id="tb' . $i . '" name="wpcfv[]">' . stripslashes($option->option_value) . '</textarea>';
    134135                print ' <input type="checkbox" onClick="flip(document.getElementById(\'tb' . $i . '\'));"/> Delete';
    135136                print '</div>';
Note: See TracChangeset for help on using the changeset viewer.