Help Adding Filter
-
Hi All
I am using a Plugin that inserts url links into a template. I would like the links to open in a new window. I can modify the core Plugin template to do this as follows (see last line of code below). However I know this will be lost if the Plugin updates. I would therefore like to add a filter in the functions.php file in my child theme to do this instead, but am not sure how to do it. Any advice appreciated. By the way, site is currently only on local host so no link to include.
Thanks
// Begin templating logic. $tpl = '<div itemscope itemtype="https://schema.org/Person" class="%%CLASS%%">%%AVATAR%% %%TITLE%% <div id="team-member-%%ID%%" class="team-member-text" itemprop="description">%%TEXT%% %%AUTHOR%%</div></div>'; $tpl = apply_filters( 'woothemes_our_team_item_template', $tpl, $args ); $count = 0; foreach ( $query as $post ) { $count++; $template = $tpl; $css_class = apply_filters( 'woothemes_our_team_member_class', $css_class = 'team-member' ); if ( ( is_numeric( $args['per_row'] ) && ( 0 == ( $count - 1 ) % $args['per_row'] ) ) || 1 == $count ) { $css_class .= ' first'; } if ( ( is_numeric( $args['per_row'] ) && ( 0 == $count % $args['per_row'] ) ) ) { $css_class .= ' last'; } // Add a CSS class if no image is available. if ( isset( $post->image ) && ( '' == $post->image ) ) { $css_class .= ' no-image'; } setup_postdata( $post ); $title = ''; $title_name = ''; // If we need to display the title, get the data - JOHNNYM added to line 115 target=_blank if ( ( get_the_title( $post ) != '' ) && true == $args['display_author'] ) { $title .= '<h3 itemprop="name" class="member">'; if ( true == $args['display_url'] && '' != $post->url && apply_filters( 'woothemes_our_team_member_url', true ) ) { $title .= '<a href="' . esc_url( $post->url ) . '" target="_blank">' . "\n"; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Help Adding Filter’ is closed to new replies.