Complete the code to add a function to a WordPress action hook.
add_action('init', [1]);
You need to pass the function name as a string to add_action. So, use quotes around the function name.
Complete the code to define a function that runs on the 'wp_footer' action hook.
function [1]() { echo '<p>Footer text</p>'; } add_action('wp_footer', '[1]');
The function name must be the same in both the definition and the add_action call.
Fix the error in the code to properly add a function to the 'admin_menu' action hook.
add_action('admin_menu', [1]); function add_custom_menu() { add_menu_page('Custom Menu', 'Custom Menu', 'manage_options', 'custom-menu', 'custom_menu_callback'); }
The function name should be passed as a string without parentheses to add_action.
Fill both blanks to add a function with priority 15 and 2 accepted arguments to the 'save_post' action hook.
add_action('save_post', [1], [2], 2);
The function name must be a string, and the priority is set to 15.
Fill all three blanks to define a function hooked to 'the_content' filter that appends text to post content.
function [1]($content) { return $content . [2]; } add_filter('the_content', [3]);
The function name is append_text_to_content, the appended text is a string, and the function name is passed as a string to add_filter.