Choose which cookies we can use. You can change this at any time from “Cookie settings” in the footer. See our cookie policy for details.

Essential

Needed for the site to work, such as remembering your cookie choices. These can’t be switched off.

Always on
Skip to content
Developer reference

Maintenance Mode hooks

16 filters and actions, read from the plugin source. Add these in a theme’s functions.php or a Code Snippet.

  • filter

    wpextended/maintenance-mode/admin_bar_css

    add_filter( 'wpextended/maintenance-mode/admin_bar_css', function ( $value ) {
        return $value;
    } );
  • filter

    wpextended/maintenance-mode/admin_bar_node

    Filter admin bar node args. Pro uses this to change href to '#' for toggle.

    $node_args
    (array) WP_Admin_Bar node args
    $is_active
    (bool) Whether maintenance mode is active
    add_filter( 'wpextended/maintenance-mode/admin_bar_node', function ( $node_args, $is_active ) {
        return $node_args;
    }, 10, 2 );
  • filter

    wpextended/maintenance-mode/admin_bar_title

    add_filter( 'wpextended/maintenance-mode/admin_bar_title', function ( $value ) {
        return $value;
    } );
  • action

    wpextended/maintenance-mode/after_description

    add_action( 'wpextended/maintenance-mode/after_description', function () {
        // Your code here
    } );
  • action

    wpextended/maintenance-mode/before_description

    add_action( 'wpextended/maintenance-mode/before_description', function () {
        // Your code here
    } );
  • filter

    wpextended/maintenance-mode/can_toggle

    add_filter( 'wpextended/maintenance-mode/can_toggle', function ( $value ) {
        return $value;
    } );
  • action

    wpextended/maintenance-mode/head

    add_action( 'wpextended/maintenance-mode/head', function () {
        // Your code here
    } );
  • filter

    wpextended/maintenance-mode/is_active

    add_filter( 'wpextended/maintenance-mode/is_active', function ( $value ) {
        return $value;
    } );
  • filter

    wpextended/maintenance-mode/layout

    add_filter( 'wpextended/maintenance-mode/layout', function ( $value ) {
        return $value;
    } );
  • filter

    wpextended/maintenance-mode/layout_data

    add_filter( 'wpextended/maintenance-mode/layout_data', function ( $value ) {
        return $value;
    } );
  • filter

    wpextended/maintenance-mode/page_header

    add_filter( 'wpextended/maintenance-mode/page_header', function ( $value ) {
        return $value;
    } );
  • filter

    wpextended/maintenance-mode/show_admin_bar_notice

    add_filter( 'wpextended/maintenance-mode/show_admin_bar_notice', function ( $value ) {
        return $value;
    } );
  • filter

    wpextended/maintenance-mode/show_maintenance_page

    add_filter( 'wpextended/maintenance-mode/show_maintenance_page', function ( $value ) {
        return $value;
    } );
  • filter Pro

    wpextended/maintenance-mode/user_roles

    Filters the user roles offered in this module’s settings.

    $options
    (array) user role key => label

    Returns: array

    add_filter( 'wpextended/maintenance-mode/user_roles', function ( $options ) {
        return $options;
    } );