Need more information about Dashboard Widgets Order

Hi there super heroes! :slight_smile:

I'm trying to use Dashboard Widgets Orders, but I don't see any changes after editing the file.

Here's the current lines I have:

$dashboard_widgets_order['normal']['default'][] = 'dashboard_incoming_links';
$dashboard_widgets_order['side']['default'][] = 'dashboard_primary';
$dashboard_widgets_order['column3']['high'][] = 'dashboard_secondary';
$dashboard_widgets_order['column4']['high'][] = 'dashboard_plugins';

$dashboard_widgets_order['normal']['core'][] = 'dashboard_activity';
$dashboard_widgets_order['side']['core'][] = 'dashboard_quick_press';
$dashboard_widgets_order['normal']['core'][] = 'dashboard_right_now';

Question #1: What is "normal, side and core" options about?
Question #2: Will this changes effect all sub-sites?

Looking forward to hear from you about this. :slight_smile:

  • Sajid

    Hi @urbanoantunes,
    Hope you are doing good today :slight_smile:

    Question #1: What is "normal, side and core" options about?

    These are context arguments of meta boxes to define their default position and according WordPress documentation, it vary's from screen to screen.

    So, if you use "normal" context it will be displayed on the screen after other meta boxes (unless you re-arrange their positions). If you use "side" context, that is more of using in post/page add/edit screen to add meta boxes in the sidebar publish and page attributes metaboxes (again you can change the position).

    And core is priority, for example if core will be displayed first, then with "high" and "low" priorities.

    Question #2: Will this changes effect all sub-sites?

    Yes, changes will effect on all sites on your network.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:
    Cheers, Sajid

  • Sajid

    Hi Urbano,
    Hope you are doing good today :slight_smile:

    No problem at all and welcome back.

    I can't correspond the widgets we have on Dashboard with the Widgets shown on the dashboard-widgets-order.php.

    Have you tried changing the hash in the dashboard-widgets-order.php file ? If no then you need to add some random numbers in following line.

    $dashboard_widgets_order_hash = 'RandomNumbersGoesHere';

    You can create MD5 or Sha1 has from this online tool:
    http://www.sha1-online.com/

    You have to update has each time you need to change the order.

    We have WooCommerce widgets but they don't show up on that file. Please check the attached screen of our Dashboard.

    By default this plugin will include all WordPress dashboard widgets. But we can add custom widgets created by other plugins like WooCommerce. The only thing we need is the ID of the widget. In your case the ID of WooCommerce widget is woocommerce_dashboard_status. To get the ID of widget, right click on the widget, select Inspect (in chrome browser) and look for the id="some_id" attribute in HTML tag as seen in attached below.

    Now finally, we have to copy the existing line of widgets for example dashboard_right_now, At a Glance like below.
    $dashboard_widgets_order['normal']['core'][] = 'dashboard_right_now';

    Paste it in new line and replace dashboard_right_now ID with woocommerce_dashboard_status
    $dashboard_widgets_order['normal']['core'][] = 'dashboard_right_now';

    It should look like below image after change:

    If you want to move the widget to right side on Dashboard or in add/edit post area then replace normal with side.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Best Regards,
    Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.