0
votes
1answer
28 views

How to get menu location in wp_update_nav_menu hook

I want to get the menu location in the wp_update_nav_menu (during menu save action) add_action('wp_update_nav_menu', function ($id, $data = NULL) { error_log( var_export($data, true) ); ...
2
votes
2answers
37 views

What's the earliest point I can get the queried object ID?

I'm writing a supplement plugin to Wordpress Mobile Pack because I would like to use the default theme on pages that are assigned a certain page template. My plugin will only deal with the mobile ...
2
votes
1answer
99 views

Check php version before theme activation

I've got theme that requires php 5.3+ version. If older - fatal error occurs with it. So what I need to do when user try to activate this theme is to check php version before going into theme code ...
1
vote
2answers
66 views

Which hook callback has priority if both plugin and theme use the same hook?

If a theme and a plugin uses the same action hook, for example comment_form is used by both theme and plugin. Then , which one will be called first? the function associated with the theme's hook or ...
0
votes
2answers
94 views

How to remove the option data of a theme when that theme is removed?

I developed a theme which stores some options to the database. I want to delete the option data from the database while the user removes the theme. But I don't know there is any action hook for doing ...
1
vote
1answer
2k views

add_action in functions.php, do_action in plugin?

I am trying to set an add_action function in my currently active WordPress theme functions.php file, for a defined do_action function within an activated WordPress plugin. The add_action function in ...
0
votes
1answer
450 views

How to display message (with switch_theme hook) after deactivating My theme?

I'm able to display a message by activation of my theme with the 'new' after_switch_theme hook this way: function themeActivationFunction($oldname, $oldtheme=false) { $msg = ' <div ...
9
votes
4answers
2k views

after_setup_theme always runs

I am setting up a child theme for some of my faculty members, and as a part of the theme, I would like a handful of plugins to be activated at the time that the theme is activated. So, naturally, I ...
2
votes
1answer
2k views

How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?

How can I remove "Proudly powered by WordPress" from twentyeleven without modifying footer.php, and without creating a child theme? I'm looking for a php command, such as add_action, remove_action, ...
0
votes
1answer
331 views

Fix warning: Missing argument

i want to submit a theme to the wordpress.org. when i put the define('WP_DEBUG', true); in my wp-config.php. my theme showed some errors.but i don't know how to correct theme. Q1:Warning: Missing ...
0
votes
1answer
101 views

How to make a function occurs for one time?

I have the following code in the functions.php file in my theme function my_func(){ echo "foo"; } add_action('admin_menu','my_func'); I assume this function "my_func" will be ...
11
votes
3answers
1k views

get_template_part vs action hooks in themes

It seems to me both of these afford the opportunity for the end user to modify a theme without actually editing the themes files (via child themes). My question is, is one method preferred over the ...