plugin development – Admin Menu for New Post


I am learning WordPress Plugin development. I would like to add a Admin Menu to Create a New Post like below.

enter image description here

My code is like below.

public function admin_menu() {
    add_menu_page( 'News Information', 'News Info', 'manage_options', 'news_info', [$this, 'api_key_page'], 'dashicons-info-outline', 30 );
    add_submenu_page( 'news_info', 'News Information', 'API Key', 'manage_options', 'news_info_page', [$this, 'api_key_page'], 0 );
    add_submenu_page( 'news_info', 'News Information', 'Add News', 'manage_options', 'news_info', 'call_back_function', 1 );

What should I put inside call_back_function ? Is it the right way to create Admin Menu ?

Foysal 4 weeks 2023-01-13T07:50:17-05:00 0 Answers 0 views 0

Leave an answer