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

How to use filter in this situation, can not modify the structure using filter

So you’re trying to call the hide_empty_fields() and maybe_add_disclaimer_and_courtesy() methods in the Register_Impress_Shortcodes class, from within a global function, and it’s not impossible to call class methods from within such global functions, but you cannot use $this in your function because $this is only available from within a class method which is called from within … Read more

Redirect to Multisite site 2 if site 1 has a setting

If you are implementing a global functionality for your entire multisite/sub-sites like what you describe, you should implement this as mu-plugins instead adding the cuztomization inside a theme file, just create a file like in wp-content/mu-plugins/GlobalConfig.php which holds the customization you want and will take effect globally, unless you want this customization for only specific … Read more

Change CPT Edit Target Link for Admin List

Issue-1: edit_post_link() is a template function, to be used in theme template files. It’s not used in the Admin pages. So you’ll not get the edit_post_link filter hook for the Admin list pages. Issue-2: get_edit_post_link() function however, is used in Admin list pages. So you’ll get the get_edit_post_link filter hook for the Admin list pages. … Read more

Is there any filter or action hook to remove layout classes from appearing in my templates?

You may use the following code (either in your active theme’s functions.php file or in a custom plugin): // This line is preferably be added to your theme’s functions.php file // with other add_theme_support() function calls. add_theme_support( ‘disable-layout-styles’ ); // These two lines will probably not be necessary eventually remove_filter( ‘render_block’, ‘wp_render_layout_support_flag’, 10, 2 ); … Read more