• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Wordpress

Wordpress World

  • Submit
  • Disclaimers
  • About
  • DMCA
  • Privacy Policy
  • Contact

You are here: Home / Get_term_meta() always returns false

Get_term_meta() always returns false

September 27, 2019 by wordpress.stackexchange.com

I added an extra field (dropdown list with select options), when the user creates or edits a category from the WordPress dashboard. I am also able to store the selected value in the wp_termmeta table. However, I need to display the selected value from the dropdown list after page refresh. I am using the functions get_term_meta() and update_post_meta(), however get_term_meta() always returns false and I cannot assign a selected value for any of the options: function changePostOrder(){ $post_order = get_term_meta($_POST[‘tag_ID’], ‘post-order’, true); var_dump($post_order); // $post_order returns false, while it should return oldest or newest ?> <tr class=”form-field”> <th scope=”row” valign=”top”><label for=”post-order”><?php _e(‘Post Order’); ?></label></th> <td> <select name=”post-order” id=”post-order”> <option <?php if ($post_order == ‘oldest’) { ?>selected=”true” <?php }; ?>value=”oldest”>oldest</option> <option <?php if ($post_order == ‘newest’) { ?>selected=”true” <?php }; ?>value=”newest”>newest</option> </select> </td> </tr> <?php } add_action ( ‘edit_category_form_fields’, ‘changePostOrder’); As a result, after page refresh the dropdown list is again the same (oldest is selected), even though in the database the meta_value column is “newest”. Am i doing something wrong? I am using the same approach as suggested in the second answer here.


  • Zion Williamson getting tested, but return to bubble unknown
  • WNBA gets boost from return of some big-name stars
  • Fact check: Trump falsely suggests kids don't transmit coronavirus and that US case surge is due in part to protests and Mexican migration
  • Fact check: At his first coronavirus briefing since April, Trump repeats a handful of classic false claims
  • Trump's return to fronting virus briefings is too little, too late
  • 'Things could get very ugly': Experts fear post-election crisis as Trump sets the stage to dispute the results in November
  • Indian Pharma Glenmark Denies 'False Claims, High Price' Allegations on Its COVID-19 Drug FabiFlu
  • Senators accuse White House of belittling pandemic by ignoring long-term effects of Covid-19 infection
  • Trump makes false claims about his swing state polling
  • Michael Cohen sues Attorney General William Barr for retaliation in latest attempt to get out of prison
Get_term_meta() always returns false have 400 words, post on wordpress.stackexchange.com at September 27, 2019. This is cached page on Wordpress. If you want remove this page, please contact us.

Filed Under: Tags what do you get back on tax returns, what do you get back on tax return, how to get more on tax return, how to get more money on tax return, short term investment plans with high returns, how to get past years tax returns, how to get bigger tax return, how to get tax return transcript, how to get 2014 tax return, getting false teeth, do you get fica back on tax returns, h&r block get copy of tax return, get tax return transcript, where can i get my tax returns, cost of getting false teeth, return of premium term life insurance, where to get copy of tax return, irs get copy of tax return, getting long term care insurance, get term life insurance

Primary Sidebar

RSS Recent Stories

  • Remove unwanted elements for a wp_nav_menu
  • Get_term_meta() always returns false
  • How to ask WordPress to generate XHTML?
  • Get user count based on multiple meta key values?
  • 21 Best Coffee Shop Themes for WordPress (2019)

Sponsored Links

  • Today’s Kathie Lee Gifford says in new book she lost virginity on wedding night to first husband in ‘sexless marriage’
  • Fast & Furious co-stars Dwayne The Rock Johnson and Tyrese Gibson end years-long feud after ‘talking for four hours’
  • I’m A Celebrity star Giovanna Fletcher’s son, 2, falls asleep holding a picture of her in camp in heartbreaking moment
  • Do not resuscitate orders might have been put in place without consent, watchdog says
  • ‘Singing and dancing to their deaths’: football’s forgotten tragedy
Copyright © 2021 Wordpress. Power by Wordpress.