0

I have issues with add menu page it doesn't show my custom Icon.

class V {
    
    function __construct()
    
    {
        add_action('admin_menu',array($this,'add_plugin_menu'));

    }
    
    function add_plugin_menu(){ 
    
    include( 'Includes/Function/Menu.php' );
    
    }

in my menu.php I used this code :

add_menu_page(
    'V Menu',
    'V Menu',
    'manage_options',
    'custom_page',
    'custom_page_N1',
    plugins_url('/Includes/Images/Icon.png',__FILE__),
    4
    );

I try change sub folders or using (plugin_dir_url( FILE ).'/Includes/Images/Icon.png') but it didn't worked.

  • What is the file structure of your plugin? Where is menu.php relative to your icon image, and to the main plugin file? – Jacob Peattie Jul 6 at 13:14
  • @JacobPeattie its class . I'm calling menu.php to load in my plugin ok ? in menu.phop I'm calling for image to load plugins_url('/Includes/Images/Icon.png',FILE) and after that both of them show in my plugin page I don't get it what do you mean by relative to the main plugin they are not separate pages but I have menu that is load in plugin page – vivanred Jul 6 at 13:31
  • You're not answering my question. Where are the files? What folders etc. – Jacob Peattie Jul 6 at 13:56
  • @JacobPeattie I'm sorry I did't get exactly what do you mean. plugins\V\Includes\Function\Menu.php and image is inside plugins\V\Includes\Images\Icon.png the main class file is in root of the plugin . – vivanred Jul 6 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.