WordPress.org

Ready to get started?Download WordPress

Forums

SlideShare for WordPress by Yoast
Actually breaks 3.5's Slideshare embed (2 posts)

  1. Jason Lemahieu (MadtownLems)
    Member
    Posted 1 year ago #

    On WordPress 3.5, I made a post that contained both a link to a slideshare presentation on its own line, and the [slideshare ...] shortcode.

    Without this plugin enabled, the "own line" link to slideshare perfectly embedded, and I saw the "[slideshare ...]" text on the screen - which is, of course, expected behavior.

    WITH this plugin enabled, the shortcode continues to be turned into an embed, however, the native slideshare embedding is broken, and there is no output at all, other than these notices:

    Notice: Undefined variable: new_html in /data/apache/lamp/dev4-ces-lamp/docs/wp-content/plugins/slideshare/slideshare.php on line 179

    Notice: Undefined index: w in /data/apache/lamp/dev4-ces-lamp/docs/wp-content/plugins/slideshare/slideshare.php on line 136

    My suggested fix would be something like this inside v2.0 of your plugin:

    If wp_version >= 3.5, replace [slideshare ...] code with normal text links to the slideshare, and let WP handle the rest

    if wp_version < 3.5, keep on keepin' on (like before)

    thoughts?

    http://wordpress.org/extend/plugins/slideshare/

  2. lenasterg
    Member
    Posted 1 year ago #

    Jason hi,
    Another option is to unistall the plugin and write in your custom.php file the following in order to create the shortcode for slideshare

    add_shortcode( 'slideshare', 'my_slideshare_shortcode' );
    
    function my_slideshare_shortcode( $atts ) {
    
    // We need to use the WP_Embed class instance
    global $wp_embed;
    
    // The "id" parameter is required
    if ( empty($atts['id']) )
    return '';
    
    // Construct the YouTube URL
    $url = 'http://www.slideshare.net/slideshow/embed_code/' . $atts['id'];
    
    // Run the URL through the handler.
    // This handler handles calling the oEmbed class
    // and more importantly will also do the caching!
    return $wp_embed->shortcode( $atts, $url );
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.