How to pass value to add_filter wpcf7_form_tag from another function?

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

In WordPress how do you remove render-blocking CSS manually without a plugin?

For example I have a render-blocking CSS with this URL according to PageSpeed Insights: https://groupcbm.com/wp-content/themes/deon/assets/css/grid.min.css?ver=6.2, how do I deque and deregister this? Locate where in the theme it registers and enqueues this file Once located, note down the handle it uses Remove it, by calling wp_dequeue_style or wp_dequeue_script in a theme/plugin/etc make sure your dequeuing … Read more

Search custom post type posts only by meta fields?

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