| Conditions | 2 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 7 | public static function setTemplateDirectory() |
||
| 8 | { |
||
| 9 | add_action('after_switch_theme', function () { |
||
| 10 | $stylesheet = get_option('stylesheet'); |
||
| 11 | |||
| 12 | if (basename($stylesheet) !== 'templates') { |
||
| 13 | update_option('stylesheet', $stylesheet . '/templates'); |
||
| 14 | } |
||
| 15 | }); |
||
| 16 | |||
| 17 | add_filter('stylesheet', function ($stylesheet) { |
||
| 18 | return dirname($stylesheet); |
||
| 19 | }); |
||
| 20 | } |
||
| 21 | |||
| 48 |