-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(theme-support): Added twenty twenty theme support for store page
- Loading branch information
Showing
2 changed files
with
42 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace WeDevs\Dokan\ThemeSupport; | ||
|
||
/** | ||
* Twenty Twenty Theme Support | ||
* | ||
* @since 3.1 | ||
*/ | ||
class TwentyTwenty { | ||
|
||
/** | ||
* The constructor | ||
*/ | ||
function __construct() { | ||
add_filter( 'body_class', [ $this, 'add_wc_class' ] ); | ||
} | ||
|
||
/** | ||
* Makes the store page full width | ||
* | ||
* @param array $classes | ||
* | ||
* @return array | ||
*/ | ||
public function add_wc_class( $classes ) { | ||
if ( dokan_is_store_page() ) { | ||
if ( ! in_array( 'woocommerce', $classes ) ) { | ||
$classes[] = 'woocommerce'; | ||
} | ||
} | ||
|
||
return $classes; | ||
} | ||
} |