Skip to content

Commit

Permalink
fix: fix cherry-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
shin committed Oct 7, 2016
1 parent 886c598 commit fd3991a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions modules/cherry-utility/cherry-utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
/**
* Module Name: Utility
* Description: Multiple utility functions
* Version: 1.1.3
* Version: 1.1.4
* Author: Cherry Team
* Author URI: http://www.cherryframework.com/
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* @package Cherry_Framework
* @subpackage Modules
* @version 1.1.3
* @version 1.1.4
* @author Cherry Team <cherryframework@gmail.com>
* @copyright Copyright (c) 2012 - 2016, Cherry Team
* @link http://www.cherryframework.com/
Expand Down
18 changes: 12 additions & 6 deletions modules/cherry-utility/inc/cherry-meta-data-utilit.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,24 @@ public function get_comment_count( $args = array(), $id = 0 ) {
'visible' => true,
'icon' => '',
'prefix' => '',
'sufix' => '%s',
'suffix' => '%s',

This comment has been minimized.

Copy link
@cheh

cheh Oct 7, 2016

Member

Don't forget fix with in blank-theme

'html' => '%1$s<a href="%2$s" %3$s %4$s>%5$s%6$s</a>',
'title' => '',
'class' => 'post-comments-count',
'echo' => false,
);

$args = wp_parse_args( $args, $default_args );

$args['suffix'] = ( isset( $args['sufix'] ) ) ? $args['sufix'] : $args['suffix'];

$html = $count = '' ;

if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
$post_type = get_post_type( $object->ID );
if ( post_type_supports( $post_type, 'comments' ) ) {
$sufix = is_string( $args['sufix'] ) ? $args['sufix'] : translate_nooped_plural( $args['sufix'], $object->comment_count, $args['sufix']['domain'] );
$count = sprintf( $sufix, $object->comment_count );
$suffix = is_string( $args['suffix'] ) ? $args['suffix'] : translate_nooped_plural( $args['suffix'], $object->comment_count, $args['suffix']['domain'] );
$count = sprintf( $suffix, $object->comment_count );
}

$html_class = ( $args['class'] ) ? 'class="' . $args['class'] . '"' : '';
Expand Down Expand Up @@ -204,13 +208,15 @@ public function get_post_count_in_term( $args = array(), $id = 0 ) {
'visible' => true,
'icon' => '',
'prefix' => '',
'sufix' => '%s',
'suffix' => '%s',
'html' => '%1$s<a href="%2$s" %3$s %4$s rel="bookmark">%5$s%6$s</a>',
'title' => '',
'class' => 'post-count',
'echo' => false,
);
$args = wp_parse_args( $args, $default_args );
$args['suffix'] = ( isset( $args['sufix'] ) ) ? $args['sufix'] : $args['suffix'];

$html = '' ;

if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
Expand All @@ -219,8 +225,8 @@ public function get_post_count_in_term( $args = array(), $id = 0 ) {
$title = ( $args['title'] ) ? 'title="' . $args['title'] . '"' : 'title="' . $name . '"' ;
$link = get_term_link( $object->term_id , $object->taxonomy );

$sufix = is_string( $args['sufix'] ) ? $args['sufix'] : translate_nooped_plural( $args['sufix'], $object->count, $args['sufix']['domain'] );
$count = sprintf( $sufix, $object->count );
$suffix = is_string( $args['suffix'] ) ? $args['suffix'] : translate_nooped_plural( $args['suffix'], $object->count, $args['suffix']['domain'] );
$count = sprintf( $suffix, $object->count );

$html = sprintf( $args['html'], $args['prefix'], $link, $title, $html_class, $args['icon'], $count );
}
Expand Down

0 comments on commit fd3991a

Please sign in to comment.