Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?

Use wp_enqueue_script. You assign a name to your js file when enqueued, and it will stop a file from being enqueued multiple times. Right now your JS is simple enough, but as it gets more complex, it’s better to have it outside in it’s on .js file. add_action( ‘wp_enqueue_scripts’, ‘add_my_js’ ); function add_my_js() { wp_enqueue_script( … Read more

WordPress Plugin Admin Tab

Here is something I used: add_action( ‘admin_menu’, ‘manage_poll_menu’ ); function manage_poll_menu() { add_menu_page( ‘Manage Polls’, ‘Polls’, ‘manage_polls_cap’, ‘manage_polls’, ‘my_poll_options’, ” ); add_submenu_page( ‘manage_polls’, ‘Add New’, ‘Add New Poll’, ‘manage_polls_cap’, ‘add_new_poll’, ‘my_poll_options’ ); add_submenu_page( ‘manage_polls’, ‘Poll Sections’, ‘Poll Sections’, ‘manage_polls_cap’, ‘poll_sections’, ‘my_poll_options’ ); add_submenu_page( ‘manage_polls’, ‘Add New Poll Section’, ‘Add New Poll Section’, ‘manage_polls_cap’, ‘add_new_poll_section’, ‘my_poll_options’ … Read more

Error: Can´t access facebook comment plugin admin page

I had to change the plugin file to make it work. I think it can help someone and even the plugin’s author should consider making these changes. on class-admin.php, create this function at the beggining (can be line 9): function loadXmlByCurl($url){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $xml = … Read more

add_menu_page does not render the expected result

as the 5 parameter to add_menu_page() you send the resultat of running the function, insted of sending a callable reference to the function, as you did in the add_action. $hookname = add_menu_page ( ‘My Slider’, ‘My Slider’, ‘manage_options’, ‘my_slider’, array( ‘My_Slider’, ‘render_admin_menu’) );

Plugin permissions for Editor role

manage_options is an admin role so I’d still try and changing it even if you’ve changed the roles elsewhere. See http://codex.wordpress.org/Roles_and_Capabilities#Editor for more info. Try the following: add_options_page(‘Orbisius Simple Notice’, ‘Orbisius Simple Notice’, ‘edit_others_posts’, __FILE__, ‘orbisius_simple_notice_options_page’);