Skip to content

Commit

Permalink
TMS-1054: Remove hero overlay-toggle from single page editor
Browse files Browse the repository at this point in the history
  • Loading branch information
eebbi committed Jun 24, 2024
1 parent 43d0b3d commit 2f4b8de
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

- TMS-1054: Remove hero overlay-toggle from single page editor

## [1.13.0] - 2024-06-17

- TMS-1045: Style changes:
Expand Down
42 changes: 42 additions & 0 deletions lib/ACF/AlterPageSettingsFields.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
use TMS\Theme\Base\Logger;

/**
* Alter Page settings -fields
*/
class AlterPageSettingsFields {

/**
* Constructor
*/
public function __construct() {
\add_filter(
'tms/acf/group/fg_page_settings',
[ $this, 'remove_hero_overlay_setting' ],
100
);
}


/**

Check failure on line 21 in lib/ACF/AlterPageSettingsFields.php

View workflow job for this annotation

GitHub Actions / phpcs-check

Doc comment for parameter "$group" missing
* Remove overlay TrueFalse-field from page settings
*
* @param Field\Group[] $fields Array of settings.

Check failure on line 24 in lib/ACF/AlterPageSettingsFields.php

View workflow job for this annotation

GitHub Actions / phpcs-check

Doc comment for parameter $fields does not match actual variable name $group
*
* @return array
*/
public function remove_hero_overlay_setting( $group ) {
try {
if ( $group->get_key() === 'fg_page_settings' ) {
$group->remove_field( 'fg_page_settings_remove_overlay' );
}
}
catch ( Exception $e ) {
( new Logger() )->error( $e->getMessage(), $e->getTrace() );
}

return $group;
}
}

( new AlterPageSettingsFields() );

0 comments on commit 2f4b8de

Please sign in to comment.