-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: if OceanWP theme is used, initially use the theme's margin to fo…
…llow its layout
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
import './kadence-theme' | ||
import './wp-6-2' | ||
import './oceanwp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Kadence Theme compatibility. | ||
*/ | ||
|
||
/** | ||
* External dependencies | ||
*/ | ||
import { currentTheme } from 'stackable' | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { addFilter } from '@wordpress/hooks' | ||
|
||
addFilter( 'stackable.heading.edit.useThemeTextMargins', 'stackable/compatibility/oceanwp', value => { | ||
if ( currentTheme !== 'oceanwp' ) { | ||
return value | ||
} | ||
|
||
// If no value has been set, default to true to use OceanWP margins | ||
if ( value === '' ) { | ||
return true | ||
} | ||
|
||
return value | ||
} ) |