plugin development – Metabox is not displaying

Question

I am learning plugin development. My code is like below.

<?php

namespace Inc\Admin;


class Admin
{
    public function __construct()
        add_action( 'admin_menu', [$this,'news_meta_boxes'] );
    }


    public function news_meta_boxes()
    {
        add_meta_box('wp_display_settings', __('Display Settings', 'textdomain'), [ $this, 'display_settings_html' ], 'news', 'normal', 'default');
    }
    

    public function display_settings_html($post)
    {
        echo 'hello';
    }

}

?>

But metabox is not showing.

0
Foysal 4 months 2022-07-17T09:27:52-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse