mazher ul haq
mazher ul haq

Reputation: 45

can we add add_action('admin_init','myfunction') in wp-includes/functions.php

I have a question regarding add_action, can i able to add add_action in functions.php that is wp-includes/functions.php

add_action('admin_init','myfunction');

Upvotes: 1

Views: 510

Answers (2)

Mark
Mark

Reputation: 3035

Don't put it in wp-includes for the reasons rrikesh states. You're just going to the code on update.

If you have a lot of themes within which you want common functionality, make them children of a parent theme.

The parent can hold all the common code in its own functions.php file and the children will be able to use it.

Review the codex for information on Child Themes and how to implement them.

Upvotes: 0

RRikesh
RRikesh

Reputation: 14381

You can, but you should not since all your modifications will be overwritten when you upgrade wordpress. Use your theme's functions.php instead.

Upvotes: 1

Related Questions