• 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/Customize the height of the private area

Customize the height of the private area

359 views 0 April 13, 2021

By default, WP Customer Area will adjust the height of the area, depending on the window height. It is useful for integrating the area into an application, so the height of the area will automatically the calculated height.

The reason for this comes from the sliding sidebar on the right of the area.

However, this behavior can be changed. The following function will tell WP Customer Area to only make the area a minimum of 500px height.

/**
 * Customize the height of the area to just a minimum of 500px
 *
 * @param $args array
 *
 * @return mixed
 * @see customer-area/src/php/core-classes/templates/customer-page.template.php
 */
function cuar_custom_area_height( $args )
{
	$args['data-tray-height-base'] = ''; // default: 'window'
	$args['data-tray-height-substract'] = ''; // only needed in 'window' mode
	$args['data-tray-height-minimum'] = 500;
	return $args;
}
add_action( 'cuar/core/page/sidebar-attributes', 'cuar_custom_area_height' );

Was this helpful?

Yes  1 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
Knowledge base
  • Code snippets 25
  • Use cases 2
  • Community links 5
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
  • Terms and conditions for sales
  • Refund policy
  • Privacy Policy
  • Legal notices
  • Copyright 2021 wp-customerarea.com. All Rights Reserved.