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

How can I convert postmeta from unserialized to serialized?

I would probably take an alternative route and let the serialization happen at the end after the data was already merged like in the example below. So first query meta data for both old keys. Then merge the old data into an array (regular or associative) with post ID as key. Then use the resulting … Read more

Categories post-meta Tags meta-value, post-meta

Two Custom Post Types Many to Many Relationship

Two Custom Post Types Many to Many Relationship

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

Creating user status mode in WordPress

Creating user status mode in WordPress

Categories PHP Tags php, post-meta, user-meta

How to make search include data from wp_postmeta?

If your up for using a plugin, Relevanssi – A Better Search might be worth trying out. The standard (free) version supports searching post meta.

Categories search Tags post-meta, regex, search

How to programmatically customise the Contact Form7 notification email prior to sending? [closed]

This can be achieved by hooking into the process of the notification mail being sent by the CF7 plugin. The plugin provides the ‘wpcf7_mail_components’ filter which allows you to modify the email message prior to it being sent, add_filter(‘wpcf7_mail_components’,’add_mgr_mail’,10,3); function add_mgr_mail($components, $form, $mail_obj){ //if you have several cf7 forms, check this is the right one, … Read more

Categories post-meta Tags plugin-contact-form-7, post-meta

Add a date updated/date modified option using custom fields

Adding a custom field to conditionally display last modified date: You can use the built-in custom fields metabox of your post. Usually it is hidden by default, so you have to enable it going to ‘Screen Options ‘ and checking the ‘Custom Fields’ box like this: If you’re using the new block editor, you’ll find … Read more

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

How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)

There are some points in your code might need to review practically. Here is something you might be interested to update and a method for you to var_dump the process. function validate_attribute_weight( $passed, $product_id, $quantity, $variation_id = null, $variations = null ) { // Get custom field // 1. I am not sure if you … Read more

Categories PHP Tags custom-field, meta-value, php, post-meta, woocommerce-offtopic

How to display singular form of category name?

Not an exact answer for original post’s code setup, but since I came here to answer the same question according to the title I’ll provide my not so elegant solution using ACF (though the same can surely be done with a regular custom field): TO DISPLAY A SINGULAR VERSION OF YOUR CATEGORY NAME (Example using … Read more

Categories categories Tags categories, post-meta

How do I Implement Atomic Update of Post Metadata?

How do I Implement Atomic Update of Post Metadata?

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

How to update custom field in WooCommerce

Okay found it. It was a silly mistake I overlooked. I had 1 attribute (esc_attr($myField)) double inside the update_post_meta() method. So this function works perfectly: function woocommerce_save_fields($post_id) { $myField = $_POST[‘field_name’]; if (!empty($myField)) update_post_meta($post_id, ‘field_name’, esc_attr($myField)); else update_post_meta( $post_id, ‘field_name’, ” ); }

Categories woocommerce-offtopic Tags custom-field, hooks, post-meta, woocommerce-offtopic
Older posts
Newer posts
← Previous Page1 … Page135 Page136 Page137 … 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