Multiple triggers when publishing, saving or updating a post in WordPress
Multiple triggers when publishing, saving or updating a post in WordPress
Multiple triggers when publishing, saving or updating a post in WordPress
I haven’t tested this but you could try and use CF7’s wpcf7_form_hidden_fields and add this to the end of your ipgeolocation() function – then leave the form tag function as is but replace the hardcoded value with $country. // Update Contact Form 7 hidden field add_filter( ‘wpcf7_form_hidden_fields’, function( $hidden_fields ) use ( $country ) { … Read more
Yes, there is — use a meta_query with 2 clauses, one which selects posts having the meta, and the second clause with a ‘compare’ => ‘NOT EXISTS’ which selects posts without that meta. So in your $args array, just replace the ‘meta_key’ => ‘pld_like_count’ with this one: ‘meta_query’ => array( // make sure it’s OR … Read more
Match submitted array fields with the MYSQL database fields to update them correctly in PHP
This might work, not tested though. First add this to join the postmeta table: add_filter( ‘posts_join’, ‘search_filters_join’, 501, 2 ); function search_filters_join( $join, $query ) { global $wpdb; if ( empty( $query->query_vars[ ‘post_type’ ] ) || $query->query_vars[ ‘post_type’ ] !== ‘product’ ) { return $join; // skip processing } if ( ($this->is_ajax_search() || $this->is_search_page()) && … Read more
I have no idea what a ‘block number’ is, but when themes output the date for a post they will use either the_date() or the_time() (or both). You can replace the output using the filters the_date() or the_time(): add_filter( ‘the_date’, function( $the_date, $format ) { $block_number=”whatever a block number is”; return $block_number; }, 10, 2 … Read more
Neither will be faster because the root of the performance problem is the WP table design, not the plugin. The post meta table is optimised for finding values when you already know the post ID/keys, it’s not designed for searches, though there are mitigations. Searches/grouping/finding is what the taxonomy tables were created for. Finding all … Read more
Here’s the function responsible for rendering the comments quick edit form: wp_comment_reply. Looking at its code, it seems you can short-circuit it using the wp_comment_reply filter. That only lets you start from scratch though (e.g. you can’t add to the existing form). The only way around this that I can think of is some (unholy) … Read more
How to add an ACF only for parent term?
How do you create a front end form that enables the editing of member-specific custom fields in WordPress?