Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.9.8] - 2024-05-14

- TMS-1029: Change contacts-blocks width
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() );
Loading