How to apply_filter / add_filter within 2 others (simultaneous?) add_filter

The ll/tracking_args filter is called by the track_conversion() method, and this function is added to the execution in the constructor of the CustomGF class. The GFChild class has its own constructor, so the constructor of the base class CustomGF is not executed. In the GFChild constructor also add track_conversion() function to ll/tracking_args filter or call … Read more

add_filter – create_function pb in PHP8

In general create_function should be replaced with a closure, like this: add_filter(‘excerpt_more’, function() { return “”; }); But in your specific case, you don’t even need that. WordPress has you covered already with a built-in function to use in a filter: __return_empty_string(). So you can just write: add_filter(‘excerpt_more’, ‘__return_empty_string’ );

How to change content hash value, within the_block_template_skip_link action?

If remove_action( ‘wp_footer’, ‘the_block_template_skip_link’ ) did not work, then try with remove_action( ‘wp_enqueue_scripts’, ‘wp_enqueue_block_template_skip_link’ );, or both of that. (see source on GitHub) As for changing the href value, I’m not aware of any (filter) hook to do that, but you can either edit your template and set the <main>‘s id value to content-top, or … Read more

posts_results filter – additional sort, with a meta value, to move posts to the end of the results, with pagination working

Okay, so why doesn’t this work: The Filter you are using is the posts_results, which is a filter that is applied AFTER the Results are retrieved from the database. Which has the problem that you are describing: Ordering happens on a page-per-page basis. What you want to do is add an order TO the SQL-Query, … Read more

Remove rel=”ugc” from links in comments

The rel=ugc is added by a default filter on pre_comment_content. You can disable this by adding the following line to your functions.php: remove_filter (‘pre_comment_content’, ‘wp_rel_ugc’, 20); This may not be wise. If at some point you change your mind, you would have to go through all comments to add it. It is problably better to … Read more

How can I conditionally add the filter option_home?

Assuming that if wp_sitemaps_enabled has a filter and it has that because we wanted to set it to false, otherwise it defaults to true for public sites. So I would just use and check whether it is filtered or not: add_filter( ‘wp_sitemaps_enabled’, ‘__return_false’ ); if (has_filter( ‘wp_sitemaps_enabled’) === true) { add_filter(‘option_home’, ‘any_callback_function’); } else { … Read more