Plugin Directory

Changeset 1522446


Ignore:
Timestamp:
10/26/2016 12:23:15 PM (9 years ago)
Author:
playbuzz
Message:

Deprecating widget.js

Location:
playbuzz/trunk
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • playbuzz/trunk/index.php

    r1457486 r1522446  
    3232include_once ( plugin_dir_path( __FILE__ ) . 'oembed.php' );         // Add oEmbed support
    3333include_once ( plugin_dir_path( __FILE__ ) . 'shortcodes.php' );     // Add WordPress Shortcodes
    34 include_once ( plugin_dir_path( __FILE__ ) . 'widgets.php' );        // Add WordPress Sidebar Widgets
    3534include_once ( plugin_dir_path( __FILE__ ) . 'tinymce.php' );        // Add TinyMCE plugin
    3635
  • playbuzz/trunk/readme.txt

    r1457486 r1522446  
    44Requires at least: 3.9
    55Tested up to: 4.5.2
    6 Stable tag: 0.9.3
     6Stable tag: 0.9.4
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    9090
    9191== Changelog ==
     92
     93= 0.9.4 (2016-10-26) =
     94* Deprecated embedding of recommendations widget
    9295
    9396= 0.9.3 (2016-07-17) =
  • playbuzz/trunk/shortcodes.php

    r1431235 r1522446  
    3535add_shortcode( 'playbuzz-hub',     'playbuzz_section_shortcode' );
    3636add_shortcode( 'playbuzz-archive', 'playbuzz_section_shortcode' );
    37 
    38 
    39 
    40 /*
    41  * Recommendations / Related-Content Shortcode
    42  * Display playbuzz related playful content links and recommendations according specific tags in a desired location on your content.
    43  *
    44  * usage: [playbuzz-recommendations tags="Celebrities" links="https://www.mysite.com/url_in_your_site_where_you_displayed_playbuzz_items"]
    45  *
    46  * @since 0.1.0
    47  */
    48 add_shortcode( 'playbuzz-related',         'playbuzz_recommendations_shortcode' );
    49 add_shortcode( 'playbuzz-recommendations', 'playbuzz_recommendations_shortcode' );
    5037
    5138
     
    185172}
    186173
    187 /*
    188  * Shortcode functions
    189  *
    190  * @since 0.1.4
    191  */
    192 function playbuzz_recommendations_shortcode( $atts ) {
    193 
    194     // Load WordPress globals
    195     global $wp_version;
    196 
    197     // Load global site settings from DB
    198     $options = (array) get_option( 'playbuzz' );
    199 
    200     // Prepare site settings
    201     $site_key       = ( ( ( array_key_exists( 'key',               $options ) ) ) ? $options['key']   : str_replace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) ) );
    202     $site_view      = ( ( ( array_key_exists( 'view',              $options ) ) ) ? $options['view']  : 'large_images' );
    203     $site_items     = ( ( ( array_key_exists( 'items',             $options ) ) ) ? $options['items'] : 3 );
    204     $site_links     = ( ( ( array_key_exists( 'links',             $options ) ) ) ? $options['links'] : 'https://www.playbuzz.com' );
    205     $site_tags      = '';
    206     $site_tags     .= ( ( ( array_key_exists( 'tags-mix',          $options ) ) && ( '1' == $options['tags-mix']          ) ) ? 'All,'                  : '' );
    207     $site_tags     .= ( ( ( array_key_exists( 'tags-fun',          $options ) ) && ( '1' == $options['tags-fun']          ) ) ? 'Fun,'                  : '' );
    208     $site_tags     .= ( ( ( array_key_exists( 'tags-pop',          $options ) ) && ( '1' == $options['tags-pop']          ) ) ? 'Pop,'                  : '' );
    209     $site_tags     .= ( ( ( array_key_exists( 'tags-geek',         $options ) ) && ( '1' == $options['tags-geek']         ) ) ? 'Geek,'                 : '' );
    210     $site_tags     .= ( ( ( array_key_exists( 'tags-sports',       $options ) ) && ( '1' == $options['tags-sports']       ) ) ? 'Sports,'               : '' );
    211     $site_tags     .= ( ( ( array_key_exists( 'tags-editors-pick', $options ) ) && ( '1' == $options['tags-editors-pick'] ) ) ? 'EditorsPick_Featured,' : '' );
    212     $site_tags     .= ( ( ( array_key_exists( 'more-tags',         $options ) ) ) ? $options['more-tags']  : '' );
    213     $site_tags      = rtrim( $site_tags, ',' );
    214     $embeddedon     = ( ( ( array_key_exists( 'embeddedon',        $options ) ) ) ? $options['embeddedon'] : 'content' );
    215 
    216     // Set default attribute values if the user did not defined any
    217     $atts = shortcode_atts(
    218         array(
    219             'key'     => $site_key,   // api key allowing configuration and analytics
    220             'view'    => $site_view,  // set view type
    221             'items'   => $site_items, // number of items to display
    222             'links'   => $site_links, // destination url in your site where new items will be displayed
    223             'tags'    => $site_tags,  // filter by tags
    224             'nostyle' => 'false',     // set style
    225         ), $atts );
    226 
    227     // Playbuzz Embed Code
    228     $code = '
    229         <script type="text/javascript" src="//cdn.playbuzz.com/widget/widget.js"></script>
    230         <div class="pb_recommendations" data-provider="WordPress ' . esc_attr( $wp_version ) . '" data-key="' . esc_attr( $atts['key'] ) . '" data-tags="' . esc_attr( $atts['tags'] ) . '" data-view="' . esc_attr( $atts['view'] ) . '" data-num-items="' . esc_attr( $atts['items'] ) . '" data-links="' . esc_attr( $atts['links'] ) . '" data-nostyle="' . esc_attr( $atts['nostyle'] ) . '"></div>
    231     ';
    232 
    233     // Theme Visibility
    234     if ( 'content' == $embeddedon ) {
    235         // Show only in singular pages
    236         if ( is_singular() ) {
    237             return $code;
    238         }
    239     } elseif ( 'all' == $embeddedon ) {
    240         // Show in all pages
    241         return $code;
    242     }
    243 
    244 }
Note: See TracChangeset for help on using the changeset viewer.