Getting error of unexpected output during activation

You have the same username as the plugin author? o.O The error comes from line 444: There’s two characters between ?> and the next <?php Change: add_action( ‘admin_menu’,’business_hours_menu’ ); ?> <?php add_action( ‘widgets_init’, ‘lordlinus_businesshour_load’ ); To: add_action( ‘admin_menu’,’business_hours_menu’ ); add_action( ‘widgets_init’, ‘lordlinus_businesshour_load’ );

Updating Style From WP Options Setting Page

I think you have to solve this with jQuery. If checked -> addClass, if not -> removeClass. Here’s how to enqueue your JS file: add_action(‘admin_menu’, ‘fwds_plugin_settings’); function fwds_plugin_settings() { $hook = add_menu_page( ‘Price Display’, ‘Price Display’, ‘add_users’, ‘fwds_settings’, ‘fwds_display_settings’ ); add_action( “admin_print_scripts-$hook”, ‘fwds_print_scripts’ ); } function fwds_print_scripts() { wp_register_script( ‘my-fx’ , plugin_dir_url( __FILE__ ) . … Read more

Error on using __FILE__ for add_menu_page() Function

Your code should work (not how you expect but it should work), and probably the error was in something that you didn’t post. However… __FILE__ is a constant: you don’t have to use quotes when write it. Remove them like so: add_menu_page(‘Item Display’,’Item Display’,’administrator’, __FILE__, function(){ }); If you use the quotes, ‘__FILE__’ became a … Read more

Tracing dashboard publish settings from input form in WordPress

Those are some dangerous words “public…can enter data directly to the DB” You could write your own form and use wp_insert_post() Something like this: $new_post = array( ‘comment_status’ => ‘closed’, ‘ping_status’ => ‘closed’, ‘post_author’ => 1, // id of admin, or some other user ‘post_title’ => $_POST[‘title’], ‘post_name’ => $_POST[‘title’], ‘post_status’ => ‘draft’, ‘post_type’ => … Read more

Plugin admin list pages as submenu

You do not post how you add the top level menu page, however I think when you click on a submenu item you have an url like: http://www.example.com/wp-admin/admin.php?page=theme_admin_{$pageid} So the id of page is in the $_GET[‘page’] variable with a fixed string prepended to it. So why don’t use something like: function display_page_test() { $id … Read more

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