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

Automatically adding meta data to posts or multiple query help

This will query all the ticket posts and update a _ticket_date field. However, I’m not yet sure how to retrieve the actual date, so you’ll have to provide me with a little more information for that. Assuming it works properly I would run the following once, and then remove. You could achieve a similar effect … Read more

Categories custom-post-types Tags array, custom-post-types, post-meta, query

Consolidate Metaboxes into 1 Big Metabox

Register your taxonomies with ‘show_ui’ => false, and then add a single meta box to manage them. function create_book_tax() { register_taxonomy( ‘genre’, ‘book’, array( ‘label’ => __( ‘Genre’ ), ‘rewrite’ => array( ‘slug’ => ‘genre’ ), ‘hierarchical’ => true, ‘show_ui’ => false, ) ); } Or unhook the boxes from the side panel and put … Read more

Categories metabox Tags metabox, post-editor, post-meta, taxonomy

Are multiple values from get_post_meta guaranteed to be ordered?

Yes. get_post_meta() uses get_metadata() which in turn uses update_meta_cache() to retrieve the values. In the source code we see this part (comment mine) // $id_column is ‘meta_id’ $meta_list = $wpdb->get_results( “SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list) ORDER BY $id_column ASC”, ARRAY_A ); So the meta values will be ordered by meta_id … Read more

Categories post-meta Tags post-meta

Sanitizing `wp_editor();` Values for Database, Edit, and Display

wp_kses to the rescue! My Editor Contains everything a Post Might Pass the result through wp_kses_post on the way in and out, and all should be good. Remember, this will strip out anything added by the_content filter, so to preserve oembeds and shortcodes, use this: echo apply_filters( ‘the_content’, wp_kses_post( $content ) ); You might also … Read more

Categories posts Tags custom-field, database, post-meta, posts, sanitization

How can I free up the memory used by update_post_meta?

It turns out that it was due to Query Monitor, a plugin that records info about each query. Every time update_post_meta ran, Query Monitor would store some data about the query, which eventually added up to be more than the server could handle. Running my example code on a default theme like Twenty Nineteen with … Read more

Categories plugin-development Tags cache, memory, mysql, plugin-development, post-meta

Displaying posts with only upcoming dates according their custom field date value

For this to work reliably, the date format in the database should be yyyy-mm-dd. Comparison type should be DATE or NUMERIC. If you take the date of 25-04-2012 in present format and compare it numerically to the date 26-04-1986, you can see what the issue will be: 25042012 < 26041986 ALso- if you’re doing these … Read more

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

How to make custom post meta wp_editor translatable?

it looks as already answered here on stackexchange (really detailed way), as first you can try: add_filter(‘soto_property’,’qtrans_convertURL’); Anyway, have a look here on qtranslate slug plugin, usually it save tons of troubles. And small note – if I were you, I would better use mqTranslate (which is based on qTranslate, but it’s compatible with last … Read more

Categories custom-post-types Tags custom-post-types, post-meta

Order posts according to user defined order for meta values?

My proposed solution is already posted by @cybmeta (+1), but I add it anyway, since it deals with it in a general way 😉 In the same way the WP_Query parameters: ‘post__in’ => [1,2,3], ‘orderby’ => ‘post__in’ give use the custom defined order: ORDERBY FIELD( wp_posts.ID, 1, 2, 3 ) we can define our own … Read more

Categories custom-field Tags custom-field, get-posts, post-meta

Move value of one custom field to another

Here’s the solution update wp_postmeta set meta_key = ‘theme2035_embed’ where meta_key = ‘video’

Categories custom-field Tags custom-field, mysql, post-meta

How to add meta tag to wordpress posts filter?

There is not a standerized way to add HTML meta tags in WordPress but you can use wp_head action as a generic way to add meta tags. I think description meta tag should not be in the theme, as you suggest in your answer, because description meta tag is a property of the document, nothing … Read more

Categories post-meta Tags description, post-meta
Older posts
Newer posts
← Previous Page1 … Page169 Page170 Page171 … Page203 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
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 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