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 concatenate variables to search results title? [closed]

Please try to use following code add_filter( ‘aws_title_search_result’, ‘my_aws_title_search_result’, 10, 3 ); function my_aws_title_search_result( $title, $post_id, $product ) { $text1 = get_post_meta( $post_id, ‘_tyre_size_field’, true ); $text2 = get_post_meta( $post_id, ‘_load_speed_field’, true ); $text3 = get_post_meta( $post_id, ‘_tyre_brand_field’, true ); $text4 = get_post_meta( $post_id, ‘_brand_model_field’, true ); $text5 = get_post_meta( $post_id, ‘_run_flat_field’, true ); if … Read more

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

Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)

You did some mistakes that I have described below: First thing you have placed jQuery Ajax code on the wrong place. On ajax callback function variable name mashup like $post_id defined and used on update time $post_ID; PHP is case sensitive so it considers 2 different variables. In some places, not closed } brackets. Here … Read more

Categories plugin-development Tags ajax, custom-field, plugin-development, post-meta

Remove empty terms from array, sort alphabetically, update back to repeating field

$boat_safety_terms_cleaned_sorted = sort( $boat_safety_terms_cleaned ); error_log( print_r( $boat_safety_terms_cleaned_sorted, TRUE ) ); PHP’s sort accepts an array reference and sorts in-place, and returns success or failure – hence the 1 you’re getting. You want: sort( $boat_safety_terms_cleaned ); error_log( print_r( $boat_safety_terms_cleaned, TRUE ) ); Also, I’m assuming I’ll want to use update_post_meta to save the array back … Read more

Categories PHP Tags array, php, post-meta

Filter for author list in gutenberg core editor

The component post-author uses getAuthors() to get the authors, this functions calls the REST API. export function* getAuthors() { const users = yield apiFetch( { path: ‘/wp/v2/users/?who=authors&per_page=-1’ } ); yield receiveUserQuery( ‘authors’, users ); } So you can only filter via the REST API filter rest_user_query, but this can have effects on other plugins which … Read more

Categories filters Tags block-editor, filters, post-meta

Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS

Have you tried using: setImage: function( image_url, image_id ) { dispatch( ‘core/editor’ ).editPost( { meta: { ‘og_image_url’: image_url, ‘og_image_id’: image_id } } ); } Instead of using a generic setMetaValue function?

Categories plugins Tags block-editor, plugin-development, plugins, post-meta, posts

Duplicate rows in meta table, any known relations in WC?

What you propose would break a lot of plugins and internals of WordPress. Post meta keys are not unique. This is supported at the API level too: // on save… add_post_meta( $post_id, ‘lead’, ‘Tom’ ); add_post_meta( $post_id, ‘member’, ‘Bob’ ); add_post_meta( $post_id, ‘member’, ‘Janet’ ); add_post_meta( $post_id, ‘member’, ‘Alice’ ); add_post_meta( $post_id, ‘member’, ‘David’ ); … Read more

Categories post-meta Tags post-meta, sql, table

Gutenberg featured image checkbox – checkbox not correctly set on editing page reload

I think the problem might be that the spread operator is missing in a couple of places. This line: return { meta: { currentMeta, editedMeta }, }; in withSelect should be: return { meta: { …currentMeta, …editedMeta }, }; This makes the meta object be a copy of currentMeta (have all the same properties and … Read more

Categories post-meta Tags block-editor, post-meta, post-thumbnails

WP_Query of custom post type sorted by meta_key has unexpected results

I think the issue is that it’s being interpreted as a STRING type and being ordered character by character. Maybe try turning this into a meta query and forcing the DATETIME type like the example shown below: ‘meta_query’ => array( ‘starttime’ => array( ‘key’ => ‘start_time’, ‘type’ => ‘DATETIME’, ) ), ‘orderby’ => array( ‘starttime’ … Read more

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

Update post meta dynamically

Basically, you’re not properly using array_push(). array_push() modifies the original/input array which is passed by reference to the function and it returns the new number of elements in the array. So with add_post_meta( $groupItem->ID, $meta, array_push( $user_ids, 26 ) ), you’re actually setting the meta value to the number of items in $user_ids and not … Read more

Categories post-meta Tags post-meta

Looping inside block return

Well, just change this: el( ColorPalette, { value: props.attributes.paletteData[0], onChange: updatePalette, } ) to this: el( ‘div’, {}, props.attributes.paletteData.map( function ( value, i ) { return el( ColorPalette, { ‘value’: value, onChange: updatePalette, key: ‘color-‘ + i, // required //… } ); } ) ) I.e. Pass an array of elements as the third parameter: … Read more

Categories custom-field Tags block-editor, color-picker, custom-field, post-meta
Older posts
Newer posts
← Previous Page1 … Page100 Page101 Page102 … 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