Title: cizko's Replies | WordPress.org

---

# cizko

  [  ](https://wordpress.org/support/users/cizko/)

 *   [Profile](https://wordpress.org/support/users/cizko/)
 *   [Topics Started](https://wordpress.org/support/users/cizko/topics/)
 *   [Replies Created](https://wordpress.org/support/users/cizko/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/cizko/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/cizko/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/cizko/engagements/)
 *   [Favorites](https://wordpress.org/support/users/cizko/favorites/)

 Search replies:

## Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WP3.6 custom fields dropdown with strange behaviour after update](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/)
 *  Thread Starter [cizko](https://wordpress.org/support/users/cizko/)
 * (@cizko)
 * [13 years ago](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/#post-4008159)
 * Hehehe… alright. I’m not about busting your a.. if you are not one of those –
   well – let’s just call them “semi”-pros which seem to float around here a lot,
   bugging real pros for solutions and then charging their customers for copy and
   pasting those.
    And I don’t think I will take you up on your offer – here in 
   Germany our health care system is working pretty well. But thanks anyway. 🙂
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WP3.6 custom fields dropdown with strange behaviour after update](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/)
 *  Thread Starter [cizko](https://wordpress.org/support/users/cizko/)
 * (@cizko)
 * [13 years ago](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/#post-4008156)
 * Just add the following right above the line “// Add your options:”
 *     ```
       jQuery('#metakeyselect').find('option').remove();
       $metakeyselect.append('<option value="#NONE#">— Select —</option>');
       ```
   
 * But seriously – google is your friend here. Consider yourself lucky that I am
   in a great mood today, since you can not expect other people to do all the work
   for you…
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WP3.6 custom fields dropdown with strange behaviour after update](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/)
 *  Thread Starter [cizko](https://wordpress.org/support/users/cizko/)
 * (@cizko)
 * [13 years ago](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/#post-4008155)
 * Oh Daffydd57 – you are killing me here. Please tell me you are not making your
   money with wordpress…. 😛
 * [http://lmgtfy.com/?q=clearing+select+using+jquery](http://lmgtfy.com/?q=clearing+select+using+jquery)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WP3.6 custom fields dropdown with strange behaviour after update](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/)
 *  Thread Starter [cizko](https://wordpress.org/support/users/cizko/)
 * (@cizko)
 * [13 years ago](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/#post-4008154)
 * BTW: If I got my reading right, this is *not a bug* but _intended_ behaviour 
   as of WP 3.6
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WP3.6 custom fields dropdown with strange behaviour after update](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/)
 *  Thread Starter [cizko](https://wordpress.org/support/users/cizko/)
 * (@cizko)
 * [13 years ago](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/#post-4008152)
 * filtering the list or simply resetting it to no content at all can be easily 
   done with jquery…
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WP3.6 custom fields dropdown with strange behaviour after update](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/)
 *  Thread Starter [cizko](https://wordpress.org/support/users/cizko/)
 * (@cizko)
 * [13 years ago](https://wordpress.org/support/topic/wp36-custom-fields-dropdown-with-strange-behaviour-after-update/#post-4008150)
 * I found a solution to this – or more likely a workaround. Append this to your
   theme’s functions.php and adjust the section “Add your options” accordingly to
   fit your needs:
 *     ```
       /**
        * Programatically add custom fields.
        *
        * @see http://wordpress.stackexchange.com/questions/98269/programatically-add-options-to-add-new-custom-field-dropdown/
        */
   
       function wpse_98269_script() {
   
           if (isset($GLOBALS['post'])) {
   
               $post_type = get_post_type($GLOBALS['post']);
   
               if (post_type_supports($post_type, 'custom-fields')) {
   
                   ?>
   
                       <script>
   
                           // Cache:
                           var $metakeyinput = jQuery('#metakeyinput'),
                               $metakeyselect = jQuery('#metakeyselect');
   
                           // Does the default input field exist and is it visible?
                           if ($metakeyinput.length && ( ! $metakeyinput.hasClass('hide-if-js'))) {
   
                               // Hide it:
                               $metakeyinput.addClass('hide-if-js'); // Using WP admin class.
   
                               // ... and create the select box:
                               $metakeyselect = jQuery('<select id="metakeyselect" name="metakeyselect">').appendTo('#newmetaleft');
   
                               // Add the default select value:
                               $metakeyselect.append('<option value="#NONE#">— Select —</option>');
   
                           }
   
                           // Add your options:
                           $metakeyselect.append("<option value='Your_option_1'>Your option 1</option>");
                           $metakeyselect.append("<option value='Your_option_2'>Your option 2</option>");
                           $metakeyselect.append("<option value='Your_option_3'>Your option 3</option>");
                           $metakeyselect.append("<option value='Your_option_4'>Your option 4</option>");
                           $metakeyselect.append("<option value='Your_option_5'>Your option 5</option>");
                           $metakeyselect.append("<option value='Your_option_6'>Your option 6</option>");
   
                       </script>
   
                   <?php
   
               }
   
           }
   
       }
   
       add_action('admin_footer-post-new.php', 'wpse_98269_script');
       add_action('admin_footer-post.php', 'wpse_98269_script');
       ```
   

Viewing 6 replies - 1 through 6 (of 6 total)