-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
P2 - CriticalCauses a failure (non-breaking) and requires urgent attention.Causes a failure (non-breaking) and requires urgent attention.T-Defect
Milestone
Description
Hi,
I found a problem trying to use the options for [Post_Tags] code.
Even if I write - links="false" - the plugin still put the link.
Following the corrected code from class-apl-shortcodes.php file.
Hope to do it right!
Thanks,
Enrico.
public function post_tags( $atts ) {
// INIT.
$atts_value = shortcode_atts( array(
'delimiter' => ', ',
'links' => 'true',
), $atts, 'post_tags');
$return_str = '';
// STEP 1.
/* $atts_value['links'] = true; THIS IS THE PROBLEM - THEN I CHANGE IT */
$links = true; /* STARTS FROM HERE NOW */
if ( 'false' === strtolower( $atts_value['links'] ) ) {
$links = false; /* HERE ANOTHER CHANGE */
}
// STEP 2.
$post_tags = get_the_tags( $this->_post->ID );
$array_total = count( $post_tags );
$i = 1;
if ( $post_tags ) {
// STEP 3.
foreach ( $post_tags as $tag ) {
if ( $links ) { /* HERE ANOTHER CHANGE */
$return_str .= '<a href="' . get_tag_link( $tag->term_id ) . '" >' . $tag->name . '</a>';
} else {
$return_str .= $tag->name;
}
if ( $array_total > $i ) {
$return_str .= $atts_value['delimiter'];
}
$i++;
}
}
Metadata
Metadata
Assignees
Labels
P2 - CriticalCauses a failure (non-breaking) and requires urgent attention.Causes a failure (non-breaking) and requires urgent attention.T-Defect