Skip to content

Can someone help me understand how the filters work? #922

Answered by crftwrk
yellowjacket005 asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, let's start from scratch. Let's say there is a simple div with classes in a template file:

<div class="one or more classes">
...
</div>

If you want to change class one or more classes, then you have to copy the entire template file to your child-theme and change the classes directly. Depending on how deep you customise your theme, you will have a lot of copied templates in your child which gets not updated when you update Bootscore.

Basic

For this purpose, most classes and other things are wrapped in a filter to change them without storing a copy of a template file in your child. A basic filter has:

  • A name bootscore/filter/name
  • A string, here one or more classes
<?= apply_filters('b…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@crftwrk
Comment options

Answer selected by yellowjacket005
@yellowjacket005
Comment options

@crftwrk
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants