WordPress setting with select – where is my mistake?

The problem is that in your calls to selected() you haven’t set the 3rd parameter to false. For both selected() and checked() if you don’t do this it will echo the attribute immediately, which won’t work properly if you’re using it inside a concatenated string. So change: selected( get_option(‘myplugin_admin_bar’), 1 ) To: selected( get_option(‘myplugin_admin_bar’), 1, … Read more

Select box saves but doesn’t update value in admin

The second parameter of selected() has to agree with the value attribute of the current <option>. So assuming you have stuffed $selected with the value given by the relevant get_post_meta(), the following should work for you: <label for=”myplugin_meta_box_select”>Status:</label> <select name=”myplugin_meta_box_select” id=”myplugin_meta_box_select”> <option value=”Approved” <?php selected( $selected, ‘Approved’ ); ?>>Approved</option> <option value=”In Progress” <?php selected( $selected, … Read more

How to number the options in a wp_dropdown_pages() select?

To change <option value=”http://someurl”>item one</option> <option value=”http://someurl”>item two</option> <option value=”http://someurl”>item three</option> to <option value=”http://someurl”>1. item one</option> <option value=”http://someurl”>2. item two</option> <option value=”http://someurl”>3. item three</option> we can utilize the list_pages filter from the Walker_PageDropdown::start_el() method. Here’s an example: // Add filter add_filter( ‘list_pages’, ‘wpse_itemize’, 10, 2 ); // Display dropdown wp_dropdown_pages(); // Remove filter remove_filter( ‘list_pages’, … Read more

Export posts manually selected by end user (not logged in)

I would recommend doing it mostly in Javascript: Basic steps (pseudo code): On the archive page add check boxes <input type=”checkbox” name=”post-with-id-1″ value=”1″> next to each post and a submit button <input type=”submit” value=”Submit”> at the top or bottom of the page. In js, listen for clicks on the submit button. When it is clicked … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)