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

Add comment_meta to wp_comment_reply

Considering WP hooks capabilities the only way to set extra content here is to reorganize reply/edit form itself, using hooks. An example below demonstrates how to add extra HTML content on “reply” form. Find out “HERE IS YOUR CUSTOM CONTENT” label inside code to check where magic happens. add_filter(‘wp_comment_reply’, ‘test_reply_comment_func’, 10, 2); function test_reply_comment_func($str, $input) … Read more

Categories comments Tags comment-form, comments, post-meta

Is there a way getting post fields using `transition_post_status`

I’m not sure why get_post_field wouldn’t work in this situation, but if you can access $post->ID, you should also be able to get $post->post_title and $post->post_content (and even $post->post_excerpt if it’s there). The $post object includes the standard metadata, like author and publication date. Any metadata in the wp_postmeta table in the database can only … Read more

Categories posts Tags post-meta, post-status, posts, wp-mail

Get Meta Keys of Custom Categories

It sounds like you’re trying to get the category terms for a post. Category terms are not stored in post meta. You can get a post’s terms using get_the_terms(). In this example, $terms will hold an array of term objects for the category taxonomy associated with the current post. You can replace category with your … Read more

Categories categories Tags categories, post-meta

Why is my get_post_meta not properly calling the custom field when attempting to embed a YouTube video?

By default get_post_meta returns an array. If you wish to return a single value you need to set the 3rd parameter to true. Eg. get_post_meta(93, ‘youtubeId’, true); And did you know that your client can just paste a youtube URL into the WordPress editor and it will auto-embed that video? get_post_meta

Categories post-meta Tags embed, post-meta, youtube

Correct meta of Writing Meta Tags

I think you have to check if the loaded page is a post, and use the WordPress loop to get the right data. <?php if ( have_posts() ) { while ( have_posts() ) { the_post(); ?> <meta name=”author” content=”<?php the_author(); ?>” > <meta name=”description” content=”<?php the_content(); ?>” > <?php } } ?>

Categories post-meta Tags headers, post-meta

Using delete_post_meta for deleting multiple selected options

I think it is just a matter of logic. If you don’t select any value, $_REQUEST[‘menu-item-custom-category’][$menu_item_db_id] is empty. So, the next line delete_post_meta() is never triggered in your code. Just think in the logic you need to know when to delete previous meta value. For example: if( !empty( $_REQUEST[‘menu-item-custom-category’][$menu_item_db_id] ) ) { // Delete all … Read more

Categories plugin-development Tags plugin-development, post-meta

how can I show name and value of Custom Fields together?

I think what you’re looking for is concatenation with . <?php $key = “yourkey”; echo $key . “: ” . get_post_meta( $post->ID, $key, false ); ?>

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

Retrieving post meta array (attachment)

Your var_dump looks like it’s returning an array because you’re passing false to get_post_meta(). Also you don’t want to print_r() on an echo line. Retrieve post meta field for a post. $post_id (int) (Required) Post ID. $key (string) (Optional) The meta key to retrieve. By default, returns data for all keys. Default value: ” $single … Read more

Categories post-meta Tags attachments, images, post-meta

How can I update post meta inside a WP_Query loop or the WordPress loop?

The Loop is PHP code used by WordPress to display posts. You can see how a loop is constructed on generatewp.com. // WP_Query arguments $args = array (); // The Query $query = new WP_Query( $args ); // The Loop if ( $query->have_posts() ) { while( $query->have_posts() ) { $query->the_post(); $post = get_post(); if ( … Read more

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

How can I tell if a post has been published at least once?

We can do this by storing the value into postmeta when post is published first time. function save_ispublished( $post_id ) { if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return; $published_once = get_post_meta( $post_id, ‘is_published’, true ); // Check if ‘is_published’ meta value is empty. if ( ! empty( $published_once ) ) { $published_once=”yes”; } // store is_published value … Read more

Categories posts Tags metabox, post-meta, posts, publish
Older posts
Newer posts
← Previous Page1 … Page93 Page94 Page95 … 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