Skip to content

Commit 86fb518

Browse files
authored
Merge pull request #37 from BeAPI/feature/default-wpgb
add default wpgb
2 parents 7393d31 + 052f01b commit 86fb518

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Please find into the following list all mu-plugins for setting default options :
3333
* [WP Pagenavi](https://github.com/BeAPI/bea-plugin-defaults/blob/master/default-wp-pagenavi.php)
3434
* [Yoast SEO](https://github.com/BeAPI/bea-plugin-defaults/blob/master/default-wpseo.php)
3535
* [Disable Pannel Gutenberg](https://github.com/BeAPI/bea-plugin-defaults/blob/master/default-disable-pannel-gutenberg.php)
36-
36+
* [WP Grid Builder](https://github.com/BeAPI/bea-plugin-defaults/blob/master/default-wpgb.php)
3737
# Who ?
3838

3939
Created by [Be API](https://beapi.fr), the French WordPress leader agency since 2009. Based in Paris, we are more than 30 people and always [hiring](https://beapi.workable.com) some fun and talented guys. So we will be pleased to work with you.

default-wpgb.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
/*
3+
Plugin Name: BeAPI Default - WP Grid Builder
4+
Version: 1.0.0
5+
Plugin URI: https://beapi.fr
6+
Description: Add default settings for WP Grid Builder
7+
Author: Be API
8+
Author URI: https://beapi.fr
9+
10+
----
11+
12+
Copyright 2024 Be API Technical team (humans@beapi.fr)
13+
14+
This program is free software; you can redistribute it and/or modify
15+
it under the terms of the GNU General Public License as published by
16+
the Free Software Foundation; either version 2 of the License, or
17+
(at your option) any later version.
18+
19+
This program is distributed in the hope that it will be useful,
20+
but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
GNU General Public License for more details.
23+
24+
You should have received a copy of the GNU General Public License
25+
along with this program; if not, write to the Free Software
26+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27+
28+
*/
29+
30+
namespace BEAPI\Plugin_Defaults\WP_Grid_Builder;
31+
32+
if ( ! defined( 'ABSPATH' ) ) {
33+
die( 'Cannot access pages directly.' );
34+
}
35+
36+
add_filter( 'wp_grid_builder/facet/title_tag', __NAMESPACE__ . '\\facet_title_tag', 10, 1 );
37+
38+
/**
39+
* Change the title tag for facets labels in front office (by default h2)
40+
* See https://docs.wpgridbuilder.com/resources/filter-facet-title-tag/
41+
*
42+
* @param string $title_tag
43+
*
44+
* @return string
45+
*/
46+
function facet_title_tag( string $title_tag ): string {
47+
return 'p';
48+
}

0 commit comments

Comments
 (0)