• Add-ons
  • Blog
  • Resources
    • Documentation
    • FAQs
    • Code snippets
    • Use cases
    • Support
  • Account
    • My account
    • Checkout
    • Cart
  • English
  • French
  • Add-ons
  • Blog
  • Resources
    • Documentation
    • FAQs
    • Code snippets
    • Use cases
    • Support
  • Account
    • My account
    • Checkout
    • Cart
  • English
  • French
home/Knowledge Base/Code snippets/Change dashboard sections order

Change dashboard sections order

524 views 0 April 13, 2021

This code snippet will allow you to re-organize the order of the blocks on the dashboard. This will only work in a plugin, and NOT in a theme functions.php file.
This example will place the conversations block to the top of the page, and the files block to the bottom.

/**
 * Change Dashboard blocks priorities.
 * Default priority is set to 9.
 *
 * @param $priority
 * @param $slug
 *
 * @return int
 */
function custom_cuar_dashboard_blocks_order($priority, $slug){

	switch ($slug) {
		case 'customer-conversations': return 1;
		case 'customer-private-files': return 20;		
	}

	return $priority;
}
add_filter('cuar/core/page/dashboard-block-priority', 'custom_cuar_dashboard_blocks_order', 99, 2);

Was this helpful?

Yes  No
Related Articles
  • Custom admin notification’s recipients
  • Disable CSS resets and allow integration of third party plugins
  • Automatically add a user to a group
  • Changing the default page shown by the Customer Area
  • Changing the page shown after logout
  • Sidebars: how to disable them

Didn't find your answer? Contact Us

Knowledge base
  • Use cases 2
  • Community links 5
  • Code snippets 25
FAQ
  • About licences 7
  • Pre-sales questions 3
  • After-sales questions 1
  • Plugin usage 8
  • Technical questions 10
  • Payments 4
Documentations
  • Getting started
  • Using code snippets
  • The template system
  • Full documentation
Support
  • Pre-sales Enquiries
  • Main plugin support
  • Premium add-ons support
  • Feature Requests

  Custom redirects

Change private files attachment order  

  • Terms and conditions for sales
  • Refund policy
  • Privacy Policy
  • Legal notices
  • Copyright 2021 wp-customerarea.com. All Rights Reserved.