function FormHooks::useStickyActionButtons

Same name and namespace in other branches
  1. 11.x core/themes/admin/src/Hook/FormHooks.php \Drupal\admin\Hook\FormHooks::useStickyActionButtons()

Determines the feature flag to use for sticky action buttons.

Parameters

bool $is_content_form: TRUE if this should return the flag for content forms, FALSE if it should return the flag for any form.

Return value

bool TRUE if core_admin_theme_use_sticky_action_buttons is enabled, FALSE otherwise.

File

core/themes/admin/src/Hook/FormHooks.php, line 793

Class

FormHooks
Provides form related hook implementations.

Namespace

Drupal\admin\Hook

Code

private static function useStickyActionButtons(bool $is_content_form = TRUE) : bool {
  $flag = CoreSettings::get('core_admin_theme_use_sticky_action_buttons', 'never');
  return $is_content_form ? $flag === 'content_forms' || $flag === 'always' : $flag === 'always';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.