From fd3991ad37ef045db205533d00bc90dff4eaa96d Mon Sep 17 00:00:00 2001 From: shin Date: Fri, 7 Oct 2016 15:12:22 +0300 Subject: [PATCH] fix: fix cherry-utils --- modules/cherry-utility/cherry-utility.php | 4 ++-- .../inc/cherry-meta-data-utilit.php | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/cherry-utility/cherry-utility.php b/modules/cherry-utility/cherry-utility.php index 0a4d1b4..80d3c05 100755 --- a/modules/cherry-utility/cherry-utility.php +++ b/modules/cherry-utility/cherry-utility.php @@ -2,7 +2,7 @@ /** * 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 @@ -10,7 +10,7 @@ * * @package Cherry_Framework * @subpackage Modules - * @version 1.1.3 + * @version 1.1.4 * @author Cherry Team * @copyright Copyright (c) 2012 - 2016, Cherry Team * @link http://www.cherryframework.com/ diff --git a/modules/cherry-utility/inc/cherry-meta-data-utilit.php b/modules/cherry-utility/inc/cherry-meta-data-utilit.php index 42736da..e2d70dd 100755 --- a/modules/cherry-utility/inc/cherry-meta-data-utilit.php +++ b/modules/cherry-utility/inc/cherry-meta-data-utilit.php @@ -117,20 +117,24 @@ public function get_comment_count( $args = array(), $id = 0 ) { 'visible' => true, 'icon' => '', 'prefix' => '', - 'sufix' => '%s', + 'suffix' => '%s', 'html' => '%1$s%5$s%6$s', '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'] . '"' : ''; @@ -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%5$s%6$s', '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 ) ) { @@ -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 ); }