Skip to content

Commit ff53740

Browse files
author
Petter Walbø Johnsgård
authored
Add filter for default theme (#54)
1 parent 23a603e commit ff53740

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

class-grid.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ public function get_fields() : array {
107107
*/
108108
$theme_choices = apply_filters( 'hogan/module/grid/themes', [] );
109109

110+
/**
111+
* Filters the default theme choice in the Grid module
112+
*
113+
* @param string $choice Default theme.
114+
*/
115+
$theme_default_choice = apply_filters( 'hogan/module/grid/themes/default', '' );
116+
110117
/**
111118
* Filters if the theme should support grid sizes.
112119
*
@@ -138,7 +145,7 @@ public function get_fields() : array {
138145
'id' => '',
139146
],
140147
'choices' => $theme_choices,
141-
'default_value' => '',
148+
'default_value' => $theme_default_choice,
142149
'allow_null' => 1,
143150
'multiple' => 0,
144151
'ui' => 0,

0 commit comments

Comments
 (0)