WordPress.org

Plugin Directory

Changeset 1654635


Ignore:
Timestamp:
05/10/17 20:49:06 (5 months ago)
Author:
ratkosolaja
Message:

Update plugin to version 1.1.0

Location:
rs-likes
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • rs-likes/tags/1.1.0/README.txt

    r1547007 r1654635  
    33Tags: likes, hearts 
    44Requires at least: 3.0 
    5 Tested up to: 4.7 
    6 Stable tag: 1.0.6 
     5Tested up to: 4.7.4 
     6Stable tag: 1.1.0 
    77License: GNU General Public License version 3.0 
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    5353Yes, I will still support and be in charge of the plugin. Basically, nothing changes except the name. 
    5454 
     55**How to change like button html?** 
     56I have created a nice filter for developers, and you can change the button to anything you like. 
     57    function like_button( $html ) { 
     58        $html = 'My Nice Icon'; 
     59 
     60        return $html; 
     61    } 
     62    add_filter( 'rs_likes_html', 'like_button', 10, 1 ); 
     63 
    5564== Screenshots == 
    5665 
     
    5968 
    6069== Changelog == 
     70 
     71= 1.1.0 = 
     72* Feature: Enable developers to replace icon with their own via custom HTML. 
     73* Feature: Ability to add shortcode outside singular pages. 
     74* Other: Added support for WP 4.7.4 
    6175 
    6276= 1.0.6 = 
  • rs-likes/tags/1.1.0/public/class-rs-likes-public.php

    r1497942 r1654635  
    100100         */ 
    101101 
    102         if ( is_singular() ) { 
    103  
    104             $options = get_option( $this->plugin_name . '-settings' ); 
    105             $like = __( 'Like', 'rs-like' ); 
    106             $dislike = __( 'Undo Like', 'rs-like' ); 
    107  
    108             if ( ! empty( $options['like-text'] ) ) { 
    109                 $like = $options['like-text']; 
    110             } 
    111             if ( ! empty( $options['dislike-text'] ) ) { 
    112                 $dislike = $options['dislike-text']; 
    113             } 
    114  
    115             wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/rs-likes-public.js', array( 'jquery' ), $this->version, false ); 
    116             wp_localize_script( 
    117                 $this->plugin_name, 
    118                 'rs_like_ajax', 
    119                 array( 
    120                     'ajax_url' => admin_url( 'admin-ajax.php' ), 
    121                     'like_txt' => $like, 
    122                     'undo_txt' => $dislike 
    123                 ) 
    124             ); 
    125         } 
     102        $options = get_option( $this->plugin_name . '-settings' ); 
     103        $like = __( 'Like', 'rs-like' ); 
     104        $dislike = __( 'Undo Like', 'rs-like' ); 
     105 
     106        if ( ! empty( $options['like-text'] ) ) { 
     107            $like = $options['like-text']; 
     108        } 
     109        if ( ! empty( $options['dislike-text'] ) ) { 
     110            $dislike = $options['dislike-text']; 
     111        } 
     112 
     113        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/rs-likes-public.js', array( 'jquery' ), $this->version, false ); 
     114        wp_localize_script( 
     115            $this->plugin_name, 
     116            'rs_like_ajax', 
     117            array( 
     118                'ajax_url' => admin_url( 'admin-ajax.php' ), 
     119                'like_txt' => $like, 
     120                'undo_txt' => $dislike 
     121            ) 
     122        ); 
    126123 
    127124    } 
     
    277274        self::nocache(); 
    278275 
    279         $object_id = get_queried_object_id(); 
     276        if ( is_singular() ) { 
     277            $object_id = get_queried_object_id(); 
     278        } else { 
     279            $object_id = get_the_ID(); 
     280        } 
    280281        $voted = false; 
    281282 
     
    327328        } 
    328329 
     330        $html_to_return = ''; 
     331        $inner_html_to_return = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" viewBox="0 0 64 64"><path d="M46 4c-4.808 0-8.662 1.726-12.060 5.126-0.002 0.002-0.004 0.004-0.006 0.006h-0.002l-1.932 2.434-1.932-2.286c-0.002-0.002-0.004-0.004-0.006-0.006h-0.002c-3.4-3.402-7.252-5.274-12.060-5.274s-9.328 1.872-12.728 5.272c-3.398 3.4-5.272 7.92-5.272 12.728 0 4.804 1.87 9.324 5.266 12.722l23.894 24.094c0.75 0.758 1.774 1.184 2.84 1.184s2.090-0.426 2.84-1.184l23.892-24.094c3.396-3.398 5.268-7.916 5.268-12.722 0-4.808-1.874-9.328-5.272-12.728-3.4-3.4-7.92-5.272-12.728-5.272v0z"></path></svg>'; 
     332 
    329333        if ( $voted == true ) { 
    330             return '<a href="#" class="like-button liked ' . $color_class . '" data-toggle="tooltip" data-placement="top" data-title="' . esc_attr( $dislike ) . '" data-count="' . esc_attr( $currentValue ) . '" data-nonce="' . wp_create_nonce( 'rs_object_like' ) . '" data-object-id="' . esc_attr( $object_id ) . '"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" viewBox="0 0 64 64"><path d="M46 4c-4.808 0-8.662 1.726-12.060 5.126-0.002 0.002-0.004 0.004-0.006 0.006h-0.002l-1.932 2.434-1.932-2.286c-0.002-0.002-0.004-0.004-0.006-0.006h-0.002c-3.4-3.402-7.252-5.274-12.060-5.274s-9.328 1.872-12.728 5.272c-3.398 3.4-5.272 7.92-5.272 12.728 0 4.804 1.87 9.324 5.266 12.722l23.894 24.094c0.75 0.758 1.774 1.184 2.84 1.184s2.090-0.426 2.84-1.184l23.892-24.094c3.396-3.398 5.268-7.916 5.268-12.722 0-4.808-1.874-9.328-5.272-12.728-3.4-3.4-7.92-5.272-12.728-5.272v0z"></path></svg></a>'; 
    331         } else { 
    332             return '<a href="#" class="like-button ' . $color_class . '" data-toggle="tooltip" data-placement="top" data-title="' . esc_attr( $like ) . '" data-count="' . esc_attr( $currentValue ) . '" data-nonce="' . wp_create_nonce( 'rs_object_like' ) . '" data-object-id="' . esc_attr( $object_id ) . '"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" viewBox="0 0 64 64"><path d="M46 4c-4.808 0-8.662 1.726-12.060 5.126-0.002 0.002-0.004 0.004-0.006 0.006h-0.002l-1.932 2.434-1.932-2.286c-0.002-0.002-0.004-0.004-0.006-0.006h-0.002c-3.4-3.402-7.252-5.274-12.060-5.274s-9.328 1.872-12.728 5.272c-3.398 3.4-5.272 7.92-5.272 12.728 0 4.804 1.87 9.324 5.266 12.722l23.894 24.094c0.75 0.758 1.774 1.184 2.84 1.184s2.090-0.426 2.84-1.184l23.892-24.094c3.396-3.398 5.268-7.916 5.268-12.722 0-4.808-1.874-9.328-5.272-12.728-3.4-3.4-7.92-5.272-12.728-5.272v0z"></path></svg></a>'; 
    333         } 
     334            $html_to_return .= '<a href="#" class="like-button liked ' . $color_class . '" data-toggle="tooltip" data-placement="top" data-title="' . esc_attr( $dislike ) . '" data-count="' . esc_attr( $currentValue ) . '" data-nonce="' . wp_create_nonce( 'rs_object_like' ) . '" data-object-id="' . esc_attr( $object_id ) . '">'; 
     335            $html_to_return .= apply_filters( 'rs_likes_html', $inner_html_to_return ); 
     336            $html_to_return .= '</a>'; 
     337        } else { 
     338            $html_to_return .= '<a href="#" class="like-button ' . $color_class . '" data-toggle="tooltip" data-placement="top" data-title="' . esc_attr( $like ) . '" data-count="' . esc_attr( $currentValue ) . '" data-nonce="' . wp_create_nonce( 'rs_object_like' ) . '" data-object-id="' . esc_attr( $object_id ) . '">'; 
     339            $html_to_return .= apply_filters( 'rs_likes_html', $inner_html_to_return ); 
     340            $html_to_return .= '</a>'; 
     341        } 
     342 
     343        return $html_to_return; 
    334344 
    335345    } 
  • rs-likes/tags/1.1.0/rs-likes.php

    r1519911 r1654635  
    99 * Plugin URI:  https://wordpress.org/plugins/rs-likes/ 
    1010 * Description: Adds support for Likes. 
    11  * Version:     1.0.6 
     11 * Version:     1.1.0 
    1212 * Author:      Simplicity LLC 
    1313 * Author URI:  http://www.simplicity.rs/ 
  • rs-likes/trunk/README.txt

    r1547007 r1654635  
    33Tags: likes, hearts 
    44Requires at least: 3.0 
    5 Tested up to: 4.7 
    6 Stable tag: 1.0.6 
     5Tested up to: 4.7.4 
     6Stable tag: 1.1.0 
    77License: GNU General Public License version 3.0 
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    5353Yes, I will still support and be in charge of the plugin. Basically, nothing changes except the name. 
    5454 
     55**How to change like button html?** 
     56I have created a nice filter for developers, and you can change the button to anything you like. 
     57    function like_button( $html ) { 
     58        $html = 'My Nice Icon'; 
     59 
     60        return $html; 
     61    } 
     62    add_filter( 'rs_likes_html', 'like_button', 10, 1 ); 
     63 
    5564== Screenshots == 
    5665 
     
    5968 
    6069== Changelog == 
     70 
     71= 1.1.0 = 
     72* Feature: Enable developers to replace icon with their own via custom HTML. 
     73* Feature: Ability to add shortcode outside singular pages. 
     74* Other: Added support for WP 4.7.4 
    6175 
    6276= 1.0.6 = 
  • rs-likes/trunk/public/class-rs-likes-public.php

    r1497942 r1654635  
    100100         */ 
    101101 
    102         if ( is_singular() ) { 
    103  
    104             $options = get_option( $this->plugin_name . '-settings' ); 
    105             $like = __( 'Like', 'rs-like' ); 
    106             $dislike = __( 'Undo Like', 'rs-like' ); 
    107  
    108             if ( ! empty( $options['like-text'] ) ) { 
    109                 $like = $options['like-text']; 
    110             } 
    111             if ( ! empty( $options['dislike-text'] ) ) { 
    112                 $dislike = $options['dislike-text']; 
    113             } 
    114  
    115             wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/rs-likes-public.js', array( 'jquery' ), $this->version, false ); 
    116             wp_localize_script( 
    117                 $this->plugin_name, 
    118                 'rs_like_ajax', 
    119                 array( 
    120                     'ajax_url' => admin_url( 'admin-ajax.php' ), 
    121                     'like_txt' => $like, 
    122                     'undo_txt' => $dislike 
    123                 ) 
    124             ); 
    125         } 
     102        $options = get_option( $this->plugin_name . '-settings' ); 
     103        $like = __( 'Like', 'rs-like' ); 
     104        $dislike = __( 'Undo Like', 'rs-like' ); 
     105 
     106        if ( ! empty( $options['like-text'] ) ) { 
     107            $like = $options['like-text']; 
     108        } 
     109        if ( ! empty( $options['dislike-text'] ) ) { 
     110            $dislike = $options['dislike-text']; 
     111        } 
     112 
     113        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/rs-likes-public.js', array( 'jquery' ), $this->version, false ); 
     114        wp_localize_script( 
     115            $this->plugin_name, 
     116            'rs_like_ajax', 
     117            array( 
     118                'ajax_url' => admin_url( 'admin-ajax.php' ), 
     119                'like_txt' => $like, 
     120                'undo_txt' => $dislike 
     121            ) 
     122        ); 
    126123 
    127124    } 
     
    277274        self::nocache(); 
    278275 
    279         $object_id = get_queried_object_id(); 
     276        if ( is_singular() ) { 
     277            $object_id = get_queried_object_id(); 
     278        } else { 
     279            $object_id = get_the_ID(); 
     280        } 
    280281        $voted = false; 
    281282 
     
    327328        } 
    328329 
     330        $html_to_return = ''; 
     331        $inner_html_to_return = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" viewBox="0 0 64 64"><path d="M46 4c-4.808 0-8.662 1.726-12.060 5.126-0.002 0.002-0.004 0.004-0.006 0.006h-0.002l-1.932 2.434-1.932-2.286c-0.002-0.002-0.004-0.004-0.006-0.006h-0.002c-3.4-3.402-7.252-5.274-12.060-5.274s-9.328 1.872-12.728 5.272c-3.398 3.4-5.272 7.92-5.272 12.728 0 4.804 1.87 9.324 5.266 12.722l23.894 24.094c0.75 0.758 1.774 1.184 2.84 1.184s2.090-0.426 2.84-1.184l23.892-24.094c3.396-3.398 5.268-7.916 5.268-12.722 0-4.808-1.874-9.328-5.272-12.728-3.4-3.4-7.92-5.272-12.728-5.272v0z"></path></svg>'; 
     332 
    329333        if ( $voted == true ) { 
    330             return '<a href="#" class="like-button liked ' . $color_class . '" data-toggle="tooltip" data-placement="top" data-title="' . esc_attr( $dislike ) . '" data-count="' . esc_attr( $currentValue ) . '" data-nonce="' . wp_create_nonce( 'rs_object_like' ) . '" data-object-id="' . esc_attr( $object_id ) . '"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" viewBox="0 0 64 64"><path d="M46 4c-4.808 0-8.662 1.726-12.060 5.126-0.002 0.002-0.004 0.004-0.006 0.006h-0.002l-1.932 2.434-1.932-2.286c-0.002-0.002-0.004-0.004-0.006-0.006h-0.002c-3.4-3.402-7.252-5.274-12.060-5.274s-9.328 1.872-12.728 5.272c-3.398 3.4-5.272 7.92-5.272 12.728 0 4.804 1.87 9.324 5.266 12.722l23.894 24.094c0.75 0.758 1.774 1.184 2.84 1.184s2.090-0.426 2.84-1.184l23.892-24.094c3.396-3.398 5.268-7.916 5.268-12.722 0-4.808-1.874-9.328-5.272-12.728-3.4-3.4-7.92-5.272-12.728-5.272v0z"></path></svg></a>'; 
    331         } else { 
    332             return '<a href="#" class="like-button ' . $color_class . '" data-toggle="tooltip" data-placement="top" data-title="' . esc_attr( $like ) . '" data-count="' . esc_attr( $currentValue ) . '" data-nonce="' . wp_create_nonce( 'rs_object_like' ) . '" data-object-id="' . esc_attr( $object_id ) . '"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" viewBox="0 0 64 64"><path d="M46 4c-4.808 0-8.662 1.726-12.060 5.126-0.002 0.002-0.004 0.004-0.006 0.006h-0.002l-1.932 2.434-1.932-2.286c-0.002-0.002-0.004-0.004-0.006-0.006h-0.002c-3.4-3.402-7.252-5.274-12.060-5.274s-9.328 1.872-12.728 5.272c-3.398 3.4-5.272 7.92-5.272 12.728 0 4.804 1.87 9.324 5.266 12.722l23.894 24.094c0.75 0.758 1.774 1.184 2.84 1.184s2.090-0.426 2.84-1.184l23.892-24.094c3.396-3.398 5.268-7.916 5.268-12.722 0-4.808-1.874-9.328-5.272-12.728-3.4-3.4-7.92-5.272-12.728-5.272v0z"></path></svg></a>'; 
    333         } 
     334            $html_to_return .= '<a href="#" class="like-button liked ' . $color_class . '" data-toggle="tooltip" data-placement="top" data-title="' . esc_attr( $dislike ) . '" data-count="' . esc_attr( $currentValue ) . '" data-nonce="' . wp_create_nonce( 'rs_object_like' ) . '" data-object-id="' . esc_attr( $object_id ) . '">'; 
     335            $html_to_return .= apply_filters( 'rs_likes_html', $inner_html_to_return ); 
     336            $html_to_return .= '</a>'; 
     337        } else { 
     338            $html_to_return .= '<a href="#" class="like-button ' . $color_class . '" data-toggle="tooltip" data-placement="top" data-title="' . esc_attr( $like ) . '" data-count="' . esc_attr( $currentValue ) . '" data-nonce="' . wp_create_nonce( 'rs_object_like' ) . '" data-object-id="' . esc_attr( $object_id ) . '">'; 
     339            $html_to_return .= apply_filters( 'rs_likes_html', $inner_html_to_return ); 
     340            $html_to_return .= '</a>'; 
     341        } 
     342 
     343        return $html_to_return; 
    334344 
    335345    } 
  • rs-likes/trunk/rs-likes.php

    r1519911 r1654635  
    99 * Plugin URI:  https://wordpress.org/plugins/rs-likes/ 
    1010 * Description: Adds support for Likes. 
    11  * Version:     1.0.6 
     11 * Version:     1.1.0 
    1212 * Author:      Simplicity LLC 
    1313 * Author URI:  http://www.simplicity.rs/ 
Note: See TracChangeset for help on using the changeset viewer.