Changeset 1522446
- Timestamp:
- 10/26/2016 12:23:15 PM (9 years ago)
- Location:
- playbuzz/trunk
- Files:
-
- 1 deleted
- 3 edited
-
index.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
shortcodes.php (modified) (2 diffs)
-
widgets.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
playbuzz/trunk/index.php
r1457486 r1522446 32 32 include_once ( plugin_dir_path( __FILE__ ) . 'oembed.php' ); // Add oEmbed support 33 33 include_once ( plugin_dir_path( __FILE__ ) . 'shortcodes.php' ); // Add WordPress Shortcodes 34 include_once ( plugin_dir_path( __FILE__ ) . 'widgets.php' ); // Add WordPress Sidebar Widgets35 34 include_once ( plugin_dir_path( __FILE__ ) . 'tinymce.php' ); // Add TinyMCE plugin 36 35 -
playbuzz/trunk/readme.txt
r1457486 r1522446 4 4 Requires at least: 3.9 5 5 Tested up to: 4.5.2 6 Stable tag: 0.9. 36 Stable tag: 0.9.4 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 90 90 91 91 == Changelog == 92 93 = 0.9.4 (2016-10-26) = 94 * Deprecated embedding of recommendations widget 92 95 93 96 = 0.9.3 (2016-07-17) = -
playbuzz/trunk/shortcodes.php
r1431235 r1522446 35 35 add_shortcode( 'playbuzz-hub', 'playbuzz_section_shortcode' ); 36 36 add_shortcode( 'playbuzz-archive', 'playbuzz_section_shortcode' ); 37 38 39 40 /*41 * Recommendations / Related-Content Shortcode42 * 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.047 */48 add_shortcode( 'playbuzz-related', 'playbuzz_recommendations_shortcode' );49 add_shortcode( 'playbuzz-recommendations', 'playbuzz_recommendations_shortcode' );50 37 51 38 … … 185 172 } 186 173 187 /*188 * Shortcode functions189 *190 * @since 0.1.4191 */192 function playbuzz_recommendations_shortcode( $atts ) {193 194 // Load WordPress globals195 global $wp_version;196 197 // Load global site settings from DB198 $options = (array) get_option( 'playbuzz' );199 200 // Prepare site settings201 $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 any217 $atts = shortcode_atts(218 array(219 'key' => $site_key, // api key allowing configuration and analytics220 'view' => $site_view, // set view type221 'items' => $site_items, // number of items to display222 'links' => $site_links, // destination url in your site where new items will be displayed223 'tags' => $site_tags, // filter by tags224 'nostyle' => 'false', // set style225 ), $atts );226 227 // Playbuzz Embed Code228 $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 Visibility234 if ( 'content' == $embeddedon ) {235 // Show only in singular pages236 if ( is_singular() ) {237 return $code;238 }239 } elseif ( 'all' == $embeddedon ) {240 // Show in all pages241 return $code;242 }243 244 }
Note: See TracChangeset
for help on using the changeset viewer.