im trying to understand how Action Hooks and Filters work and have this example i want to edit
This function is in a parent theme framework php file:
public function formatArticleCat01( $show_category = false, $shorten_text_chars = 300, $show_date = true, $show_comments = false, $show_author = false, $show_views = false ) {
$sFigure = ( $this->article_thumb != '' ) ? '<div class="col-sm-6 col-md-4 col-lg-5">'. $this->getReviewScore() .'' .$this->getFigureSmall() .'</div><div class="col-sm-6 col-md-8 col-lg-7">' : '<div class="col-xs-12">';
return '<div class="row clearfix">
<!-- start:article.default -->
<article class="def">
'. $sFigure .'
<div class="entry">
'. ( $show_category ? $this->getCategoryLabelSpan() : '' ) .'
<h3 itemprop="name">
<a itemprop="url" href="'. get_permalink($this->article_link) .'">'. $this->article_title .'</a>
</h3>
<div class="entry-meta">
'. ( $show_date ? $this->getPostDateMeta() : '' ) .'
'. ( $show_author ? $this->getAuthorMeta() : '' ) .'
'. ( $show_comments ? $this->getCommentCountMeta() : '' ).'
'. ( $show_views ? $this->getViewsLabelSpan() : '' ) .'
</div>
<div class="text hidden-xs">
'. MipThemeFramework_Util::ShortenText($this->article_content, $shorten_text_chars) .'
</div>
'. $this->getStarRatingLabelSpan() .'
</div>
</div>
</article>
<!-- end:article.default -->
</div>';
}
So lets say i want to add another class to that div just in this line
$sFigure = ( $this->article_thumb != '' ) ? '<div class="col-sm-6 col-md-4 col-lg-5">'. $this->getReviewScore() .'' .$this->getFigureSmall() .'</div><div class="col-sm-6 col-md-8 col-lg-7">' : '<div class="col-xs-12">';
It should work with a filter hook right? Can someone help me to understand the functionality of filter hooks and make this example work
I have no clue what to add in my child theme functions.php file to prevent the loss of the changes when i update the theme.
Hope someone can help me
Thanks