Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

post-meta

update_post_meta() not working when used with WordPress action

So I installed the Yoast SEO plugin, and tested your code, and now I can positively say “neither no nor yes, but you could” to this question: Please help not sure whether I should use this along with transition_post_status transition_post_status is fired before the wp_insert_post action is fired, and the Yoast SEO plugin is actually … Read more

Categories post-meta Tags post-meta, post-status

How do I access post meta data when publishing a new post in Gutenberg?

The solution is to use a different hook which fires after post meta data has been saved by Gutenberg to the WP API. After reading this related discussion on Github and inspecting this code by n7studios, I discovered that rest_after_insert_post is a hook to use. So, the way to reliably check for the existence of … Read more

Categories post-meta Tags block-editor, post-meta

Short of raw SQL, can I query for multiple attachment metadata that have a given array key?

While you can do this with WP_Query, I’d do this the way you are trying to avoid– save a list in a separate key. The “pros” strongly outweigh the “cons” in my mind. LIKE queries with wildcards, especially with leading wildcards, are not efficient– aka, “slow” and a LIKE query on serialized data is going … Read more

Categories post-meta Tags attachments, post-meta, wpdb

Exclude a category from the filed under list

I have found an answer at this article entitled “Excluding Categories from the_category();”: function the_category_filter($thelist,$separator=” “) { // list the IDs of the categories to exclude $exclude = array(4,5); // create an empty array $exclude2 = array(); // loop through the excluded IDs and get their actual names foreach($exclude as $c) { // store the … Read more

Categories post-meta Tags genesis-theme-framework, post-meta, terms

adding a URL to a post meta

Use another custom field with the URL and call it something like leetpress_website_url then change your code to this: <?php if ( get_post_meta( $post->ID, “leetpress_website”, true ) ){ echo ‘<div class=”pros”><p><strong>Movie Website: </strong><a href=”‘ . get_post_meta( $post->ID, “leetpress_website_url”, true ).'”>’ . get_post_meta( $post->ID, “leetpress_website”, true ) . ‘</a></p></div>’; } ?>

Categories post-meta Tags post-meta

get_post_meta / update_post_meta array

You’re calling get_post_meta() in two different ways: the first, leaving $single unset (it defaults to false) will get you the full array of meta entries for the given key; the second, setting $single to true, will get only the first item with that key. What you want, I believe, is an array of user IDs … Read more

Categories post-meta Tags post-meta

Can’t translate the post meta data (Date) in another language

You don’t need to change any code. get_the_date without an argument will use the date_format option in your WordPress settings. The option F j, Y will substitute F as “September”, but if you have a translation of “September” it will be used. Comments have suggested the use of date_i18n. This is used automatically when you … Read more

Categories post-meta Tags localization, post-meta, translation

What action hook updates post meta?

wp_update_post isn’t used for updating custom fields (ie postmeta content) – you should use update_post_meta

Categories post-meta Tags post-meta, wp-update-post

How to store post meta in an array?

From codex: $meta_value (mixed) (required) The value of the custom field you will add. An array will be serialized into a string. Default: None So <?php add_post_meta(7, ‘fruit’, ‘banana’, ‘apple’, ‘tornado’, ‘bob saget’) To grab them you can also use http://codex.wordpress.org/Function_Reference/get_post_custom_values besides just get_post_meta.

Categories post-meta Tags array, post-meta

Can I safely delete a record, manually, in the wp postmeta table?

It’s unclear what the postmeta actually does so it could effect your website in any number of ways.At best it will just clear the field / option and the user will need to re-enter it for that specific page.At worst it could change a pages layout or orphan a media file in your media library … Read more

Categories post-meta Tags post-meta
Older posts
Newer posts
← Previous Page1 … Page44 Page45 Page46 … Page51 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress