'click: onConfirmDialog.bind($data)',
]);
?>
diff --git a/extras/modules/dashboard-styler/dashboard-styler.php b/extras/modules/dashboard-styler/dashboard-styler.php
index 7f23c25..f25c1e7 100644
--- a/extras/modules/dashboard-styler/dashboard-styler.php
+++ b/extras/modules/dashboard-styler/dashboard-styler.php
@@ -286,7 +286,11 @@ function (SettingFactory $cf) {
['maxLength' => 10 * 1024]
)
->enablePostMessageSupport()
- ->addTags(AbstractSetting::TAG_ADMIN_THEME),
+ ->addTags(
+ ...(apply_filters('admin_menu_editor-ac_custom_css_enabled', true)
+ ? [AbstractSetting::TAG_ADMIN_THEME]
+ : [])
+ ),
];
}
@@ -344,14 +348,14 @@ public function getInterfaceStructure() {
$b->auto('headings.h1.textColor'),
$b->auto('headings.h1.font'),
$b->auto('headings.h1.spacing')
- ),
+ )->id('ame-ds-primary-headings'),
$b->section(
'Secondary (H2)',
$b->auto('headings.h2.textColor'),
$b->auto('headings.h2.font'),
$b->auto('headings.h2.spacing')
- )
- ),
+ )->id('ame-ds-secondary-headings')
+ )->id('ame-ds-headings'),
$b->section(
'Tables',
$b->section(
@@ -434,7 +438,7 @@ public function getInterfaceStructure() {
'The custom CSS will be added to all admin pages. '
. 'It will be inserted using a
element in the page header.'
)
- )
+ )->id('ame-ds-custom-css')
)->build();
}
@@ -533,7 +537,7 @@ private function addButtonStyles(StyleGenerator $g, AbstractSettingsDictionary $
//Default state.
new CssRuleSet(
[
- '.wp-core-ui .button',
+ '.wp-core-ui .button:not(.button-primary)',
'.wp-core-ui .button-secondary',
],
[
@@ -548,8 +552,8 @@ private function addButtonStyles(StyleGenerator $g, AbstractSettingsDictionary $
//change this if the user has explicitly specified a custom hover color.
new CssRuleSet(
[
- '.wp-core-ui .button.hover',
- '.wp-core-ui .button:hover',
+ '.wp-core-ui .button.hover:not(.button-primary)',
+ '.wp-core-ui .button:hover:not(.button-primary)',
'.wp-core-ui .button-secondary:hover',
],
[
@@ -564,8 +568,8 @@ private function addButtonStyles(StyleGenerator $g, AbstractSettingsDictionary $
//Focus state.
new CssRuleSet(
[
- '.wp-core-ui .button.focus',
- '.wp-core-ui .button:focus',
+ '.wp-core-ui .button.focus:not(.button-primary)',
+ '.wp-core-ui .button:focus:not(.button-primary)',
'.wp-core-ui .button-secondary:focus',
],
[
@@ -586,8 +590,8 @@ private function addButtonStyles(StyleGenerator $g, AbstractSettingsDictionary $
$g->ifTruthy($secondaryButtonBorderColor),
new CssRuleSet(
[
- '.wp-core-ui .button.focus',
- '.wp-core-ui .button:focus',
+ '.wp-core-ui .button.focus:not(.button-primary)',
+ '.wp-core-ui .button:focus:not(.button-primary)',
'.wp-core-ui .button-secondary:focus',
],
[
@@ -602,9 +606,9 @@ private function addButtonStyles(StyleGenerator $g, AbstractSettingsDictionary $
$g->ifTruthy($primaryButtonBackground),
new CssRuleSet(
[
- '.wp-core-ui .button.active',
- '.wp-core-ui .button.active:focus',
- '.wp-core-ui .button.active:hover',
+ '.wp-core-ui .button.active:not(.button-primary)',
+ '.wp-core-ui .button.active:focus:not(.button-primary)',
+ '.wp-core-ui .button.active:hover:not(.button-primary)',
],
[
'--ame-ds-button-color' => $primaryButtonBackground,
@@ -731,34 +735,71 @@ private function addButtonStyles(StyleGenerator $g, AbstractSettingsDictionary $
)
);
+ //Color picker buttons.
+ //When the border radius changes, the "Select Color" element must have its right border
+ //radius adjusted to avoid either creating a gap or an overlap between its background
+ //and the button's border.
+ $g->addCondition(
+ $g->ifSome([
+ $g->compare($s->getSetting('buttons.border.radius.topRight'), '>=', 0),
+ $g->compare($s->getSetting('buttons.border.radius.bottomRight'), '>=', 0),
+ ]),
+ new CssRuleSet(
+ ['.wp-core-ui .button.wp-color-result .wp-color-result-text'],
+ [
+ '--ame-ds-btn-top-right-radius' => $s->getSetting('buttons.border.radius.topRight'),
+ '--ame-ds-btn-bottom-right-radius' => $s->getSetting('buttons.border.radius.bottomRight'),
+ '--ame-ds-btn-border-width' => $s->getSetting('buttons.border.width'),
+ 'border-top-right-radius' => 'calc(var(--ame-ds-btn-top-right-radius, 3px) - var(--ame-ds-btn-border-width, 1px))',
+ 'border-bottom-right-radius' => 'calc(var(--ame-ds-btn-bottom-right-radius, 3px) - var(--ame-ds-btn-border-width, 1px))',
+ ]
+ )
+ );
+
//General color overrides.
//These could be worked into the above rules, but it's clearer to keep them separate.
$selectorsByButtonType = [
- 'primary' => '.wp-core-ui .button-primary',
- 'secondary' => '.wp-core-ui .button-secondary',
- 'addNew' => '.wrap .page-title-action',
+ 'primary' => ['.wp-core-ui .button-primary'],
+ 'secondary' => ['.wp-core-ui .button:not(.button-primary)', '.wp-core-ui .button-secondary'],
+ 'addNew' => ['.wrap .page-title-action'],
];
- foreach ($selectorsByButtonType as $buttonType => $selector) {
+ foreach ($selectorsByButtonType as $buttonType => $selectors) {
$g->addRuleSet(
- [$selector],
+ $selectors,
[
$s->getSetting('buttons.colors.' . $buttonType . 'Background'),
$s->getSetting('buttons.colors.' . $buttonType . 'Text'),
]
);
+
+ $hoverSelectors = array_map(function ($selector) {
+ return $selector . ':hover';
+ }, $selectors);
$g->addRuleSet(
- [$selector . ':hover'],
+ $hoverSelectors,
[
$s->getSetting('buttons.colors.' . $buttonType . 'BackgroundHover'),
$s->getSetting('buttons.colors.' . $buttonType . 'TextHover'),
]
);
}
+
+ //Let the menu editor know the custom border radius so that it can properly
+ //display the "unsaved changes" indicator.
+ $g->addCondition(
+ $g->ifTruthy($s->getSetting('buttons.border.radius.topRight')),
+ new CssRuleSet(
+ ['.wp-core-ui .button'],
+ [
+ '--ame-ds-btn-radius-tr' => $s->getSetting('buttons.border.radius.topRight'),
+ ]
+ )
+ );
}
private function addBoxStyles(StyleGenerator $g, AbstractSettingsDictionary $s) {
$g->addRuleSet(
- ['.postbox'],
+ ['.postbox', '.ws-ame-postbox.ws-ame-postbox'],
[
$s->getSetting('boxes.containerBackgroundColor'),
$s->getSetting('boxes.containerBorder'),
@@ -830,7 +871,11 @@ private function addBoxStyles(StyleGenerator $g, AbstractSettingsDictionary $s)
);
$g->addRuleSet(
- ['.postbox-header'],
+ [
+ '.postbox-header',
+ '.ws_ame_custom_postbox h2.hndle',
+ '.ws-ame-postbox.ws-ame-postbox .ws-ame-postbox-header',
+ ],
[
$s->getSetting('boxes.headerBackgroundColor'),
@@ -857,7 +902,11 @@ private function addBoxStyles(StyleGenerator $g, AbstractSettingsDictionary $s)
$g->compare($s->getSetting('boxes.containerBorder.radius.topRight'), '>', 0),
]),
new CssRuleSet(
- ['.postbox-header'],
+ [
+ '.postbox-header',
+ '.ws_ame_custom_postbox h2.hndle',
+ '.ws-ame-postbox .ws-ame-postbox-header',
+ ],
[
//Header's border radius = container's border radius - container's border width.
//Using the same radius for both would result in a small gap between the header's
@@ -1040,6 +1089,39 @@ private function addTableStyles(StyleGenerator $g, AbstractSettingsDictionary $s
)
);
+ //Set the border radius of the header/footer corners to the table's border radius
+ //minus its border width to prevent the header/footer background color from overflowing
+ //the table borders.
+ $g->addRuleSet(
+ ['table.widefat'],
+ ['--ame-ds-table-border-width' => $s->getSetting('tables.border.width')]
+ );
+ foreach (['top', 'bottom'] as $vertical) {
+ foreach (['left', 'right'] as $horizontal) {
+ $settingName = 'tables.border.radius.' . $vertical . ucfirst($horizontal);
+ $varName = '--ame-ds-table-border-radius-' . substr($vertical, 0, 1) . substr($horizontal, 0, 1);
+ $property = 'border-' . $vertical . '-' . $horizontal . '-radius';
+
+ $elementSelector = ($vertical === 'top') ? 'thead' : 'tfoot';
+ $childSelector = (($horizontal === 'left') ? 'first' : 'last') . '-child';
+
+ $g->addCondition(
+ $g->ifTruthy($s->getSetting($settingName)),
+ new CssRuleSet(
+ [
+ 'table.widefat ' . $elementSelector . ' th:' . $childSelector,
+ 'table.widefat ' . $elementSelector . ' td:' . $childSelector,
+ ],
+ [
+ $varName => $s->getSetting($settingName),
+ $property =>
+ 'calc(var(' . $varName . ', 0) - var(--ame-ds-table-border-width, 1px))',
+ ]
+ )
+ );
+ }
+ }
+
//Table header. By default, the footer uses the same styles. Optionally, the user
//can override footer styles (see below).
$g->addRuleSet(
@@ -1081,11 +1163,45 @@ private function addTableStyles(StyleGenerator $g, AbstractSettingsDictionary $s
[
'table.widefat thead th',
'table.widefat thead td',
- 'table.widefat tfoot th',
- 'table.widefat tfoot td',
],
[$s->getSetting('tables.header.verticalBorderStyle')]
);
+ //Vertical border color and width. These need to be set to something in case
+ //cell borders are not enabled for table content, or we'll get browser defaults
+ //(e.g. black borders) when the user changes the border style.
+ $g->addCondition(
+ $g->ifAll([
+ $g->ifTruthy($s->getSetting('tables.header.verticalBorderStyle')),
+ $g->compare($s->getSetting('tables.header.verticalBorderStyle'), '!=', 'none'),
+ ]),
+ new CssRuleSet(
+ [
+ 'table.widefat thead th',
+ 'table.widefat thead td',
+ ],
+ [
+ //Vertical border color is either the bottom border color or the cell border color.
+ 'border-right-color' => $g->firstNonEmpty([
+ $s->getSetting('tables.header.border.color'),
+ $s->getSetting('tables.cellBorderColor'),
+ ]),
+ //Border width defaults to the cell border width or 1 px. Don't use browser
+ //defaults because they might not match the rest of the table.
+ 'border-right-width' => $g->firstNonEmpty([
+ $g->cssValue($s->getSetting('tables.verticalCellBorder.width')),
+ '1px',
+ ]),
+ ]
+ ),
+ //Still no border on the rightmost header cell.
+ new CssRuleSet(
+ [
+ 'table.widefat thead th:last-child',
+ 'table.widefat thead td:last-child',
+ ],
+ ['border-right-style' => 'none']
+ )
+ );
//For sortable and sorted column headings, the padding applies to the link
//instead of the cell. The cell itself has zero padding.
@@ -1120,12 +1236,50 @@ private function addTableStyles(StyleGenerator $g, AbstractSettingsDictionary $s
[$s->getSetting('tables.footer.border')]
);
//Vertical borders between footer cells.
+ //Defaults to the same style as the vertical border between header cells.
+ $g->setVariable(
+ 'footerVerticalBorderStyle',
+ $s->getSetting('tables.footer.verticalBorderStyle'),
+ $s->getSetting('tables.header.verticalBorderStyle')
+ );
+ $footerVerticalBorderStyle = $g->variable('footerVerticalBorderStyle');
$g->addRuleSet(
[
'table.widefat tfoot th',
'table.widefat tfoot td',
],
- [$s->getSetting('tables.footer.verticalBorderStyle')]
+ ['border-right-style' => $footerVerticalBorderStyle]
+ );
+ //Vertical border color and width. These only apply to the footer.
+ $g->addCondition(
+ $g->ifAll([
+ $g->ifTruthy($footerVerticalBorderStyle),
+ $g->compare($footerVerticalBorderStyle, '!=', 'none'),
+ ]),
+ new CssRuleSet(
+ [
+ 'table.widefat tfoot th',
+ 'table.widefat tfoot td',
+ ],
+ [
+ 'border-right-color' => $g->firstNonEmpty([
+ $s->getSetting('tables.footer.border.color'),
+ $s->getSetting('tables.header.border.color'),
+ $s->getSetting('tables.cellBorderColor'),
+ ]),
+ 'border-right-width' => $g->firstNonEmpty([
+ $g->cssValue($s->getSetting('tables.verticalCellBorder.width')),
+ '1px',
+ ]),
+ ]
+ ),
+ new CssRuleSet(
+ [
+ 'table.widefat tfoot th:last-child',
+ 'table.widefat tfoot td:last-child',
+ ],
+ ['border-right-style' => 'none']
+ )
);
//Sortable footer headings.
@@ -1505,7 +1659,7 @@ public function registerAdminCustomizerPreview(AmeAdminCustomizer $customizer) {
public function outputUserCustomCss() {
$settings = $this->loadSettings();
$customCss = $settings['customCss'];
- if ( !empty($customCss) ) {
+ if ( !empty($customCss) && apply_filters('admin_menu_editor-ac_custom_css_enabled', true) ) {
//The custom CSS should already be sanitized when it's saved (unless
//the user has the "unfiltered_html" capability).
//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
@@ -1514,10 +1668,14 @@ public function outputUserCustomCss() {
}
public function enqueueAdminCustomizerPreview() {
+ if ( !apply_filters('admin_menu_editor-ac_custom_css_enabled', true) ) {
+ return;
+ }
+
$settings = $this->loadSettings();
ScriptDependency::create(plugins_url('custom-css-preview.js', __FILE__))
- ->addDependencies('jquery', 'ame-admin-customizer-preview')
+ ->addDependencies('jquery')
->addJsVariable(
'wsAmeDsCustomCssPreviewData',
[
@@ -1526,7 +1684,6 @@ public function enqueueAdminCustomizerPreview() {
]
)
->enqueue();
-
}
/**
@@ -1545,6 +1702,10 @@ public function addAdminThemeCss($addCss) {
* @internal
*/
public function addCustomCssToAdminTheme($addCss) {
+ if ( !apply_filters('admin_menu_editor-ac_custom_css_enabled', true) ) {
+ return;
+ }
+
//The custom CSS is usually output separately, but for an admin theme,
//we'll just include it in the main stylesheet.
$s = $this->loadSettings();
@@ -1553,4 +1714,8 @@ public function addCustomCssToAdminTheme($addCss) {
call_user_func($addCss, $customCss);
}
}
+
+ public function getExportOptionLabel() {
+ return 'Dashboard styles';
+ }
}
\ No newline at end of file
diff --git a/extras/modules/easy-hide/easy-hide.php b/extras/modules/easy-hide/easy-hide.php
index 091b408..4101491 100644
--- a/extras/modules/easy-hide/easy-hide.php
+++ b/extras/modules/easy-hide/easy-hide.php
@@ -59,7 +59,7 @@ public function __construct($menuEditor) {
}
//Register the EasyHide menu item after the "Menu Editor (Pro)" item.
- add_action('admin_menu_editor-editor_menu_registered', [$this, 'addAdminMenu']);
+ add_action('admin_menu_editor-editor_menu_registered', [$this, 'addAdminMenu'], 11);
if ( is_admin() ) {
$this->isExplanationHidden = new AmeEhIsExplanationHidden();
@@ -98,6 +98,12 @@ public function addAdminMenu() {
[$this, 'enqueueDependencies'],
2000
);
+
+ \ameMenuItem::add_class_to_submenu_item(
+ $this->parentMenuSlug,
+ self::MENU_SLUG,
+ 'ws-ame-secondary-am-item'
+ );
}
public function enqueueDependencies() {
diff --git a/extras/modules/menu-styler/menu-styler-template.php b/extras/modules/menu-styler/menu-styler-template.php
index 98236d0..81fefe8 100644
--- a/extras/modules/menu-styler/menu-styler-template.php
+++ b/extras/modules/menu-styler/menu-styler-template.php
@@ -15,7 +15,7 @@
addDependencies(
- 'jquery',
- 'ame-customizable-settings',
- 'ame-style-generator',
- 'ame-lodash',
- 'ame-jquery-cookie',
- self::featureScriptHandle
+
+ $useBundles = defined('WS_AME_USE_BUNDLES') && WS_AME_USE_BUNDLES;
+ if ( $useBundles ) {
+ //Note: This assumes that the Customizable library is already registered
+ //and its dependencies have been added.
+ $mainScript = $this->menuEditor->get_webpack_registry()->getWebpackEntryPoint('menu-styler-ui');
+ $mainScript->addDependencies('jquery-color'); //Required by the style generator.
+ } else {
+ $mainScript = ScriptDependency::create(
+ plugins_url('menu-styler-ui.js', __FILE__),
+ 'ame-menu-styler-ui'
)
- ->setTypeToModule()
- ->register();
+ ->addDependencies(
+ 'ame-customizable-settings',
+ 'ame-style-generator'
+ )
+ ->setTypeToModule();
+ }
+ $mainScript->addDependencies(
+ 'jquery',
+ 'ame-lodash',
+ 'ame-jquery-cookie',
+ $this->getFeatureScript()
+ )->register();
+
+ $this->mainScript = $mainScript;
- $dependencies[] = self::mainScriptHandle;
+ $dependencies[] = $mainScript->getHandle();
return $dependencies;
}
@@ -186,14 +205,17 @@ function (StyleGenerator $generator) {
),
];
- wp_add_inline_script(
- self::mainScriptHandle,
- sprintf(
- 'window.ameMenuStylerConfig = (%s);',
- wp_json_encode($scriptData)
- ),
- 'before'
- );
+ if ( $this->mainScript ) {
+ wp_add_inline_script(
+ $this->mainScript->getHandle(),
+ sprintf(
+ 'window.ameMenuStylerConfig = (%s);',
+ wp_json_encode($scriptData)
+ ),
+ 'before'
+ );
+ }
+
}
public function loadMenuStylerSettings($menuConfig, $storedConfig) {
@@ -243,6 +265,7 @@ private function getStyleGenerator(StyleSettings $s, $onlyAdminThemeStyles = fal
],
[$s->getSetting('menuBar.submenuPopupWidth')]
);
+
//Let other components know the custom menu width.
$g->addRuleSet(
['body'],
@@ -251,13 +274,43 @@ private function getStyleGenerator(StyleSettings $s, $onlyAdminThemeStyles = fal
'--ame-ms-collapsed-menu-width' => $s->getSetting('menuBar.collapsedMenuWidth'),
]
);
+
+ //Push the new theme widget editor to the right to make room for the menu.
+ $g->addMediaQuery(
+ $g->ifSome([
+ $s->getSetting('menuBar.collapsedMenuWidth'),
+ $s->getSetting('menuBar.menuWidth'),
+ ]),
+ 'screen and (min-width: 783px)',
+ new CssRuleSet(
+ ['body:not(.folded) #widgets-editor .interface-interface-skeleton'],
+ ['left' => $s->getSetting('menuBar.menuWidth')]
+ ),
+ new CssRuleSet(
+ ['body.folded #widgets-editor .interface-interface-skeleton'],
+ ['left' => $s->getSetting('menuBar.collapsedMenuWidth')]
+ )
+ );
+ //The menu will auto-collapse at or below 960px.
+ $g->addMediaQuery(
+ $g->ifSome([
+ $s->getSetting('menuBar.collapsedMenuWidth'),
+ $s->getSetting('menuBar.menuWidth'),
+ ]),
+ 'screen and (max-width: 960px) and (min-width: 783px)',
+ new CssRuleSet(
+ ['body.auto-fold #widgets-editor .interface-interface-skeleton'],
+ ['left' => 'var(--ame-ms-collapsed-menu-width, 36px)']
+ )
+ );
//endregion
//region Menu bar: Full height
- $g->addSimpleCondition(
- $s->getSetting('menuBar.layout'),
- '==',
- 'fullHeight',
+ $g->addMediaQuery(
+ $g->ifLooselyEqual($s->getSetting('menuBar.layout'), 'fullHeight'),
+ //WordPress hides the entire admin menu bar on small screens, so the full
+ //height feature only applies to viewports wider than that threshold.
+ 'screen and (min-width: 783px)',
new CssRuleSet(
[
//Note: Selector specificity is intentionally increased to override
@@ -291,12 +344,26 @@ private function getStyleGenerator(StyleSettings $s, $onlyAdminThemeStyles = fal
'width' => 'calc(100% - var(--ame-ms-fh-menu-width, 160px))',
]
),
- //Same for the collapsed menu. The default collapsed menu width is 32px.
+ //Same for the collapsed menu. The default collapsed menu width is 36px.
new CssRuleSet(
['.folded #wpadminbar'],
[
- 'margin-left' => 'var(--ame-ms-fh-collapsed-menu-width, 32px)',
- 'width' => 'calc(100% - var(--ame-ms-fh-collapsed-menu-width, 32px))',
+ 'margin-left' => 'var(--ame-ms-fh-collapsed-menu-width, 36px)',
+ 'width' => 'calc(100% - var(--ame-ms-fh-collapsed-menu-width, 36px))',
+ ]
+ )
+ );
+
+ //WordPress automatically collapses the menu bar when the viewport is narrow,
+ //so let's use the collapsed menu width then.
+ $g->addMediaQuery(
+ $g->ifLooselyEqual($s->getSetting('menuBar.layout'), 'fullHeight'),
+ 'screen and (max-width: 960px) and (min-width: 783px)',
+ new CssRuleSet(
+ ['body.auto-fold #wpadminbar'],
+ [
+ 'margin-left' => 'var(--ame-ms-fh-collapsed-menu-width, 36px)',
+ 'width' => 'calc(100% - var(--ame-ms-fh-collapsed-menu-width, 36px))',
]
)
);
@@ -434,14 +501,20 @@ private function getStyleGenerator(StyleSettings $s, $onlyAdminThemeStyles = fal
//When the menu is collapsed, there is far less space for the logo, so the margins
//and padding must be reduced. Since there are currently no separate settings for that
//state, we just drop the left/right margins and padding to zero.
- $g->addRuleSet(
- ['.folded #adminmenu #ame_ms_admin_menu_logo'],
- [
- 'margin-left' => '0',
- 'margin-right' => '0',
- 'padding-left' => '0',
- 'padding-right' => '0',
- ]
+ $g->addCondition(
+ $g->ifSome([
+ $g->ifImageSettingContainsImage($s->getSetting('logo.baseImage')),
+ $g->ifImageSettingContainsImage($s->getSetting('logo.collapsedImage')),
+ ]),
+ new CssRuleSet(
+ ['.folded #adminmenu #ame_ms_admin_menu_logo'],
+ [
+ 'margin-left' => '0',
+ 'margin-right' => '0',
+ 'padding-left' => '0',
+ 'padding-right' => '0',
+ ]
+ )
);
//endregion
@@ -465,19 +538,21 @@ private function getAllStyleGenerators($onlyAdminThemeStyles = false) {
);
}
- public function enqueueFeatureScript($isRequired = false) {
- //Do this only once.
- static $isScriptEnqueued = false, $featureScript = null;
- if ( $isScriptEnqueued ) {
- return;
+ private function getFeatureScript() {
+ if ( $this->featureScript !== null ) {
+ return $this->featureScript;
}
- if ( !$featureScript ) {
+ $useBundles = defined('WS_AME_USE_BUNDLES') && WS_AME_USE_BUNDLES;
+ if ( $useBundles ) {
+ $featureScript = $this->menuEditor
+ ->get_webpack_registry()
+ ->getWebpackEntryPoint('menu-styler-features');
+ } else {
$featureScript = ScriptDependency::create(
plugins_url('menu-styler-features.js', __FILE__),
- self::featureScriptHandle
+ 'ame-menu-styler-js-feats'
)
- ->addDependencies('jquery')
->setTypeToModule()
//Adding the "async" attribute makes a module script execute sooner,
//which is useful to prevent FOUC.
@@ -485,7 +560,21 @@ public function enqueueFeatureScript($isRequired = false) {
->setAsync();
}
- if ( !wp_script_is($featureScript->getHandle(), 'registered') ) {
+ $featureScript->addDependencies('jquery');
+
+ $this->featureScript = $featureScript;
+ return $featureScript;
+ }
+
+ public function enqueueFeatureScript($isRequired = false) {
+ //Do this only once.
+ static $isScriptEnqueued = false;
+ if ( $isScriptEnqueued ) {
+ return;
+ }
+
+ $featureScript = $this->getFeatureScript();
+ if ( !$featureScript->isRegistered() ) {
$featureScript->register();
}
diff --git a/extras/modules/role-editor/ameRexCapability.php b/extras/modules/role-editor/ameRexCapability.php
index 6d34034..29d2861 100644
--- a/extras/modules/role-editor/ameRexCapability.php
+++ b/extras/modules/role-editor/ameRexCapability.php
@@ -12,6 +12,25 @@ class ameRexCapability implements ArrayAccess {
public $usedByPostTypes = array();
+ /**
+ * $permissions, $documentationUrl, and $notes are set dynamically based on
+ * the component context selected for the capability. Some of them will usually
+ * remain unset/unmodified.
+ *
+ * @see \ameRoleEditor::assignCapabilitiesToComponents()
+ *
+ * @var string[]|null
+ */
+ public $permissions = null;
+ /**
+ * @var string|null
+ */
+ public $documentationUrl = null;
+ /**
+ * @var string|null
+ */
+ public $notes = null;
+
/**
* @param string $componentId
* @param ameRexComponentCapabilityInfo|mixed $componentContext
diff --git a/extras/modules/role-editor/ameRoleEditor.php b/extras/modules/role-editor/ameRoleEditor.php
index 53e844b..763be96 100644
--- a/extras/modules/role-editor/ameRoleEditor.php
+++ b/extras/modules/role-editor/ameRoleEditor.php
@@ -2,6 +2,9 @@
/** @noinspection PhpComposerExtensionStubsInspection, SqlResolve */
/** @noinspection PhpUnused Module is loaded dynamically. */
+
+use YahnisElsts\AdminMenuEditor\AdminCustomizer\AmeAdminCustomizer;
+
class ameRoleEditor extends amePersistentProModule {
const REQUIRED_CAPABILITY = 'edit_users';
const CORE_COMPONENT_ID = ':wordpress:';
@@ -322,6 +325,13 @@ private function getPostTypeDescriptors() {
$isIncluded = false;
}
+ //Skip AC changesets.
+ if ( class_exists(AmeAdminCustomizer::class) ) {
+ if ( $name === AmeAdminCustomizer::CHANGESET_POST_TYPE ) {
+ $isIncluded = false;
+ }
+ }
+
if (!$isIncluded) {
continue;
}
diff --git a/extras/modules/role-editor/role-editor.css b/extras/modules/role-editor/role-editor.css
index 5484216..c9270cb 100644
--- a/extras/modules/role-editor/role-editor.css
+++ b/extras/modules/role-editor/role-editor.css
@@ -1,23 +1,28 @@
+@charset "UTF-8";
#rex-loading-message {
- margin-top: 10px; }
+ margin-top: 10px;
+}
#rex-main-ui {
display: flex;
flex-direction: row;
margin-top: 10px;
- width: 100%; }
+ width: 100%;
+}
#rex-content-container,
#rex-action-sidebar {
border: 1px solid #ccd0d4;
background: #fff;
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); }
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+}
#rex-content-container {
display: flex;
flex-grow: 80;
padding: 0;
- overflow-x: hidden; }
+ overflow-x: hidden;
+}
#rex-action-sidebar {
box-sizing: border-box;
@@ -26,9 +31,11 @@
flex-shrink: 0;
align-self: flex-start;
margin-left: 15px;
- padding: 10px 8px; }
- #rex-action-sidebar .rex-action-separator {
- height: 10px; }
+ padding: 10px 8px;
+}
+#rex-action-sidebar .rex-action-separator {
+ height: 10px;
+}
#rex-category-sidebar {
width: 240px;
@@ -37,83 +44,105 @@
position: relative;
border-right: 1px solid #ccd0d4;
padding: 10px 0;
- background: #f8f8f8; }
- #rex-category-sidebar > ul {
- margin-top: 0; }
- #rex-category-sidebar .rex-nav-item {
- cursor: pointer;
- margin: 0;
- padding: 3px 8px 3px 10px; }
- #rex-category-sidebar .rex-nav-item:hover {
- background-color: #E5F3FF; }
- #rex-category-sidebar .rex-selected-nav-item {
- background-color: #CCE8FF;
- box-shadow: 0px -1px 0px 0px #99D1FF, 0px 1px 0px 0px #99D1FF; }
- #rex-category-sidebar .rex-selected-nav-item:hover {
- background-color: #CCE8FF; }
- #rex-category-sidebar .rex-nav-level-2 {
- padding-left: 0px; }
- #rex-category-sidebar .rex-nav-level-3 {
- padding-left: 13px; }
- #rex-category-sidebar .rex-nav-level-4 {
- padding-left: 26px; }
- #rex-category-sidebar .rex-nav-level-5 {
- padding-left: 39px; }
- #rex-category-sidebar .rex-nav-toggle {
- visibility: hidden;
- display: inline-block;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- max-height: 100%;
- width: 20px;
- text-align: right;
- vertical-align: middle; }
- #rex-category-sidebar .rex-nav-toggle:after {
- font-family: dashicons, sans-serif;
- content: "\f345"; }
- #rex-category-sidebar .rex-nav-toggle:hover {
- color: #3ECEF9; }
- #rex-category-sidebar .rex-nav-is-expanded .rex-nav-toggle:after {
- content: "\f347"; }
- #rex-category-sidebar .rex-nav-has-children .rex-nav-toggle {
- visibility: visible; }
- #rex-category-sidebar .rex-dropdown-trigger {
- position: absolute;
- right: 0;
- top: 0;
- padding: 12px 10px 3px 8px; }
- #rex-category-sidebar .rex-nav-item {
- display: flex;
- flex-wrap: nowrap;
- align-items: baseline;
- height: 21px;
- padding-top: 4px;
- padding-bottom: 2px; }
- #rex-category-sidebar .rex-nav-item .rex-nav-toggle {
- flex-shrink: 0;
- margin-right: 0.3em;
- align-self: stretch;
- padding: 1px 0; }
- #rex-category-sidebar .rex-nav-item .rex-capability-count {
- flex-shrink: 0;
- margin-left: 0.3em;
- margin-right: 0.3em; }
- #rex-category-sidebar .rex-nav-item .rex-nav-item-header {
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden; }
+ background: #f8f8f8;
+}
+#rex-category-sidebar > ul {
+ margin-top: 0;
+}
+#rex-category-sidebar .rex-nav-item {
+ cursor: pointer;
+ margin: 0;
+ padding: 3px 8px 3px 10px;
+}
+#rex-category-sidebar .rex-nav-item:hover {
+ background-color: #E5F3FF;
+}
+#rex-category-sidebar .rex-selected-nav-item {
+ background-color: #CCE8FF;
+ box-shadow: 0px -1px 0px 0px #99D1FF, 0px 1px 0px 0px #99D1FF;
+}
+#rex-category-sidebar .rex-selected-nav-item:hover {
+ background-color: #CCE8FF;
+}
+#rex-category-sidebar .rex-nav-level-2 {
+ padding-left: 0px;
+}
+#rex-category-sidebar .rex-nav-level-3 {
+ padding-left: 13px;
+}
+#rex-category-sidebar .rex-nav-level-4 {
+ padding-left: 26px;
+}
+#rex-category-sidebar .rex-nav-level-5 {
+ padding-left: 39px;
+}
+#rex-category-sidebar .rex-nav-toggle {
+ visibility: hidden;
+ display: inline-block;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ max-height: 100%;
+ width: 20px;
+ text-align: right;
+ vertical-align: middle;
+}
+#rex-category-sidebar .rex-nav-toggle:after {
+ font-family: dashicons, sans-serif;
+ content: "\f345";
+}
+#rex-category-sidebar .rex-nav-toggle:hover {
+ color: #3ECEF9;
+}
+#rex-category-sidebar .rex-nav-is-expanded .rex-nav-toggle:after {
+ content: "\f347";
+}
+#rex-category-sidebar .rex-nav-has-children .rex-nav-toggle {
+ visibility: visible;
+}
+#rex-category-sidebar .rex-dropdown-trigger {
+ position: absolute;
+ right: 0;
+ top: 0;
+ padding: 12px 10px 3px 8px;
+}
+#rex-category-sidebar .rex-nav-item {
+ display: flex;
+ flex-wrap: nowrap;
+ align-items: baseline;
+ height: 21px;
+ padding-top: 4px;
+ padding-bottom: 2px;
+}
+#rex-category-sidebar .rex-nav-item .rex-nav-toggle {
+ flex-shrink: 0;
+ margin-right: 0.3em;
+ align-self: stretch;
+ padding: 1px 0;
+}
+#rex-category-sidebar .rex-nav-item .rex-capability-count {
+ flex-shrink: 0;
+ margin-left: 0.3em;
+ margin-right: 0.3em;
+}
+#rex-category-sidebar .rex-nav-item .rex-nav-item-header {
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
#rex-capability-view-container {
flex-grow: 70;
padding: 10px 10px;
- overflow-x: hidden; }
+ overflow-x: hidden;
+}
#rex-capability-view {
width: 100%;
display: flex;
flex-direction: row;
- flex-wrap: wrap; }
+ flex-wrap: wrap;
+}
.rex-category {
box-sizing: border-box;
@@ -124,84 +153,107 @@
flex-basis: auto;
padding: 0;
margin: 0 16px 16px 0;
- border: 1px solid #ccd0d4; }
- .rex-category .rex-category-name {
- font-weight: 600; }
- .rex-category .rex-category-subheading {
- display: none;
- color: #666;
- font-size: 12px;
- font-variant: small-caps; }
- .rex-category .rex-category-subtitle {
- color: #888;
- font-size: 0.95em;
- font-family: Consolas, Monaco, monospace; }
- .rex-category .rex-category-contents {
- box-sizing: border-box;
- display: flex;
- flex-wrap: wrap;
- justify-content: flex-start;
- padding: 10px; }
- .rex-category.rex-has-subcategories {
- width: 100%;
- flex-basis: 100%; }
- .rex-category .rex-category-header {
- padding: 8px 10px;
- border-bottom: 1px solid #ccd0d4; }
- .rex-category.rex-top-category {
- border: none;
- margin: 0 0 10px 0;
- padding: 0; }
- .rex-category.rex-top-category > .rex-category-header {
- color: #23282d;
- font-size: 1.3em;
- margin: 1em 0;
- padding: 0;
- border-bottom: none; }
- .rex-category.rex-top-category > .rex-category-contents {
- padding: 0; }
- .rex-category.rex-sub-category {
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); }
- .rex-category.rex-sub-category > .rex-category-header {
- background: #fafafa; }
+ border: 1px solid #ccd0d4;
+}
+.rex-category .rex-category-name {
+ font-weight: 600;
+}
+.rex-category .rex-category-subheading {
+ display: none;
+ color: #666;
+ font-size: 12px;
+ font-variant: small-caps;
+}
+.rex-category .rex-category-subtitle {
+ color: #888;
+ font-size: 0.95em;
+ font-family: Consolas, Monaco, monospace;
+}
+.rex-category .rex-category-contents {
+ box-sizing: border-box;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: flex-start;
+ padding: 10px;
+}
+.rex-category.rex-has-subcategories {
+ width: 100%;
+ flex-basis: 100%;
+}
+.rex-category .rex-category-header {
+ padding: 8px 10px;
+ border-bottom: 1px solid #ccd0d4;
+}
+.rex-category.rex-top-category {
+ border: none;
+ margin: 0 0 10px 0;
+ padding: 0;
+}
+.rex-category.rex-top-category > .rex-category-header {
+ color: #23282d;
+ font-size: 1.3em;
+ margin: 1em 0;
+ padding: 0;
+ border-bottom: none;
+}
+.rex-category.rex-top-category > .rex-category-contents {
+ padding: 0;
+}
+.rex-category.rex-sub-category {
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
+}
+.rex-category.rex-sub-category > .rex-category-header {
+ background: #fafafa;
+}
.rex-desired-columns-1 {
width: 250px;
flex-grow: 0;
- max-width: 500px; }
+ max-width: 500px;
+}
.rex-desired-columns-2 {
width: 516px;
flex-grow: 0;
- max-width: 1032px; }
+ max-width: 1032px;
+}
.rex-desired-columns-3 {
width: 782px;
flex-grow: 0;
- max-width: 1564px; }
+ max-width: 1564px;
+}
.rex-desired-columns-max {
flex-basis: 100%;
- width: 100%; }
+ width: 100%;
+}
@media screen and (max-width: 1432px) {
.rex-desired-columns-3 {
flex-basis: 100%;
- width: 100%; } }
+ width: 100%;
+ }
+}
@media screen and (max-width: 1168px) {
.rex-desired-columns-2 {
flex-basis: 100%;
- width: 100%; }
+ width: 100%;
+ }
.rex-desired-columns-3 {
flex-basis: 100%;
- width: 100%; } }
+ width: 100%;
+ }
+}
.rex-full-width-categories .rex-category {
width: 100%;
- max-width: unset; }
+ max-width: unset;
+}
.rex-full-width-categories .rex-desired-columns-1 > .rex-category-contents > .rex-permission-list {
column-count: 1;
- max-width: 300px; }
+ max-width: 300px;
+}
/*
* Ensure that each category contains no more than the desired number of columns.
@@ -211,75 +263,89 @@
*/
@media screen and (min-width: 1292px) and (max-width: 1501px) {
.rex-full-width-categories .rex-desired-columns-2 > .rex-category-contents > .rex-permission-list::after {
- content: 'filler';
+ content: "filler";
display: block;
background: yellowgreen;
font-size: 13px;
height: 81px;
- visibility: hidden; } }
+ visibility: hidden;
+ }
+}
@media screen and (min-width: 1502px) and (max-width: 1711px) {
.rex-full-width-categories .rex-desired-columns-2 > .rex-category-contents > .rex-permission-list::after {
- content: 'filler';
+ content: "filler";
display: block;
background: yellowgreen;
font-size: 13px;
height: 162px;
- visibility: hidden; }
+ visibility: hidden;
+ }
.rex-full-width-categories .rex-desired-columns-3 > .rex-category-contents > .rex-permission-list::after {
- content: 'filler';
+ content: "filler";
display: block;
background: yellowgreen;
font-size: 13px;
height: 81px;
- visibility: hidden; } }
+ visibility: hidden;
+ }
+}
@media screen and (min-width: 1712px) {
.rex-full-width-categories .rex-desired-columns-2 > .rex-category-contents > .rex-permission-list::after {
- content: 'filler';
+ content: "filler";
display: block;
background: yellowgreen;
font-size: 13px;
height: 243px;
- visibility: hidden; }
+ visibility: hidden;
+ }
.rex-full-width-categories .rex-desired-columns-3 > .rex-category-contents > .rex-permission-list::after {
- content: 'filler';
+ content: "filler";
display: block;
background: yellowgreen;
font-size: 13px;
height: 162px;
- visibility: hidden; }
+ visibility: hidden;
+ }
.rex-full-width-categories .rex-desired-columns-4 > .rex-category-contents > .rex-permission-list::after {
- content: 'filler';
+ content: "filler";
display: block;
background: yellowgreen;
font-size: 13px;
height: 81px;
- visibility: hidden; } }
+ visibility: hidden;
+ }
+}
.rex-show-category-subheadings .rex-category .rex-category-subheading {
display: block;
width: 100%;
white-space: nowrap;
overflow: hidden;
- text-overflow: ellipsis; }
+ text-overflow: ellipsis;
+}
.rex-capability-count {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
- font-size: 12px; }
- .rex-capability-count:before {
- content: "("; }
- .rex-capability-count:after {
- content: ")"; }
+ font-size: 12px;
+}
+.rex-capability-count:before {
+ content: "(";
+}
+.rex-capability-count:after {
+ content: ")";
+}
.rex-enabled-capability-count + .rex-total-capability-count:before {
- content: "/"; }
+ content: "/";
+}
.rex-permission-list {
box-sizing: border-box;
width: 100%;
columns: 200px;
- column-gap: 10px; }
-
+ column-gap: 10px;
+}
.rex-permission {
box-sizing: border-box;
white-space: nowrap;
@@ -289,33 +355,41 @@
height: 27px;
vertical-align: baseline;
break-inside: avoid-column;
- display: flex; }
- .rex-permission label, .rex-permission .rex-permission-tip-trigger {
- vertical-align: baseline;
- padding-top: 3px;
- padding-bottom: 3px; }
- .rex-permission label {
- flex-grow: 1;
- flex-shrink: 1;
- flex-basis: 50px;
- overflow: hidden;
- text-overflow: ellipsis; }
- .rex-permission .rex-permission-tip-trigger {
- flex-grow: 0;
- flex-shrink: 0;
- flex-basis: 20px; }
+ display: flex;
+}
+.rex-permission label, .rex-permission .rex-permission-tip-trigger {
+ vertical-align: baseline;
+ padding-top: 3px;
+ padding-bottom: 3px;
+}
+.rex-permission label {
+ flex-grow: 1;
+ flex-shrink: 1;
+ flex-basis: 50px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.rex-permission .rex-permission-tip-trigger {
+ flex-grow: 0;
+ flex-shrink: 0;
+ flex-basis: 20px;
+}
.rex-is-redundant {
- color: #888; }
+ color: #888;
+}
.rex-is-explicitly-denied input[type=checkbox] {
- border-color: red; }
+ border-color: red;
+}
.rex-is-personal-override.rex-is-explicitly-denied input[type=checkbox] {
- background-color: #ffe5e5; }
+ background-color: #ffe5e5;
+}
.rex-is-personal-override input[type=checkbox]:checked {
background-color: #d9ffd9;
- border-color: green; }
+ border-color: green;
+}
.rex-permission-tip-trigger {
visibility: hidden;
@@ -325,45 +399,58 @@
margin: 0;
padding-left: 2px;
cursor: pointer;
- color: #777; }
- .rex-permission-tip-trigger:hover {
- color: #0096dd; }
+ color: #777;
+}
+.rex-permission-tip-trigger:hover {
+ color: #0096dd;
+}
.rex-permission:hover {
- background-color: #fafafa; }
- .rex-permission:hover .rex-permission-tip-trigger {
- visibility: visible; }
+ background-color: #fafafa;
+}
+.rex-permission:hover .rex-permission-tip-trigger {
+ visibility: visible;
+}
.rex-tooltip {
- max-width: 700px; }
- .rex-tooltip .rex-tooltip-section-container {
- display: flex;
- flex-direction: column;
- flex-wrap: nowrap; }
- .rex-tooltip .rex-tooltip-section {
- max-width: 400px; }
+ max-width: 700px;
+}
+.rex-tooltip .rex-tooltip-section-container {
+ display: flex;
+ flex-direction: column;
+ flex-wrap: nowrap;
+}
+.rex-tooltip .rex-tooltip-section {
+ max-width: 400px;
+}
#rex-permission-tip {
overflow-y: auto;
- max-height: 600px; }
- #rex-permission-tip h4 {
- margin-bottom: 0.4em; }
- #rex-permission-tip .rex-tip-granted-permissions {
- list-style: disc inside;
- margin-top: 0;
- margin-bottom: 0; }
- #rex-permission-tip .rex-documentation-link {
- display: inline-block;
- max-width: 100%;
- overflow-wrap: break-word; }
+ max-height: 600px;
+}
+#rex-permission-tip h4 {
+ margin-bottom: 0.4em;
+}
+#rex-permission-tip .rex-tip-granted-permissions {
+ list-style: disc inside;
+ margin-top: 0;
+ margin-bottom: 0;
+}
+#rex-permission-tip .rex-documentation-link {
+ display: inline-block;
+ max-width: 100%;
+ overflow-wrap: break-word;
+}
.rex-capability-inheritance-breakdown tbody tr:nth-child(2n+1) {
- background-color: #F9F9F9; }
+ background-color: #F9F9F9;
+}
.rex-capability-inheritance-breakdown .rex-is-decisive-actor td:first-child:after {
- content: "\1f844";
+ content: "🡄";
display: inline-block;
font-weight: bold;
- margin-left: 0.5em; }
+ margin-left: 0.5em;
+}
#rex-view-toolbar {
background: #fcfcfc;
@@ -372,91 +459,121 @@
margin: -10px -10px 0 -10px;
display: flex;
align-items: center;
- flex-wrap: wrap; }
- #rex-view-toolbar > * {
- margin-top: 10px; }
- #rex-view-toolbar .button {
- vertical-align: middle; }
- #rex-view-toolbar > label {
- margin-right: 10px; }
- #rex-view-toolbar .rex-dropdown-trigger .dashicons {
- line-height: 1.3; }
+ flex-wrap: wrap;
+}
+#rex-view-toolbar > * {
+ margin-top: 10px;
+}
+#rex-view-toolbar .button {
+ vertical-align: middle;
+}
+#rex-view-toolbar > label {
+ margin-right: 10px;
+}
+#rex-view-toolbar .rex-dropdown-trigger .dashicons {
+ line-height: 1.3;
+}
#rex-quick-search-query {
min-width: 250px;
max-width: 100%;
- margin-right: 10px; }
+ margin-right: 10px;
+}
#rex-misc-view-options-button {
margin-left: auto;
- margin-right: 10px; }
+ margin-right: 10px;
+}
.rex-search-highlight {
- background-color: #ffff00; }
+ background-color: #ffff00;
+}
-.rex-permission-table th input[type="checkbox"] {
+.rex-permission-table th input[type=checkbox] {
vertical-align: middle;
- margin: -4px 4px -1px 0; }
+ margin: -4px 4px -1px 0;
+}
.rex-permission-table tbody tr:nth-child(2n+1) {
- background-color: #F9F9F9; }
+ background-color: #F9F9F9;
+}
.rex-permission-table td ul {
- margin: 0; }
+ margin: 0;
+}
.rex-permission-table .rex-base-cap-notice {
- color: #888; }
+ color: #888;
+}
/* Switch to fixed layout in narrow viewports to prevent overflow. */
@media screen and (max-width: 1540px) {
.rex-permission-table {
table-layout: fixed;
- max-width: 100%; }
- .rex-permission-table .rex-category-name-column {
- width: 20%; }
+ max-width: 100%;
+ }
+ .rex-permission-table .rex-category-name-column {
+ width: 20%;
+ }
.rex-readable-names-enabled .rex-permission-table {
table-layout: fixed;
- max-width: 100%; }
- .rex-readable-names-enabled .rex-permission-table .rex-category-name-column {
- width: 25%; } }
+ max-width: 100%;
+ }
+ .rex-readable-names-enabled .rex-permission-table .rex-category-name-column {
+ width: 25%;
+ }
+}
/* The taxonomy table needs a wider screen because it has more columns. */
@media screen and (max-width: 1650px) {
#rex-taxonomy-summary-category .rex-permission-table {
table-layout: fixed;
- max-width: 100%; }
- #rex-taxonomy-summary-category .rex-permission-table .rex-category-name-column {
- width: 25%; } }
+ max-width: 100%;
+ }
+ #rex-taxonomy-summary-category .rex-permission-table .rex-category-name-column {
+ width: 25%;
+ }
+}
/*
When in "human readable" mode, the taxonomy table doesn't show capability names,
so it won't overflow its container unless the viewport is very small.
*/
.rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table {
table-layout: auto;
- max-width: 600px; }
- .rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table .rex-capability-name, .rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table .rex-permission-tip-trigger {
- display: none; }
- .rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table .rex-permission, .rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table th[scope="col"] {
- text-align: center; }
- .rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table .rex-category-name-column {
- width: unset; }
+ max-width: 600px;
+}
+.rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table .rex-capability-name, .rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table .rex-permission-tip-trigger {
+ display: none;
+}
+.rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table .rex-permission, .rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table th[scope=col] {
+ text-align: center;
+}
+.rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table .rex-category-name-column {
+ width: unset;
+}
@media screen and (max-width: 1200px) {
.rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table {
table-layout: fixed;
- max-width: 100%; }
- .rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table .rex-category-name-column {
- width: 40%; } }
+ max-width: 100%;
+ }
+ .rex-readable-names-enabled #rex-taxonomy-summary-category .rex-permission-table .rex-category-name-column {
+ width: 40%;
+ }
+}
#rex-action-sidebar .rex-action-button {
display: block;
margin-bottom: 4px;
- width: 100%; }
+ width: 100%;
+}
#rex-permission-list-view {
column-width: 240px;
column-gap: 16px;
- padding-top: 8px; }
+ padding-top: 8px;
+}
#rex-category-view-spacer {
width: 100%;
- height: 10px; }
+ height: 10px;
+}
.rex-dropdown-trigger {
display: inline-block;
@@ -464,10 +581,12 @@ so it won't overflow its container unless the viewport is very small.
cursor: pointer;
padding: 2px;
color: #aaa;
- text-decoration: none; }
- .rex-dropdown-trigger:hover, .rex-dropdown-trigger:focus {
- color: #777;
- text-decoration: none; }
+ text-decoration: none;
+}
+.rex-dropdown-trigger:hover, .rex-dropdown-trigger:focus {
+ color: #777;
+ text-decoration: none;
+}
.rex-dropdown {
position: absolute;
@@ -475,134 +594,173 @@ so it won't overflow its container unless the viewport is very small.
background: #fff;
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
padding: 10px 8px;
- z-index: 100; }
- .rex-dropdown .rex-dropdown-item {
- display: block;
- margin-bottom: 10px; }
- .rex-dropdown .rex-dropdown-item:last-child {
- margin-bottom: 0; }
- .rex-dropdown .rex-dropdown-sub-item {
- margin-left: 1em; }
- .rex-dropdown .rex-dropdown-item > .rex-dropdown-item {
- margin-bottom: 6px; }
- .rex-dropdown .rex-dropdown-item > .rex-dropdown-item:last-child {
- margin-bottom: 0; }
+ z-index: 100;
+}
+.rex-dropdown .rex-dropdown-item {
+ display: block;
+ margin-bottom: 10px;
+}
+.rex-dropdown .rex-dropdown-item:last-child {
+ margin-bottom: 0;
+}
+.rex-dropdown .rex-dropdown-sub-item {
+ margin-left: 1em;
+}
+.rex-dropdown .rex-dropdown-item > .rex-dropdown-item {
+ margin-bottom: 6px;
+}
+.rex-dropdown .rex-dropdown-item > .rex-dropdown-item:last-child {
+ margin-bottom: 0;
+}
.ui-dialog .ui-dialog-buttonpane {
background: #fcfcfc;
border-top: 1px solid #dfdfdf;
- padding: 8px; }
- .ui-dialog .ui-dialog-buttonpane:after {
- clear: both;
- content: "";
- min-height: 0;
- display: table;
- border-collapse: collapse; }
+ padding: 8px;
+}
+.ui-dialog .ui-dialog-buttonpane:after {
+ clear: both;
+ content: "";
+ min-height: 0;
+ display: table;
+ border-collapse: collapse;
+}
.ui-dialog .ui-dialog-buttonset {
- width: 100%; }
- .ui-dialog .ui-dialog-buttonset .ui-button.rex-dialog-cancel-button, .ui-dialog .ui-dialog-buttonset .ui-button.ame-dialog-cancel-button {
- float: right;
- margin-right: 0 !important; }
- .ui-dialog .ui-dialog-buttonset .ui-button {
- float: left; }
+ width: 100%;
+}
+.ui-dialog .ui-dialog-buttonset .ui-button.rex-dialog-cancel-button, .ui-dialog .ui-dialog-buttonset .ui-button.ame-dialog-cancel-button {
+ float: right;
+ margin-right: 0 !important;
+}
+.ui-dialog .ui-dialog-buttonset .ui-button {
+ float: left;
+}
.rex-dialog input[type=text], .rex-dialog select {
box-sizing: border-box;
display: block;
- width: 100%; }
+ width: 100%;
+}
.rex-dialog-section {
- margin-top: 0; }
+ margin-top: 0;
+}
#rex-delete-capability-dialog .rex-deletable-capability-container {
max-height: 400px;
- overflow-y: auto; }
+ overflow-y: auto;
+}
#rex-delete-capability-dialog .rex-deletable-capability-list {
margin-top: 0;
- list-style-type: none; }
+ list-style-type: none;
+}
#rex-add-capability-dialog #rex-new-capability-name {
box-sizing: border-box;
- width: 100%; }
+ width: 100%;
+}
#rex-add-capability-dialog #rex-add-capability-validation-message {
min-height: 40px;
- margin-bottom: 6px; }
+ margin-bottom: 6px;
+}
#rex-delete-role-dialog .rex-deletable-role-list-container {
max-height: 380px;
overflow-y: auto;
- margin-top: 10px; }
+ margin-top: 10px;
+}
#rex-delete-role-dialog .rex-deletable-role-list {
- table-layout: fixed; }
- #rex-delete-role-dialog .rex-deletable-role-list tbody tr:nth-child(2n+1) {
- background-color: #F9F9F9; }
+ table-layout: fixed;
+}
+#rex-delete-role-dialog .rex-deletable-role-list tbody tr:nth-child(2n+1) {
+ background-color: #F9F9F9;
+}
#rex-delete-role-dialog .rex-role-name-column > label {
display: inline-block;
- width: 100%; }
+ width: 100%;
+}
#rex-delete-role-dialog .rex-role-usage-column {
width: 6em;
max-width: 30%;
color: #888;
- text-align: right; }
+ text-align: right;
+}
#rex-editable-roles-container {
- display: flex; }
- #rex-editable-roles-container .ame-role-table {
- min-width: 190px;
- border: 1px solid #ccd0d4;
- border-right-style: none; }
- #rex-editable-roles-container .ame-role-table td {
- cursor: pointer; }
- #rex-editable-roles-container .ame-selected-role-table-row {
- background: #CCE8FF; }
- #rex-editable-roles-container .ame-selected-role-table-row .ame-selected-role-tip {
- visibility: visible; }
- #rex-editable-roles-container .ame-selected-role-table-row .ame-column-role-name {
- font-weight: bold; }
- #rex-editable-roles-container .ame-column-selected-role-tip {
- position: relative;
- padding: 0;
- min-width: 30px; }
- #rex-editable-roles-container .ame-selected-role-tip {
- visibility: hidden;
- height: 100%;
- width: 100%;
- box-sizing: border-box;
- position: absolute;
- top: 0;
- right: -2px;
- border-right: 1px solid white; }
- #rex-editable-roles-container .ame-selected-role-tip .ame-rex-svg-triangle {
- box-sizing: border-box;
- position: absolute;
- right: 0;
- height: 100%; }
- #rex-editable-roles-container .ame-selected-role-tip .ame-rex-svg-triangle polygon {
- fill: white;
- stroke: white;
- stroke-width: 1px; }
+ display: flex;
+}
+#rex-editable-roles-container .ame-role-table {
+ min-width: 190px;
+ border: 1px solid #ccd0d4;
+ border-right-style: none;
+}
+#rex-editable-roles-container .ame-role-table td {
+ cursor: pointer;
+}
+#rex-editable-roles-container .ame-selected-role-table-row {
+ background: #CCE8FF;
+}
+#rex-editable-roles-container .ame-selected-role-table-row .ame-selected-role-tip {
+ visibility: visible;
+}
+#rex-editable-roles-container .ame-selected-role-table-row .ame-column-role-name {
+ font-weight: bold;
+}
+#rex-editable-roles-container .ame-column-selected-role-tip {
+ position: relative;
+ padding: 0;
+ min-width: 30px;
+}
+#rex-editable-roles-container .ame-selected-role-tip {
+ visibility: hidden;
+ height: 100%;
+ width: 100%;
+ box-sizing: border-box;
+ position: absolute;
+ top: 0;
+ right: -2px;
+ border-right: 1px solid white;
+}
+#rex-editable-roles-container .ame-selected-role-tip .ame-rex-svg-triangle {
+ box-sizing: border-box;
+ position: absolute;
+ right: 0;
+ height: 100%;
+}
+#rex-editable-roles-container .ame-selected-role-tip .ame-rex-svg-triangle polygon {
+ fill: white;
+ stroke: white;
+ stroke-width: 1px;
+}
#rex-editable-roles-options {
padding: 4px 10px 10px 10px;
- border: 1px solid #ccd0d4; }
- #rex-editable-roles-options fieldset > p:first-of-type {
- margin-top: 0; }
+ border: 1px solid #ccd0d4;
+}
+#rex-editable-roles-options fieldset > p:first-of-type {
+ margin-top: 0;
+}
#rex-editable-role-list {
margin-left: 1em;
- margin-top: 0; }
+ margin-top: 0;
+}
#rex-user-role-list {
border-right: 1px solid #ccd0d4;
padding: 10px 8px;
- background: #f8f8f8; }
- #rex-user-role-list p:first-child {
- margin-top: 0; }
+ background: #f8f8f8;
+}
+#rex-user-role-list p:first-child {
+ margin-top: 0;
+}
#rex-primary-user-role {
- display: block; }
+ display: block;
+}
.rex-user-role-option-list {
- margin-top: 0; }
+ margin-top: 0;
+}
/*# sourceMappingURL=role-editor.css.map */
diff --git a/extras/modules/role-editor/role-editor.css.map b/extras/modules/role-editor/role-editor.css.map
index e58a17b..87fefdc 100644
--- a/extras/modules/role-editor/role-editor.css.map
+++ b/extras/modules/role-editor/role-editor.css.map
@@ -1,7 +1 @@
-{
-"version": 3,
-"mappings": "AAwBA,oBAAqB;EACpB,UAAU,EAAE,IAAI;;AAGjB,YAAa;EACZ,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,IAAI;;AAGZ;mBACoB;EAvBnB,MAAM,EAXK,iBAAgC;EAY3C,UAAU,EAAE,IAAI;EAChB,UAAU,ECdQ,6BAA6B;;ADuChD,sBAAuB;EACtB,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,EAAE;EACb,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,MAAM;;AAGnB,mBAAoB;EACnB,UAAU,EAAE,UAAU;EACtB,KAAK,EAAE,KAAK;EACZ,SAAS,EAAE,CAAC;EACZ,WAAW,EAAE,CAAC;EACd,UAAU,EAAE,UAAU;EAEtB,WAAW,EAAE,IAAI;EACjB,OAAO,EAlDK,QAA8B;EAoD1C,yCAAsB;IACrB,MAAM,EAAE,IAAI;;AAId,qBAAsB;EACrB,KAAK,EAAE,KAAK;EACZ,SAAS,EAAE,CAAC;EACZ,WAAW,EAAE,CAAC;EACd,QAAQ,EAAE,QAAQ;EAElB,YAAY,EAlED,iBAAgC;EAmE3C,OAAO,EAAE,MAAgB;EAEzB,UAAU,EAAE,OAAO;EAEnB,0BAAO;IACN,UAAU,EAAE,C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B;EAC1B,UAAU,EAAE,CAAC",
-"sources": ["role-editor.scss","../../../css/_boxes.scss"],
-"names": [],
-"file": "role-editor.css"
-}
\ No newline at end of file
+{"version":3,"sourceRoot":"","sources":["role-editor.scss","../../../css/_boxes.scss"],"names":[],"mappings":";AAwBA;EACC;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;AAAA;EAtBC,QAXW;EAYX;EACA,YCdkB;;;ADuCnB;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EAEA;EACA,SAlDY;;AAoDZ;EACC;;;AAIF;EACC;EACA;EACA;EACA;EAEA,cAlEW;EAmEX;EAEA;;AAEA;EACC;;AAGD;EACC;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;;AAGA;EACC;;AAMD;EACC;;AADD;EACC;;AADD;EACC;;AADD;EACC;;AAIF;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;;AAEA;EACC;EACA;;AAGD;EACC;;AAMD;EACC;;AAIF;EACC;;AAGD;EACC;EACA;EACA;EAEA;;AAID;EACC;EACA;EACA;EAEA;EACA;EACA;;AAIA;EACC;EACA,cAJY;EAKZ;EACA;;AAGD;EACC;EACA,aAXY;EAYZ,cAZY;;AAeb;EACC;EACA;EACA;;;AAKH;EACC;EACA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;;;AAMD;EACC;EACA;EACA,OANkB;EAQlB;EACA;EACA;EAEA;EACA;EAEA;;AAEA;EACC;;AAGD;EACC;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EAEA;EACA;EACA;EAEA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;;AAIF;EACC,YC1QiB;;AD4QjB;EACC;;;AAWF;EAEC,OADe;EAEf;EACA;;;AAJD;EAEC,OADe;EAEf;EACA;;;AAJD;EAEC,OADe;EAEf;EACA;;;AAIF;EACC;EACA;;;AAKD;EAKG;IACC;IACA;;;AAMJ;EAKG;IACC;IACA;;;EAFD;IACC;IACA;;;AASH;EACC;EACA;;AAGD;EACC;EACA;;;AAIF;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BA;EAdI;IACC;IACA;IACA;IACA;IAEA;IACA;;;AAWL;EAlBI;IACC;IACA;IACA;IACA;IAEA;IACA;;EAPD;IACC;IACA;IACA;IACA;IAEA;IACA;;;AAeL;EAtBI;IACC;IACA;IACA;IACA;IAEA;IACA;;EAPD;IACC;IACA;IACA;IACA;IAEA;IACA;;EAPD;IACC;IACA;IACA;IACA;IAEA;IACA;;;AAqBL;EACC;EACA;EAEA;EACA;EACA;;;AAGD;EAOC;EACA;EACA;EAEA;;AAUA;EACC;;AAGD;EACC;;;AAKD;EACC;;;AAIF;EACC;EACA;EAEA;EACA;;AAQD;EACC;EAEA;EACA;EACA;EAEA;EACA,QAhbqB;EAibrB;EAEA;EAEA;;AAEA;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;EAEA;EACA;;AAGD;EACC;EACA;EACA;;;AAIF;EACC;;;AAGD;EACC;;;AAQA;EAJA,kBAK4B;;AAG5B;EARA,kBAS4B;EAC3B;;;AASF;EAEC;EAEA;EACA;EACA;EACA;EACA;EAEA;EACA;;AAEA;EACC;;;AAIF;EACC;;AAEA;EACC;;;AAIF;EACC;;AAEA;EACC;EACA;EACA;;AAGD;EACC;;;AAIF;EACC;EACA;;AAEA;EACC;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;;AAzhBD;EACC;;AAgiBA;EACC;EACA;EACA;EACA;;;AAOH;EACC;EACA;EAEA;EACA;EAEA;EACA;EACA;;AAEA;EACC,YAxkBc;;AA2kBf;EACC;;AAGD;EACC;;AAGD;EACC;;;AAIF;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AAQD;EACC;;;AAKA;EACC;EACA;;AAhmBD;EACC;;AAomBD;EACC;;AAGD;EACC;;;AAIF;AAUA;EACC;IATA;IACA;;EAEA;IACC,OAM0B;;;EAG3B;IAbA;IACA;;EAEA;IACC,OAU0B;;;AAI5B;AACA;EACC;IApBA;IACA;;EAEA;IACC,OAiB0B;;;AAI5B;AAAA;AAAA;AAAA;AAIA;EACC;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAIF;EACC;IA/CA;IACA;;EAEA;IACC,OA4C0B;;;AAO3B;EACC;EACA;EACA;;;AAIF;EACC;EACA;EACA,aAhsBgB;;;AAmsBjB;EACC;EACA,QAtsBe;;;AAysBhB;EACC;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACC;EACA;;;AAIF;EACC;EAEA,QA5tBW;EA6tBX;EACA;EAEA,SA7tBY;EA8tBZ;;AAEA;EACC;EACA;;AAEA;EACC;;AAIF;EACC;;AAGD;EACC;;AAEA;EACC;;;AAMF;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;;AAMF;EACC;;AAEA;EACC;EACA;;AAGD;EACC;;;AAMF;EACC;EACA;EACA;;;AAIF;EACC;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;;AAKD;EACC;EACA;;AAGD;EACC;EACA;;;AAKD;EACC;EAEA;EACA;;AAGD;EACC;;AApzBD;EACC;;AAuzBD;EACC;EACA;;AAGD;EACC;EACA;EACA;EACA;;;AAMF;EACC;;AAEA;EACC;EACA;EACA;;AAEA;EACC;;AAMF;EACC;;AAEA;EACC;;AAGD;EACC;;AAIF;EACC;EACA;EACA;;AAGD;EACC;EAEA;EACA;EACA;EAEA;EACA;EACA;EAEA;;AAEA;EACC;EACA;EACA;EACA;;AAEA;EACC,MAxCmB;EAyCnB,QAzCmB;EA0CnB;;;AAMJ;EACC;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAMD;EACC,cAv6BW;EAw6BX,SAr6BY;EAu6BZ;;AAEA;EACC;;;AAIF;EACC;;;AAGD;EACC","file":"role-editor.css"}
\ No newline at end of file
diff --git a/extras/modules/role-editor/role-editor.ts b/extras/modules/role-editor/role-editor.ts
index 1dbb1d2..f6758d0 100644
--- a/extras/modules/role-editor/role-editor.ts
+++ b/extras/modules/role-editor/role-editor.ts
@@ -1466,8 +1466,8 @@ interface RexCapabilityData {
menuItems: string[];
usedByComponents: string[];
- documentationUrl?: string;
- permissions?: string[];
+ documentationUrl?: string|null;
+ permissions?: string[]|null;
readableName?: string;
}
diff --git a/extras/modules/separator-styles/MenuSeparatorStyler.php b/extras/modules/separator-styles/MenuSeparatorStyler.php
index 0804b04..ee6aa8a 100644
--- a/extras/modules/separator-styles/MenuSeparatorStyler.php
+++ b/extras/modules/separator-styles/MenuSeparatorStyler.php
@@ -9,6 +9,7 @@
use YahnisElsts\AdminMenuEditor\Customizable\Controls\AlignmentSelector;
use YahnisElsts\AdminMenuEditor\Customizable\Controls\Container;
use YahnisElsts\AdminMenuEditor\Customizable\SettingCondition;
+use YahnisElsts\AdminMenuEditor\Customizable\Settings\AbstractSetting;
use YahnisElsts\AdminMenuEditor\Customizable\Storage\AbstractSettingsDictionary;
use YahnisElsts\AdminMenuEditor\Customizable\Storage\MenuConfigurationWrapper;
use YahnisElsts\AdminMenuEditor\Customizable\Storage\StorageInterface;
@@ -530,6 +531,7 @@ protected function createDefaults() {
protected function createSettings() {
$f = $this->settingFactory();
$f->enablePostMessageSupport();
+ $f->setTags(AbstractSetting::TAG_ADMIN_THEME);
$settings = [
$f->boolean('customSettingsEnabled', 'Use custom separator styles'),
$f->boolean('useTopLevelSettingsForSubmenus', 'Use the same settings as top level separators'),
@@ -540,6 +542,7 @@ protected function createSettings() {
$separatorType,
function (SettingFactory $cf) {
$cf->enablePostMessageSupport();
+ $cf->setTags(AbstractSetting::TAG_ADMIN_THEME);
return [
$cf->stringEnum(
'colorType',
diff --git a/extras/modules/tweaks/ameJqueryTweak.php b/extras/modules/tweaks/ameJqueryTweak.php
new file mode 100644
index 0000000..ba2b9be
--- /dev/null
+++ b/extras/modules/tweaks/ameJqueryTweak.php
@@ -0,0 +1,94 @@
+jsCode = $jsCode;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function apply($settings = null) {
+ self::$pendingScripts[] = $this->jsCode;
+
+ if ( !self::$isEnqueueHookSet ) {
+ add_action(self::ENQUEUE_ACTION, [__CLASS__, 'enqueueScripts']);
+ add_action(self::BACKUP_ENQUEUE_ACTION, [__CLASS__, 'enqueueScripts']);
+ self::$isEnqueueHookSet = true;
+ }
+ }
+
+ public static function enqueueScripts() {
+ if ( self::$isJqueryEnqueued ) {
+ return;
+ }
+
+ if ( wp_script_is('jquery', 'done') ) {
+ //jQuery was already enqueued and printed, so any remaining scripts
+ //will have to be output directly instead of being added as inline
+ //scripts to the jQuery dependency.
+ self::$isJqueryEnqueued = true;
+ if ( !self::$isOutputHookSet ) {
+ add_action(self::ADMIN_FOOTER_SCRIPT_OUTPUT_ACTION, [__CLASS__, 'outputRemainingScripts']);
+ self::$isOutputHookSet = true;
+ }
+ return;
+ }
+
+ wp_enqueue_script('jquery');
+ self::$isJqueryEnqueued = true;
+
+ if ( !empty(self::$pendingScripts) ) {
+ /** @noinspection PhpRedundantOptionalArgumentInspection -- Let's be explicit about the position. */
+ wp_add_inline_script(
+ 'jquery',
+ self::generateCombinedScript(self::$pendingScripts),
+ 'after'
+ );
+ self::$pendingScripts = [];
+ }
+ }
+
+ public static function outputRemainingScripts() {
+ if ( empty(self::$pendingScripts) ) {
+ return;
+ }
+
+ echo '', "\n";
+
+ self::$pendingScripts = [];
+ }
+
+ private static function generateCombinedScript($scripts) {
+ $blocks = [];
+ foreach ($scripts as $fragment) {
+ $fragment = rtrim($fragment);
+ if ( substr($fragment, -1) !== ';' ) {
+ $fragment .= ';';
+ }
+ $blocks[] = "\t" . $fragment;
+ }
+
+ return sprintf(
+ "jQuery(function(\$) {\n\t/* AME jQuery tweaks */\n%s\n});",
+ implode("\n", $blocks)
+ );
+ }
+}
\ No newline at end of file
diff --git a/extras/modules/tweaks/default-tweaks.php b/extras/modules/tweaks/default-tweaks.php
index ac3d962..82782c6 100644
--- a/extras/modules/tweaks/default-tweaks.php
+++ b/extras/modules/tweaks/default-tweaks.php
@@ -1,86 +1,182 @@
array(
- 'profile' => array('label' => 'Hide Profile Fields', 'priority' => 80),
- 'sidebar-widgets' => array('label' => 'Hide Sidebar Widgets', 'priority' => 100),
- 'sidebars' => array('label' => 'Hide Sidebars', 'priority' => 120),
- 'environment-type' => array('label' => 'Environment Type', 'priority' => 30),
- ),
+$result = [
+ 'sections' => [
+ 'profile' => ['label' => 'Hide Profile Fields', 'priority' => 80],
+ 'sidebar-widgets' => ['label' => 'Hide Sidebar Widgets', 'priority' => 100],
+ 'sidebars' => ['label' => 'Hide Sidebars', 'priority' => 120],
+ 'environment-type' => ['label' => 'Environment Type', 'priority' => 30],
+ ],
- 'tweaks' => array(
- 'hide-screen-meta-links' => array(
+ 'tweaks' => [
+ 'hide-screen-meta-links' => [
'label' => 'Hide screen meta links',
'selector' => '#screen-meta-links',
'hideableLabel' => 'Screen meta links',
'hideableCategory' => 'admin-ui',
- ),
- 'hide-screen-options' => array(
+ ],
+ 'hide-screen-options' => [
'label' => 'Hide the "Screen Options" button',
'selector' => '#screen-options-link-wrap',
'parent' => 'hide-screen-meta-links',
'hideableLabel' => '"Screen Options" button',
'hideableCategory' => 'admin-ui',
- ),
- 'hide-help-panel' => array(
+ ],
+ 'hide-help-panel' => [
'label' => 'Hide the "Help" button',
'selector' => '#contextual-help-link-wrap',
'parent' => 'hide-screen-meta-links',
'hideableLabel' => '"Help" button',
'hideableCategory' => 'admin-ui',
- ),
- 'hide-all-admin-notices' => array(
+ ],
+ 'hide-all-admin-notices' => [
'label' => 'Hide ALL admin notices',
'selector' => '#wpbody-content .notice, #wpbody-content .updated, #wpbody-content .update-nag',
'hideableLabel' => 'All admin notices',
'hideableCategory' => 'admin-ui',
- ),
+ ],
- 'hide-gutenberg-options' => array(
+ 'hide-gutenberg-options' => [
'label' => 'Hide the Gutenberg options menu (three vertical dots)',
'selector' => '#editor .edit-post-header__settings .edit-post-more-menu,'
- .' #editor .edit-post-header__settings .interface-more-menu-dropdown',
- ),
- 'hide-gutenberg-fs-wp-logo' => array(
+ . ' #editor .edit-post-header__settings .interface-more-menu-dropdown',
+ ],
+ 'hide-gutenberg-fs-wp-logo' => [
'label' => 'Hide the WordPress logo in Gutenberg fullscreen mode',
'selector' => '#editor .edit-post-header a.components-button[href^="edit.php"]',
- ),
+ ],
- 'hide-profile-visual-editor' => array(
- 'label' => 'Visual Editor',
- 'selector' => 'tr.user-rich-editing-wrap',
- 'section' => 'profile',
- 'screens' => array('profile'),
- ),
- 'hide-profile-syntax-higlighting' => array(
- 'label' => 'Syntax Highlighting',
- 'selector' => 'tr.user-syntax-highlighting-wrap',
- 'section' => 'profile',
- 'screens' => array('profile'),
- ),
- 'hide-profile-color-scheme-selector' => array(
- 'label' => 'Admin Color Scheme',
- 'selector' => 'tr.user-admin-color-wrap',
- 'section' => 'profile',
- 'screens' => array('profile'),
- ),
- 'hide-profile-toolbar-toggle' => array(
- 'label' => 'Toolbar',
- 'selector' => 'tr.show-admin-bar.user-admin-bar-front-wrap',
- 'section' => 'profile',
- 'screens' => array('profile'),
- ),
-
- 'show-environment-in-toolbar' => array(
+ 'show-environment-in-toolbar' => [
'label' => 'Show environment type in the Toolbar',
'section' => 'environment-type',
'className' => 'ameEnvironmentNameTweak',
'includeFile' => __DIR__ . '/ameEnvironmentNameTweak.php',
- ),
- 'environment-dependent-colors' => array(
+ ],
+ 'environment-dependent-colors' => [
'label' => 'Change menu color depending on the environment',
'section' => 'environment-type',
'className' => 'ameEnvironmentColorTweak',
'includeFile' => __DIR__ . '/ameEnvironmentColorTweak.php',
- ),
- ),
-);
\ No newline at end of file
+ ],
+ ],
+];
+
+//region Profile tweaks
+$profileScreens = ['profile'];
+$profileSection = 'profile';
+$profileTweaks = [
+ 'hide-profile-group-personal-info' => [
+ 'label' => 'Personal Info',
+ 'isGroup' => true,
+ ],
+ 'hide-profile-visual-editor' => [
+ 'label' => 'Visual Editor',
+ 'selector' => 'tr.user-rich-editing-wrap',
+ 'parent' => 'hide-profile-group-personal-info',
+ ],
+ 'hide-profile-syntax-highlighting' => [
+ 'label' => 'Syntax Highlighting',
+ 'selector' => 'tr.user-syntax-highlighting-wrap',
+ 'parent' => 'hide-profile-group-personal-info',
+ ],
+ 'hide-profile-color-scheme-selector' => [
+ 'label' => 'Admin Color Scheme',
+ 'selector' => 'tr.user-admin-color-wrap',
+ 'parent' => 'hide-profile-group-personal-info',
+ ],
+ 'hide-profile-keyboard-shortcuts' => [
+ 'label' => 'Keyboard Shortcuts',
+ 'selector' => 'tr.user-comment-shortcuts-wrap',
+ 'parent' => 'hide-profile-group-personal-info',
+ ],
+ 'hide-profile-toolbar-toggle' => [
+ 'label' => 'Toolbar',
+ 'selector' => 'tr.show-admin-bar.user-admin-bar-front-wrap',
+ 'parent' => 'hide-profile-group-personal-info',
+ ],
+
+ 'hide-profile-group-name' => [
+ 'label' => 'Name',
+ 'jquery-js' => 'jQuery("#profile-page tr.user-user-login-wrap").closest("table").prev("h2").addBack().hide();',
+ ],
+ 'hide-profile-user-login' => [
+ 'label' => 'Username',
+ 'selector' => 'tr.user-user-login-wrap',
+ 'parent' => 'hide-profile-group-name',
+ ],
+ 'hide-profile-first-name' => [
+ 'label' => 'First Name',
+ 'selector' => 'tr.user-first-name-wrap',
+ 'parent' => 'hide-profile-group-name',
+ ],
+ 'hide-profile-last-name' => [
+ 'label' => 'Last Name',
+ 'selector' => 'tr.user-last-name-wrap',
+ 'parent' => 'hide-profile-group-name',
+ ],
+ 'hide-profile-nickname' => [
+ 'label' => 'Nickname',
+ 'selector' => 'tr.user-nickname-wrap',
+ 'parent' => 'hide-profile-group-name',
+ ],
+ 'hide-profile-display-name' => [
+ 'label' => 'Display name',
+ 'selector' => 'tr.user-display-name-wrap',
+ 'parent' => 'hide-profile-group-name',
+ ],
+
+ 'hide-profile-group-contact-info' => [
+ 'label' => 'Contact Info',
+ 'jquery-js' => 'jQuery("#profile-page tr.user-email-wrap").closest("table").prev("h2").addBack().hide();',
+ ],
+ 'hide-profile-email' => [
+ 'label' => 'Email',
+ 'selector' => 'tr.user-email-wrap',
+ 'parent' => 'hide-profile-group-contact-info',
+ ],
+ 'hide-profile-url' => [
+ 'label' => 'Website',
+ 'selector' => 'tr.user-url-wrap',
+ 'parent' => 'hide-profile-group-contact-info',
+ ],
+];
+
+//Find user contact methods and add them to the list of hideable profile fields.
+if ( is_callable('wp_get_user_contact_methods') ) {
+ $contactMethods = wp_get_user_contact_methods();
+ foreach ($contactMethods as $contactMethodId => $contactMethod) {
+ $profileTweaks['hide-profile-cm-' . $contactMethodId] = [
+ 'label' => $contactMethod,
+ 'selector' => 'tr.user-' . $contactMethodId . '-wrap',
+ 'parent' => 'hide-profile-group-contact-info',
+ ];
+ }
+}
+
+//"About Yourself" section.
+$profileTweaks = array_merge($profileTweaks, [
+ 'hide-profile-group-about-yourself' => [
+ 'label' => 'About Yourself',
+ 'jquery-js' => 'jQuery("#profile-page tr.user-description-wrap").closest("table").prev("h2").addBack().hide();',
+ ],
+
+ 'hide-profile-user-description' => [
+ 'label' => 'Biographical Info',
+ 'selector' => 'tr.user-description-wrap',
+ 'parent' => 'hide-profile-group-about-yourself',
+ ],
+
+ 'hide-profile-picture' => [
+ 'label' => 'Profile Picture',
+ 'selector' => 'tr.user-profile-picture',
+ 'parent' => 'hide-profile-group-about-yourself',
+ ],
+]);
+
+foreach ($profileTweaks as $tweakId => $tweak) {
+ $tweak['section'] = $profileSection;
+ $tweak['screens'] = $profileScreens;
+ $result['tweaks'][$tweakId] = $tweak;
+}
+//endregion
+
+return $result;
\ No newline at end of file
diff --git a/extras/modules/tweaks/tweaks-template.php b/extras/modules/tweaks/tweaks-template.php
index 62004eb..3a7044f 100644
--- a/extras/modules/tweaks/tweaks-template.php
+++ b/extras/modules/tweaks/tweaks-template.php
@@ -8,7 +8,7 @@