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

Access post meta just after publishing

Here is the description of transition_post_status from the codex: This function’s access is marked as private. That means it is not intended for use by plugin and theme developers, but only in other core functions. It is listed here for completeness. Use any of these functions instead. Why not use the publish_post action instead? There … Read more

Categories hooks Tags hooks, post-meta, publish

WP Meta Query for some meta (array) values

Fields in database tables can not contain other types of data than text strings and numbers, and variations of them like dates and times. The field meta_value of wp_postmeta is a text field. So, when you store an array as meta_value you are really storing a string containing the serialized data that represents the original … Read more

Categories wp-query Tags array, meta-query, post-meta, wp-query

How to display custom post meta in the appearance->menus page

The menu items boxes are created by the class Walker_Nav_Menu_Edit in wp-admin/includes/nav-menu.php. Thus to alter those boxes you’ll have to make your custom Walker I guess. But if you mean adding the new value to the nav menu meta-boxes (the boxes to the left side of the page) this will do the job: The function … Read more

Categories menus Tags admin, menus, post-meta

Updating post meta for custom post types

I really like your clean class structure ๐Ÿ™‚ But I have a suggestion that might fix things (based on my experience with nonces and meta boxes from a plug-in I built last weekend): Don’t try to create the nonce field manually. You currently have: $nonce = wp_create_nonce( plugin_basename( __FILE__ ) ); … <input type=”hidden” name=”argus_edit_visitor” … Read more

Categories plugins Tags custom-post-types, customization, plugin-development, plugins, post-meta

Ordering posts by anniversary using only day and month

No, it’s not possible by using pre_get_posts alone. But you don’t have to use separate fields for the date. WP_Query, although doesn’t provide a simple query arg that would sort the posts by month and day only, you can use the posts_orderby filter hook to modify the ORDER BY clause (i.e. ORDER BY <the part … Read more

Categories custom-field Tags custom-field, date, meta-query, order, post-meta

WordPress altering my custom query, How to fix it?

Your code should work in theory. Your failure is not caused by the code in your question but rather due to external factors. Something else is causing this failure DEBUGGING THIS ISSUE Turn on debug and check for obvious errors and warnings. This should be a good indication on the soundness of all your code … Read more

Categories wp-query Tags custom-field, menu-order, meta-query, post-meta, wp-query

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

Show the “ratingValue” and “ratingCount” values โ€‹of KK Star Ratings Plugin

Here is what I found that might help you. I did some test by myself and here is snippets for you to use. Add the following code to functions.php file: //Getter methods //this will return the base best score like 5 or 10. function get_best_rating(){ return max((int) get_option(‘kksr_stars’), 1); } //This will return the rating … Read more

Categories plugins Tags json, plugins, post-meta, rating

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

Comparisson between date() and a date from wp_postmeta

In the meta_query arguments, try changing your ‘type’ => ‘CHAR’, to ‘type’ => ‘DATETIME’, You can opt for any one of these, depending your needs: type (string) – Custom field type. Possible values are ‘NUMERIC’, ‘BINARY’, ‘CHAR’, ‘DATE’, ‘DATETIME’, ‘DECIMAL’, ‘SIGNED’, ‘TIME’, ‘UNSIGNED’. Default value is ‘CHAR’. But wait! There’s more! ๐Ÿ˜‰ It seems that … Read more

Categories plugins Tags meta-query, plugins, post-meta, wp-query
Older posts
Newer posts
← Previous Page1 … Page178 Page179 Page180 … Page204 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