Try to search your question here, if you can't find : Ask Any Question Now ?

add_menu_page need help as it should work

HomeCategory: stackoverflowadd_menu_page need help as it should work
Avatarwillson asked 3 months ago

Since a week ago as an amateur at making my own custom plugins I wanted to make a settings page for my plugin.
After using some examples that should work on wordpress I am not having much success.
A sub page works just fine but I want it to be a top level menu the only reason I can think of why this is not working is because of some access rights issue? (happend before).

So if someone could help me with this would be nice.
Thanks in advance

I am not sure if I may link other sites/sources but here I go

The link below has the working example of a sub page
https://wisdmlabs.com/blog/create-settings-options-page-for-wordpress-plugin/

As for the other example I am working with that should work just fine is this
https://wpshout.com/wordpress-options-page/

<?php


add_action( 'admin_menu' , 'Counter_Opties_pagina_aanmaken');

function Counter_Opties_pagina_aanmaken(){
    $page_title = 'Counter';
    $menu_title = 'Counter Opties';
    $capability = 'edit_posts';
    $menu_slug  = 'Counter_pagina';
    $function   = 'Counter_pagina_inhoud';


    add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function );

}

function Counter_pagina_inhoud(){

    include 'Counter-Opties-file.php';

    }

This should generate at least the ‘Counter Opties’ in the sidebar of wordpress backend.

1 Answers
Best Answer
AvatarFernando answered 3 months ago
Your Answer

2 + 14 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com