Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit a87937d

Browse files
committed
fixes #41
do not load `Linkbacks_Handler::get_comment_type_strings()` if `$facepiles` is empty.
1 parent f1afede commit a87937d

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

includes/class-linkbacks-walker-comment.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ class Semantic_Linkbacks_Walker_Comment extends Walker_Comment {
99
public static $reactions = array();
1010

1111
protected static function should_facepile( $comment ) {
12-
$facepiles = get_option( 'semantic_linkbacks_facepiles' );
13-
if ( ! is_array( $facepiles ) ) {
14-
$facepiles = array_keys( Linkbacks_Handler::get_comment_type_strings() );
15-
}
12+
$facepiles = get_option( 'semantic_linkbacks_facepiles', array() );
13+
1614
if ( self::is_reaction( $comment ) && in_array( 'reaction', $facepiles, true ) ) {
1715
return true;
1816
}

templates/linkbacks.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<?php $facepiles = get_option( 'semantic_linkbacks_facepiles' );
2-
if ( ! is_array( $facepiles ) ) {
3-
$facepiles = array_keys( Linkbacks_Handler::get_comment_type_strings() );
4-
}
5-
6-
?>
1+
<?php $facepiles = get_option( 'semantic_linkbacks_facepiles', array() ); ?>
72
<?php if ( in_array( 'reacji', $facepiles, true ) && Semantic_Linkbacks_Walker_Comment::$reactions ) : ?>
83
<div class="reactions">
94
<h3><?php echo __( 'Reacjis', 'semantic-linkbacks' ); ?></h3>

0 commit comments

Comments
 (0)