add_menu_page does not seem to work in a class

From add_menu_page in Codex: Note: If you’re running into the “You do not have sufficient permissions to access this page” error, then you’ve hooked too early. The hook you should use is admin_menu. admin_init is too early to hook add_menu_page, use admin_menu.

Associating custom submenu item with post type of top level menu item

You need the information about the current post type in your callback function that renders the submenu page output. And at this point there is a lot of information ready: add_action( ‘admin_menu’, ‘wpse_60730_demo_submenu’ ); /** * Register sub menu pages. * * Note that get_current_screen() is still NULL now. * * @wp-hook admin_menu * @return … Read more

Where is the submitted $_POST array stored after an option page submission?

You only need one callback function, as defined in your call to register_setting() (Codex ref.): register_setting( $option_group, $option_name, $sanitize_callback ); Thus, all options are contained in an array, in a single database entry, $option_name. Then, the callback function is passed the $input variable that holds all of the form-submitted data, the function manipulates/sanitizes those data, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)