Site logo

Archived topic

Block Element Hook section for PHP

3 replies · Started by Mohammed Arif Shaikh on January 1, 2022

Viewing posts 1–4 of 4

Hi,

I am using the below PHP code through the code snippets plugin which is working fine.

add_action( 'wp', 'lh_remove_archive_title' );
function lh_remove_archive_title() {
remove_action( 'generate_archive_title', 'generate_archive_title' );
}

However, I want to reduce the number of plugins I use for my website. I tried the Block Elements Hook section for the above PHP to create the same result that I am getting with code snippets but it's not working.
Can you please confirm if using this PHP is possible with the Block Elements Hook section? If yes, then what should be the options under settings and display rules?

Hi there,

No, you cannot add that PHP To a Block or Hook Element.
It has to be added to either a Child Theme functions.php or via a Code Snippets plugin.

Code is code - so adding the code snippets plugin to add that PHP is not going to make any noticeable performance difference to your site.

Okay, thanks for the reply, David.

You're welcome

This archived topic is closed to new replies.