Skip to content

Commit

Permalink
enhance(directives): Add a @sidebar, @hassidebar, and `@endhassid…
Browse files Browse the repository at this point in the history
…ebar` directives (Fixes #71)
  • Loading branch information
Log1x committed Jul 29, 2023
1 parent 56019a4 commit 6731b86
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Directives/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,24 @@
return "<?php post_class({$expression}); ?>";
},

/*
|---------------------------------------------------------------------
| @sidebar / @hassidebar / @endhassidebar
|---------------------------------------------------------------------
*/

'sidebar' => function ($expression) {
return "<?php dynamic_sidebar($expression); ?>";
},

'hassidebar' => function ($expression) {
return "<?php if (is_active_sidebar($expression)) : ?>";
},

'endhassidebar' => function () {
return '<?php endif; ?>';
},

/*
|---------------------------------------------------------------------
| @__
Expand Down

0 comments on commit 6731b86

Please sign in to comment.