Skip to content

Commit

Permalink
Merge pull request #38 from devgeniem/TMS-1054
Browse files Browse the repository at this point in the history
TMS-1054: Remove hero overlay-toggle from single page editor
  • Loading branch information
eebbi authored Jun 25, 2024
2 parents 1823984 + 6595b48 commit cddb6e3
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.2.6] - 2024-06-04

- TMS-1044: Accordion 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
);
}


/**
* Remove overlay TrueFalse-field from page settings
*
* @param Field\Group $group Group-object of settings.
*
* @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 cddb6e3

Please sign in to comment.