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

Running a function on post update with new post meta

Please try using acf/save_post action that will hook in after ACF data has been saved. add_action(‘acf/save_post’, ‘check_values’); function check_values($post_id){ if(get_field(‘status’, $post_id ) == “closed”) { sendSMS(); } }

Categories theme-development Tags advanced-custom-fields, post-meta, theme-development

How to select a paragraph other than the 1st to be the post’s excerpt?

In WordPress using the Gutenberg Block Editor, in the control panel to the right, you have an excerpt box: In the Classic Editor you have a metabox under the main post content area: If you don’t see it there, go to the top of your screen, on the right under the WP Admin Bar, click … Read more

Categories plugins Tags description, excerpt, plugins, post-meta

if in category but only with post meta

It looks like you just have an operator precedence issue. Your logic here will always return true if $stat == ‘Sold Stat’ regardless of the result of in_category(‘secret-category’). Try this, the extra parenthesis will force the || statement to be evaluated separately: if (in_category(‘secret-category’) && ($stat == ‘NFS Stat’ || $stat == ‘Sold Stat’)) { … Read more

Categories posts Tags categories, custom-field, customization, post-meta, posts

get_post_meta not working when variable used for post ID

If you’re hooking into publish_post, that fires before meta is ready. Either get the meta from the POST object, or use a different hook – possibly update_post_meta.

Categories post-meta Tags post-meta

WooCommerce order refund get qty refunded

I was looking for a solution to the same problem – I couldn’t find any help with this online but I was able to figure it out myself, so for anyone else here is the solution: Change the hook from woocommerce_order_refunded to woocommerce_order_partially_refunded. This will only fire when an order is partially refunded. If you … Read more

Categories woocommerce-offtopic Tags post-meta, woocommerce-offtopic

Values from meta-box not on $_POST

I get returned on the very first conditional Are you sure? Because it seems to me that it’s likely the second one which verifies the nonce. if ( ! wp_verify_nonce( $_POST[‘_hgod_fichas_mb_nonce’], ‘_hgod_fichas_mb_nonce’ ) ) { return; } But even if the first conditional is also exiting the function, you should know that the second parameter … Read more

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

$post->post_meta not pulling any post in wordpress/php

Your code is interfering with the internal structure of WP_Query and WP_Post, and making assumptions about how it works. This is extremely unusual, and not best practice when developing with WordPress. Case in point, officially there is no post_meta member variable on that class ( https://developer.wordpress.org/reference/classes/wp_post/ ). That’s not how you fetch a posts meta … Read more

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

Adding custom meta boxes to specified custom post type

The fourth parameter is $screen, which in your case is set to post, so all you have to do is specify the website post type instead: function website_add_meta_box() { add_meta_box( ‘website-website’, __(‘Website’, ‘website’), ‘website_html’, ‘website’, ‘normal’, ‘default’ ); } Documentation here: https://developer.wordpress.org/reference/functions/add_meta_box/ As an aside, your save_post hook applies to any post or custom post … Read more

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

How is the author’s name given a different color?

You wrote .comment-list but that’s not the class, it’s .commentlist. You may also need to target the anchor link inside that tag explicitly to override link colours

Categories post-meta Tags author, comment-meta, comments, post-meta, wp-comment-query

What are the meta fields for an attachment?

You can easily inspect all the metadata for any post like so: // 123 is the (attachment) post ID var_dump( get_post_meta( 123 ) ); And in a default WordPress setup with no plugins or theme which add custom metadata to the image attachment post, the metadata you’d get are: _wp_attached_file — string, the image file … Read more

Categories functions Tags attachments, functions, images, post-meta
Older posts
Newer posts
← Previous Page1 … Page101 Page102 Page103 … 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