groundhogg/admin/init

πŸ“… Published on

πŸ“ Last updated

Documentation

Β»

Action Hooks

Β»

groundhogg/admin/init

Fires when the Groundhogg admin menu is initialised. This is the correct place to register new admin pages or add items to the Groundhogg menu.

do_action( 'groundhogg/admin/init', $admin_menu );

You will receive the Admin_Menu manager instance.

Example

add_action( 'groundhogg/admin/init', 'my_extension_register_admin_page' );

/**
 * Register a custom admin page under the Groundhogg menu.
 *
 * @param \Groundhogg\Admin\Admin_Menu $admin_menu
 *
 * @return void
 */
function my_extension_register_admin_page( $admin_menu ) {
    $admin_menu->add_page( new My_Extension_Admin_Page() );
}

Was this helpful?

Let us know if this document answered your question. That’s the only way we can improve.