-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
361 lines (333 loc) · 10.6 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<?php
/**
* Gather all bits and pieces together.
* If you end up having multiple post types, taxonomies,
* hooks and functions - please split those to their
* own files under /inc and just require here.
*
* @Date: 2019-10-15 12:30:02
* @Last Modified by: Alexandre Sauvaget
* @Last Modified time: 2022-10-06 13:53:37
*
* @package facyl
*/
namespace Air_Light;
/**
* The current version of the theme.
*/
define( 'AIR_LIGHT_VERSION', '9.1.7' );
// We need to have some defaults as comments or empties so let's allow this:
// phpcs:disable Squiz.Commenting.InlineComment.SpacingBefore, WordPress.Arrays.ArrayDeclarationSpacing.SpaceInEmptyArray
/**
* Theme settings
*/
add_action( 'after_setup_theme', function() {
$theme_settings = [
/**
* Theme textdomain
*/
'textdomain' => 'facyl',
/**
* Image and content sizes
*/
'image_sizes' => [
'small' => 300,
'medium' => 700,
'large' => 1200,
],
'content_width' => 800,
/**
* Logo and featured image
*/
'default_featured_image' => null,
'logo' => '/svg/logo.svg',
'logo_linkedin' => '/svg/linkedin.svg',
'logo_insta' => '/svg/insta.svg',
'chevron_right' => '/svg/chevron-right.svg',
'chevron_up' => '/svg/chevron-up.svg',
'accessibilite' => '/svg/accessibilite.svg',
/**
* Custom setting group settings when using Air setting groups plugin.
* On multilingual sites using Polylang, translations are handled automatically.
*/
'custom_settings' => [
// 'your-custom-setting' => [
// 'id' => Your custom setting post id,
// 'title' => 'Your custom setting',
// 'block-editor' => true,
// ],
],
'social_media_accounts' => [
// 'twitter' => [
// 'title' => 'Twitter',
// 'url' => 'https://twitter.com/digitoimistodude',
// ],
],
/**
* All links are checked with JS, if those direct to external site and if,
* indicator of that is included. Exclude domains from that check in this array.
*/
'external_link_domains_exclude' => [
'localhost:3000',
// 'airdev.test',
// 'airwptheme.com',
'localhost',
],
/**
* Menu locations
*/
'menu_locations' => [
'primary' => __( 'Primary Menu', 'facyl' ),
'footer' => __( 'Footer Menu', 'facyl' ),
'confidentiality' => __( 'Confidentialité Menu', 'facyl' ),
],
/**
* Taxonomies
*
* See the instructions:
* https://github.com/digitoimistodude/facyl#custom-taxonomies
*/
'taxonomies' => [
// 'your-taxonomy' => [
// 'name' => 'Your_Taxonomy',
// 'post_types' => [ 'post', 'page' ],
// ],
],
/**
* Post types
*
* See the instructions:
* https://github.com/digitoimistodude/facyl#custom-post-types
*/
'post_types' => [
// 'your-post-type' => 'Your_Post_Type',
],
/**
* Gutenberg -related settings
* @link https://developer.wordpress.org/resource/dashicons/#block-default
*/
// Register custom ACF Blocks
'acf_blocks' => [
[
// Bloc header
'name' => 'accueil-header',
'title' => 'Bloc Accueil Header',
'description' => 'Présentation principal',
'post_types' => array( 'post', 'page' ),
'prevent_cache' => false,
'icon' => 'heading',
'enqueue_style' => get_template_directory_uri() . '/css/prod/global.css',
],
[
// Bloc eco-conception
'name' => 'eco-conception',
'title' => 'Bloc Eco Conception',
'description' => "Présentation de la démarche d'éco-conception",
'render_template' => '/template-parts/blocks/eco-conception.php',
'category' => 'formatting',
'icon' => 'palmtree',
'keywords' => array( 'éco-conception', 'accueil' ),
'post_types' => array( 'post', 'page' ),
],
[
// Bloc chiffres
'name' => 'bloc-chiffres',
'title' => 'Bloc Chiffres',
'description' => 'Présentation de chiffres clés',
'render_template' => '/template-parts/blocks/bloc-chiffres.php',
'category' => 'formatting',
'example' => 'true',
'keywords' => array( 'chiffres', 'accueil' ),
'post_types' => array( 'post', 'page' ),
'icon' => 'editor-ol',
],
[
'name' => 'image-texte',
'title' => 'Bloc texte et image ',
'render_template' => '/template-parts/blocks/image-texte.php',
'category' => 'formatting',
],
[
// bloc les etape
'name' => 'etapes',
'title' => 'Les étapes de conception',
'render_template' => '/template-parts/blocks/etape.php',
],
[
// bloc les etapes et texte
'name' => 'etapes-texte',
'title' => 'Les étapes de conception et texte',
'render_template' => '/template-parts/blocks/etape-texte.php',
],
[
// bloc les etape
'name' => 'carrousel',
'title' => 'Carrousel',
'render_template' => '/template-parts/blocks/carrousel.php',
],
[
// bloc temoignage
'name' => 'temoignage',
'title' => 'Témoignage',
'render_template' => '/template-parts/blocks/temoignage.php',
],
[
// bloc temoignage front
'name' => 'temoignage-front',
'title' => 'Témoignage accueil',
'render_template' => '/template-parts/blocks/temoignage-front.php',
],
[
'name' => 'dernieres-realisations',
'title' => 'Bloc dernières réalisations',
'render_template' => '/template-parts/blocks/dernieres-realisations.php',
'category' => 'formatting',
],
// [
// 'name' => 'block-file-slug',
// 'title' => 'Block Visible Name',
// // You can safely remove lines below if you find no use for them
// 'prevent_cache' => false, // Defaults to false,
// // Icon defaults to svg file inside svg/block-icons named after the block name,
// // eg. svg/block-icons/block-file-slug.svg
// //
// // Icon setting defines the dashicon equivalent: https://developer.wordpress.org/resource/dashicons/#block-default
// // 'icon' => 'block-default',
// ],
[
'keywords' => array( 'images', 'accueil' ),
'post_types' => array( 'post', 'page' ),
'icon' => 'image',
],
[
// Bloc tarifs
'name' => 'bloc-tarifs',
'title' => 'Bloc Tarifs',
'description' => 'Présentation des tarifs des offres',
'render_template' => '/template-parts/blocks/bloc-tarifs.php',
'category' => 'formatting',
'example' => 'true',
'keywords' => array( 'tarifs', 'accueil' ),
'post_types' => array( 'post', 'page' ),
'icon' => 'money',
],
],
// Custom ACF block default settings
'acf_block_defaults' => [
'category' => 'facyl',
'mode' => 'auto',
'align' => 'full',
'post_types' => [
'page',
],
'supports' => [
'align' => false,
'anchor' => true,
'customClassName' => false,
],
'render_callback' => __NAMESPACE__ . '\render_acf_block',
],
// Restrict to only selected blocks
// Set the value to 'all' to allow all blocks everywhere
'allowed_blocks' => [
'default' => [
'core/archives',
'core/audio',
'core/buttons',
'core/categories',
'core/code',
'core/column',
'core/columns',
'core/coverImage',
'core/embed',
'core/file',
'core/freeform',
'core/gallery',
'core/heading',
'core/html',
'core/image',
'core/latestComments',
'core/latestPosts',
'core/list',
'core/more',
'core/nextpage',
'core/paragraph',
'core/preformatted',
'core/pullquote',
'core/quote',
'core/block',
'core/separator',
'core/shortcode',
'core/spacer',
'core/subhead',
'core/table',
'core/textColumns',
'core/verse',
'core/video',
],
'post' => [
'core/archives',
'core/audio',
'core/buttons',
'core/categories',
'core/code',
'core/column',
'core/columns',
'core/coverImage',
'core/embed',
'core/file',
'core/freeform',
'core/gallery',
'core/heading',
'core/html',
'core/image',
'core/latestComments',
'core/latestPosts',
'core/list',
'core/more',
'core/nextpage',
'core/paragraph',
'core/preformatted',
'core/pullquote',
'core/quote',
'core/block',
'core/separator',
'core/shortcode',
'core/spacer',
'core/subhead',
'core/table',
'core/textColumns',
'core/verse',
'core/video',
],
],
// If you want to use classic editor somewhere, define it here
'use_classic_editor' => [],
// Add your own settings and use them wherever you need, for example THEME_SETTINGS['my_custom_setting']
'my_custom_setting' => true,
];
$theme_settings = apply_filters( 'air_light_theme_settings', $theme_settings );
define( 'THEME_SETTINGS', $theme_settings );
} ); // end action after_setup_theme
/**
* Required files
*/
require get_theme_file_path( '/inc/hooks.php' );
require get_theme_file_path( '/inc/includes.php' );
require get_theme_file_path( '/inc/template-tags.php' );
require get_theme_file_path( '/inc/clean.php' );
// Run theme setup
add_action( 'init', __NAMESPACE__ . '\theme_setup' );
add_action( 'after_setup_theme', __NAMESPACE__ . '\build_theme_support' );
/**
* Defer JS
*/
/*
function add_defer_attribute($tag, $handle) {
if ( 'nom-script-js' !== $handle )
return $tag;
return str_replace( ' src', ' defer="defer" src', $tag );
}
add_filter('script_loader_tag', 'add_defer_attribute', 10, 2);
wp_register_script('nom-script-js', $src, $deps, $ver, $in_footer);
*/