Plugin Directory

Changeset 1511127


Ignore:
Timestamp:
10/09/2016 02:15:44 PM (9 years ago)
Author:
codecookies
Message:

Version 1.1


Location:
cc-essentials
Files:
68 added
5 edited

Legend:

Unmodified
Added
Removed
  • cc-essentials/trunk/cc-essentials.php

    r1476285 r1511127  
    44 * Plugin URI: https://wordpress.org/plugins/cc-essentials/
    55 * Description: CodeCookies Essentials: A set of powerful tools like shortcodes, widgets and font-awesome icons to extend the functionality of your WordPress site.
    6  * Version: 1.0.0
     6 * Version: 1.1
    77 * Author: CodeCooki.es
    88 * Author URI: http://codecooki.es
  • cc-essentials/trunk/includes/settings/settings.php

    r1481829 r1511127  
    235235                    'type'          => 'text'
    236236                ),
     237                'hide_count_if_zero' => array(
     238                    'id'            => 'hide_count_if_zero',
     239                    'name'          => __('Hide count when no loves received', 'verve'),
     240                    'desc'          => __('Check this to hide the ‘0’ count when no loves are received.', 'verve'),
     241                    'type'          => 'checkbox',
     242                    'options'       => array (
     243                        'yes'   => array( 'name' => __( 'Yes, hide it', 'cc-essentials' ) )                 
     244                    )
     245                ),
    237246                'suffix_text_one' => array(
    238247                    'id'            => 'suffix_text_one',
  • cc-essentials/trunk/languages/cc-essentials.pot

    r1481829 r1511127  
    22msgstr ""
    33"Project-Id-Version: CC Essentials\n"
    4 "POT-Creation-Date: 2016-08-23 23:08+0530\n"
    5 "PO-Revision-Date: 2016-08-23 23:09+0530\n"
     4"POT-Creation-Date: 2016-10-09 19:25+0530\n"
     5"PO-Revision-Date: 2016-10-09 19:25+0530\n"
    66"Last-Translator: CodeCookies\n"
    77"Language-Team: CodeCookies\n"
     
    187187
    188188#: includes/settings/settings.php:239
     189msgid "Hide count when no loves received"
     190msgstr ""
     191
     192#: includes/settings/settings.php:240
     193msgid "Check this to hide the ‘0’ count when no loves are received."
     194msgstr ""
     195
     196#: includes/settings/settings.php:243
     197msgid "Yes, hide it"
     198msgstr ""
     199
     200#: includes/settings/settings.php:248
    189201msgid "Suffix text when 1 love received"
    190202msgstr ""
    191203
    192 #: includes/settings/settings.php:240
     204#: includes/settings/settings.php:249
    193205msgid "person loved this!"
    194206msgstr ""
    195207
    196 #: includes/settings/settings.php:241
     208#: includes/settings/settings.php:250
    197209msgid ""
    198210"The text after the count when one person has loved a post/page. Leave blank "
     
    200212msgstr ""
    201213
    202 #: includes/settings/settings.php:246
     214#: includes/settings/settings.php:255
    203215msgid "Suffix text when more than 1 loves received"
    204216msgstr ""
    205217
    206 #: includes/settings/settings.php:247
     218#: includes/settings/settings.php:256
    207219msgid "people loved this!"
    208220msgstr ""
    209221
    210 #: includes/settings/settings.php:248
     222#: includes/settings/settings.php:257
    211223msgid ""
    212224"The text after the count when more than one person has loved a post/page. "
     
    214226msgstr ""
    215227
    216 #: includes/settings/settings.php:403
     228#: includes/settings/settings.php:412
    217229#, php-format
    218230msgid ""
     
    221233msgstr ""
    222234
    223 #: includes/settings/settings.php:415
     235#: includes/settings/settings.php:424
    224236#, php-format
    225237msgid ""
     
    287299msgstr ""
    288300
    289 #: loveit/cce-loveit.php:40 loveit/cce-loveit.php:177
     301#: loveit/cce-loveit.php:40 loveit/cce-loveit.php:183
    290302msgid "You already loved this!"
    291303msgstr ""
     
    303315msgstr ""
    304316
    305 #: loveit/cce-loveit.php:173
     317#: loveit/cce-loveit.php:179
    306318msgid "Love this"
    307319msgstr ""
    308320
    309 #: loveit/cce-loveit.php:205
    310 msgid "CC - Most Loved Posts"
    311 msgstr ""
    312 
    313 #: loveit/cce-loveit.php:205
    314 msgid "Displays most loved posts in descending order."
    315 msgstr ""
    316 
    317 #: loveit/cce-loveit.php:268
     321#: loveit/cce-loveit.php:211
     322msgid "• [CC] Most Loved Posts"
     323msgstr ""
     324
     325#: loveit/cce-loveit.php:211
     326msgid ""
     327"Displays most loved posts in descending order. Installed by ‘CC "
     328"Essentials’ plugin."
     329msgstr ""
     330
     331#: loveit/cce-loveit.php:274
    318332msgid "Most loved posts"
    319333msgstr ""
    320334
    321 #: loveit/cce-loveit.php:284
     335#: loveit/cce-loveit.php:290
    322336msgid "Title:"
    323337msgstr ""
    324338
    325 #: loveit/cce-loveit.php:288
     339#: loveit/cce-loveit.php:294
    326340msgid "Description:"
    327341msgstr ""
    328342
    329 #: loveit/cce-loveit.php:292
     343#: loveit/cce-loveit.php:298
    330344msgid "Posts:"
    331345msgstr ""
    332346
    333 #: loveit/cce-loveit.php:297
     347#: loveit/cce-loveit.php:303
    334348msgid "Display counts"
    335349msgstr ""
    336350
    337 #: loveit/cce-loveit.php:302
     351#: loveit/cce-loveit.php:308
    338352#, php-format
    339353msgid "Display suffix & prefix %1$sEdit%2$s"
  • cc-essentials/trunk/loveit/cce-loveit.php

    r1484863 r1511127  
    105105            // Click event. Get and Update Count
    106106            $post_id = str_replace('cce-loveit-', '', $_POST['loves_id']);
    107             echo $this->cce_love_this($post_id, $cce_options['suffix_text_zero'], $cce_options['suffix_text_one'], $cce_options['suffix_text_more'], 'update');
     107            echo $this->cce_love_this($post_id, $cce_options['suffix_text_zero'], $cce_options['hide_count_if_zero']['yes'], $cce_options['suffix_text_one'], $cce_options['suffix_text_more'], 'update');
    108108        } else {
    109109            // AJAXing data in. Get Count
    110110            $post_id = str_replace('cce-loveit-', '', $_POST['post_id']);
    111             echo $this->cce_love_this($post_id, $cce_options['suffix_text_zero'], $cce_options['suffix_text_one'], $cce_options['suffix_text_more'], 'get');
     111            echo $this->cce_love_this($post_id, $cce_options['suffix_text_zero'], $cce_options['hide_count_if_zero']['yes'], $cce_options['suffix_text_one'], $cce_options['suffix_text_more'], 'get');
    112112        }
    113113
     
    115115    }
    116116
    117     function cce_love_this($post_id, $suffix_text_zero = false, $suffix_text_one = false, $suffix_text_more = false, $action = 'get') {
     117    function cce_love_this($post_id, $suffix_text_zero = false, $hide_count_if_zero = false, $suffix_text_one = false, $suffix_text_more = false, $action = 'get') {
    118118        if(!is_numeric($post_id)) return;
    119119        $suffix_text_zero = strip_tags($suffix_text_zero);
     
    125125            case 'get':
    126126                $loves = get_post_meta($post_id, '_cce_loves', true);
     127                $love_count_span = '';
    127128                if( !$loves ){
    128129                    $loves = 0;
     
    133134                elseif( $loves == 1 ) { $suffix = $suffix_text_one; }
    134135                else { $suffix = $suffix_text_more; }
    135 
    136                 return '<span class="cce-loveit-count">'. $loves .'</span><span class="cce-loveit-suffix">'. $suffix .'</span>';
     136               
     137                if( !($loves == 0 && $hide_count_if_zero) ) { $love_count_span = '<span class="cce-loveit-count">'. $loves .'</span>'; }
     138
     139                return $love_count_span.'<span class="cce-loveit-suffix">'. $suffix .'</span>';
    137140                break;
    138141
    139142            case 'update':
    140143                $loves = get_post_meta($post_id, '_cce_loves', true);
     144                $love_count_span = '';
    141145                if( isset($_COOKIE['cce_loves_'. $post_id]) ) return $loves;
    142146
     
    148152                elseif( $loves == 1 ) { $suffix = $suffix_text_one; }
    149153                else { $suffix = $suffix_text_more; }
    150 
    151                 return '<span class="cce-loveit-count">'. $loves .'</span><span class="cce-loveit-suffix">'. $suffix .'</span>';
     154               
     155                if( !($loves == 0 && $hide_count_if_zero) ) { $love_count_span = '<span class="cce-loveit-count">'. $loves .'</span>'; }
     156
     157                return $love_count_span.'<span class="cce-loveit-suffix">'. $suffix .'</span>';
    152158                break;
    153159
  • cc-essentials/trunk/readme.txt

    r1481829 r1511127  
    55Requires at least: 4.0
    66Tested up to: 4.5.2
    7 Stable tag: 1.0.0
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8888== Changelog ==
    8989
     90= 1.1 =
     91* Added 'Hide count of 0 loves received' feature.
     92* Updated FontAwesome library.
     93* Removed prefix span tag when prefix not added.
     94* Minor changes to descriptions of options and settings.
     95* Changed language domain to comply with WP plugin repository guidelines.
     96* Changed field ordering in CCE settings.
     97* Fixed a Google maps shortcode issue.
     98
    9099= 1.0.0 =
    91100* Initial release.
Note: See TracChangeset for help on using the changeset viewer.