WordPress.org

Plugin Directory

Changeset 625442


Ignore:
Timestamp:
11/14/12 23:33:10 (18 months ago)
Author:
niallkennedy
Message:

version 1.1.4. load comments number filter on all contexts if comments box enabled for one or more post types. subscribe settings fix. max_age recommendations bar fix.

Location:
facebook/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • facebook/trunk/admin/settings-subscribe-button.php

    r624937 r625442  
    478478        unset( $options['show_on'] ); 
    479479 
     480        // href required for subscribe button 
     481        // set href contextual to the post author, not at settings 
     482        // fake it here to pass sanitization, then remove before save 
     483        $options['href'] = 'https://www.facebook.com/zuck'; 
     484 
    480485        $subscribe_button = Facebook_Subscribe_Button::fromArray( $options ); 
    481         if ( $subscribe_button ) 
    482             return array_merge( $clean_options, self::html_data_to_options( $subscribe_button->toHTMLDataArray() ) ); 
     486        if ( $subscribe_button ) { 
     487            $subscribe_button_options = self::html_data_to_options( $subscribe_button->toHTMLDataArray() ); 
     488 
     489            // remove the dummy value set above 
     490            // remove here instead of html_data_to_options to separate widget usage with its real href 
     491            unset( $subscribe_button_options['href'] ); 
     492 
     493            return array_merge( $clean_options, $subscribe_button_options ); 
     494        } 
    483495 
    484496        return $clean_options; 
  • facebook/trunk/facebook.php

    r624963 r625442  
    22/** 
    33 * @package Facebook 
    4  * @version 1.1.3 
     4 * @version 1.1.4 
    55 */ 
    66/* 
     
    1010Author: Facebook 
    1111Author URI: https://developers.facebook.com/wordpress/ 
    12 Version: 1.1.3 
     12Version: 1.1.4 
    1313License: GPL2 
    1414License URI: license.txt 
     
    2929     * @var string 
    3030     */ 
    31     const VERSION = '1.1.3'; 
     31    const VERSION = '1.1.4'; 
    3232 
    3333    /** 
     
    215215        add_action( 'wp_enqueue_scripts', array( 'Facebook_Loader', 'enqueue_jssdk' ) ); 
    216216 
     217        // include comment count filters on all pages 
     218        if ( get_option( 'facebook_comments_enabled' ) ) { 
     219            add_filter( 'comments_array', '__return_null' ); 
     220            add_filter( 'comments_open', '__return_true' ); // comments are always open 
     221 
     222            // short-circuit special template behavior for comment count = 0 
     223            // prevents linking to #respond anchor which leads nowhere 
     224            add_filter( 'get_comments_number', create_function('', 'return -1;') ); 
     225 
     226            if ( ! class_exists( 'Facebook_Comments' ) ) 
     227                require_once( $this->plugin_directory . 'social-plugins/class-facebook-comments.php' ); 
     228 
     229            // display comments number if used in template 
     230            add_filter( 'comments_number', array( 'Facebook_Comments', 'comments_count_xfbml' ) ); 
     231        } 
     232 
     233        // check for enabled features by page type 
    217234        $enabled_features = array(); 
    218235        $option_name = 'facebook_%s_features'; 
     
    260277                add_filter( 'the_content', array( 'Facebook_Comments', 'the_content_comments_box' ), $priority ); 
    261278                add_action( 'wp_enqueue_scripts', array( 'Facebook_Comments', 'css_hide_comments' ), 0 ); 
    262                 add_filter( 'comments_array', '__return_null' ); 
    263                 add_filter( 'comments_open', '__return_true' ); // comments are always open 
    264  
    265                 // display comments number if used in template 
    266                 add_filter( 'comments_number', array( 'Facebook_Comments', 'comments_count_xfbml' ) ); 
    267  
    268                 // short-circuit special template behavior for comment count = 0 
    269                 // prevents linking to #respond anchor which leads nowhere 
    270                 add_filter( 'get_comments_number', create_function('', 'return -1;') ); 
    271279            } 
    272280        } 
  • facebook/trunk/open-graph-protocol.php

    r624963 r625442  
    137137                $meta_tags[ self::OGP_NS . 'url' ] = home_url(); 
    138138        } else if ( is_single() && empty( $post->post_password ) ) { 
     139            setup_postdata( $post ); 
    139140            $post_type = get_post_type(); 
    140141            $meta_tags[ self::OGP_NS . 'type' ] = 'article'; 
  • facebook/trunk/readme.txt

    r624963 r625442  
    66License: GPLv2 
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html 
    8 Stable tag: 1.1.3 
     8Stable tag: 1.1.4 
    99 
    1010Make your WordPress site social in a couple of clicks, powered by Facebook. 
     
    106106== Upgrade Notice == 
    107107 
     108= 1.1.4 = 
     109Comments number filter available on all contexts when comments box enabled for one or more post types. 
     110 
    108111= 1.1.3 = 
    109112Fix recommendations bar issue and PHP issue affecting 5.2.4 - 5.2.8 installs. 
     
    122125 
    123126== Changelog == 
     127 
     128= 1.1.4 = 
     129 
     130* Comment counts powered by Facebook available in all page contexts when comments box social plugin enabled for one or more post types. 
     131* Subscribe button settings fix 
     132* Recommendations Bar max age setting fix 
    124133 
    125134= 1.1.3 = 
  • facebook/trunk/social-plugins/class-facebook-recommendations-bar.php

    r624963 r625442  
    299299            $data['num-recommendations'] = strval( $this->num_recommendations ); 
    300300 
    301         if ( isset( $this->max_age ) && $this->max_age !== 0 ) // default: 0 (no limit) 
     301        if ( isset( $this->max_age ) && $this->max_age != 0 ) // default: 0 (no limit) 
    302302            $data['max-age'] = $this->max_age; 
    303303 
     
    353353 
    354354        if ( isset( $values['max_age'] ) ) 
    355             $bar->setMaxAge( $values['max_age'] ); 
     355            $bar->setMaxAge( absint( $values['max_age'] ) ); 
    356356 
    357357        return $bar; 
  • facebook/trunk/social-plugins/social-plugins.php

    r624328 r625442  
    199199 
    200200/** 
    201  * Add Send Button(s) to post content 
    202  * Adds a send button above the post, below the post, or both above and below the post depending on stored preferences. 
     201 * Add Subscribe Button(s) to post content 
     202 * Adds a subscribe button above the post, below the post, or both above and below the post depending on stored preferences. 
    203203 * 
    204204 * @since 1.1 
    205205 * @param string $content existing content 
    206  * @return string passed content with Send Button markup prepended, appended, or both. 
     206 * @return string passed content with Subscribe Button markup prepended, appended, or both. 
    207207 */ 
    208208function facebook_the_content_subscribe_button( $content ) { 
Note: See TracChangeset for help on using the changeset viewer.