after_setup_theme is called three times

Hooks and filters can have several Actions attached. Hence the $priority argument. In short: It’s just a big multi dimensional array where the key is the hook/filter name and the values are the attached callbacks plus their priority.

add_action second argument missing

You have to say how many parameters your callback function needs. The default is 1, so WordPress will pass just $a. To get more parameters, use the fourth argument for add_action(): add_action(‘test’, ‘testing’, 10, 2 );

Add a custom text to admin footer in a Custom Post Type page

This should do. Put the following in your functions.php if (in_array($GLOBALS[‘pagenow’], array(‘edit.php’, ‘post.php’, ‘post-new.php’))) add_filter(‘admin_footer_text’, ‘my_custom_footer_admin_text’); function my_custom_footer_admin_text($text) { $post_type = filter_input(INPUT_GET, ‘post_type’); if (! $post_type) $post_type = get_post_type(filter_input(INPUT_GET, ‘post’)); if (‘my_post_type’ == $post_type) return ‘my custom message’; return $text; }

Add sub menu page in your plugin

The add_submenu_page first parameter should be the top menu page handle which in you case is a-qoute so: function a_qoute_admin_action(){ add_menu_page( __(‘Reservations Pages’),// the page title __(‘Donation’),//menu title ‘edit_themes’,//capability ‘a-qoute’,//menu slug/handle this is what you need!!! ‘qoute_settings’,//callback function ”,//icon_url, ”//position ); add_submenu_page( ‘a-qoute’, ‘Donations Log’, //page title ‘Donations Log’, //menu title ‘edit_themes’, //capability, ‘DonationsLog’,//menu slug … Read more

Seems that admin_post_{action} does not executing

It’s simply the wrong endpoint. The admin_post_* hook and its admin_post_nopriv_* counterpart is not fired for any admin page with the appropriate action request variable set, it only triggers for requests hitting wp-admin/admin-post.php. Try https://test.local/wp-admin/admin-post.php?action=test instead. I should add that using admin-post.php for handling plugin actions might not be appropriate. If you wanted to return … Read more

Hook after meta created

There is a dynamic hook right before any new metadata is added: do_action( “add_{$meta_type}_meta”, $object_id, $meta_key, $_meta_value ); It would be add_post_meta for posts accordingly. Note that you might to tinker some to catch this precisely in the case of new post being created, for example hook into publish_post first, note the ID, and add … Read more