Support » Fixing WordPress » Dashboard – Fatal error: Cannot redeclare wp_dashboard_setup()

  • I am getting the following error on a number of widgets included with the WordPress installation. All widgets with the problem are in the Dashboard in the Admin section.

    Fatal error: Cannot redeclare wp_dashboard_setup() (previously declared in [obfuscated]/wp-admin/includes/dashboard.php:17) in [obfuscated]/wp-admin/includes/dashboard.php on line 120

    This error cropped up after upgrading to version 3.0.1. I tried re-uploading the ‘includes’ folder, then re-uploading the entire ‘wp-admin’ folder with no success.
    I also tried deactivating all the other plugins, though it didn’t seem related since the dashboard is built in to the installation.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I am having the same error (minus the obfuscation)

    henry

    If you are using the appcloud theme, the issue is there.
    Go into the appcloud theme directory and find the functions.php file and delete or comment out the following code at the very bottom (lines 68-107 in the file I was editing):

    function icl_admin()
    {
    	require_once('includes/functions.php');
    	require_once(ABSPATH . '/wp-admin/includes/template.php');
    	require_once(ABSPATH . '/wp-admin/includes/dashboard.php');
    	if (function_exists('wp_add_dashboard_widget'))
    	{
    		do_action('wp_dashboard_setup');
    		wp_add_dashboard_widget('icl_feed_list', 'iCreativeLabs News', 'icl_dashboard_news_list');
    	}
    
    	/*
    	|--------------------------------------------------------------------------
    	| MENU
    	|--------------------------------------------------------------------------
    	*/
    	add_menu_page('AppCloud Options', 'AppCloud', 'edit_themes', 'includes/functions.php', 'icl_general');
    	add_submenu_page('includes/functions.php', 'Main Menu Options', 'Main Menu', 'edit_themes', 'icl_menu', 'icl_menu');
    	add_submenu_page('includes/functions.php', 'Categories Options', 'Categories', 'edit_themes', 'icl_categories', 'icl_categories');
    	add_submenu_page('includes/functions.php', 'Products Options', 'Products', 'edit_themes', 'icl_products', 'icl_products');
    	add_submenu_page('includes/functions.php', 'Price Rules Options', 'Price Rules', 'edit_themes', 'icl_price_rules', 'icl_price_rules');
    	add_submenu_page('includes/functions.php', 'Banner Options', 'Banner', 'edit_themes', 'icl_banner', 'icl_banner');
    
    	if (current_user_can('manage_options'))
    	{
    		global $user_email;
    		get_currentuserinfo();
    		$theme = current_theme_info();
    		ping('http://ping.icreativelabs.com', 'icl.ping.wp.theme', array(
    			'api_key' => '*(#^(NF*(^NHYIUEuier836298962ui&*^#',
    			'format' => 'json',
    			'ip' => $_SERVER['REMOTE_ADDR'],
    			'host' => $_SERVER['HTTP_HOST'],
    			'email' => $user_email,
    			'version' => $theme->version
    		), 'KDBEYB&83b66f3789fdi38%^@%*&@');
    	}
    }
    
    add_action('admin_menu', 'icl_admin');

    be sure to leave the closing ” ?> “

    you can probably just delete portions of the above code to fix the issue, but this way it gets rid of the icreative news feed and the fake “this is what you *COULD edit if you bought the premium version” sidebar link too.
    No offense to the devs. This is an awesome theme for them to be offering for free.

    Hope this helps. cheers.

    MaryKateOlsen

    (@marykateolsen)

    I had the same issue with the Dangdoot theme. jasoncaffee’s solution above worked perfectly! Thanks a million.

    jasoncaffee

    (@jasoncaffee)

    Awesome! Glad to help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Dashboard – Fatal error: Cannot redeclare wp_dashboard_setup()’ is closed to new replies.