Title: Plugin is missing some code for ordering by meta_key
Last modified: August 21, 2016

---

# Plugin is missing some code for ordering by meta_key

 *  [mmx0](https://wordpress.org/support/users/mmx0/)
 * (@mmx0)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/plugin-is-missing-some-code-for-ordering-by-meta_key/)
 * I added some lines into your code to fix the orderby meta_key feature.
    around
   line 45 in index.php I added: $instance[‘meta_key’] = addslashes(strip_tags($
   new_instance[‘meta_key’])); AND then around line 100 you had the wrong key for
   the “order_by” index
 * I changed to this:
    if(($instance[‘orderby’] == ‘meta_value’ || $instance[‘orderby’]
   == ‘meta_value_num’)
 * [http://wordpress.org/plugins/latest-custom-post-type-updates/](http://wordpress.org/plugins/latest-custom-post-type-updates/)

The topic ‘Plugin is missing some code for ordering by meta_key’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/latest-custom-post-type-updates.svg)
 * [Latest Custom Post Type Updates](https://wordpress.org/plugins/latest-custom-post-type-updates/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/latest-custom-post-type-updates/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/latest-custom-post-type-updates/)
 * [Active Topics](https://wordpress.org/support/plugin/latest-custom-post-type-updates/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/latest-custom-post-type-updates/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/latest-custom-post-type-updates/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [mmx0](https://wordpress.org/support/users/mmx0/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/plugin-is-missing-some-code-for-ordering-by-meta_key/)
 * Status: not resolved