Fatal error: Cannot redeclare tweakjp_sd_shortcode

Support Forums for LiveMesh Themes & Plugins Forums Fusion Theme Support Fatal error: Cannot redeclare tweakjp_sd_shortcode

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23666
    dtrounce
    Member

    New install of Fusion 2.1 on WordPress 4.6 with Jetpack 4.2.2

    Activating theme gives the following error:

    Fatal error: Cannot redeclare tweakjp_sd_shortcode() (previously declared in /wp/wp-content/plugins/jetpack-sharing-butttons-shortcode/jp-sd-shortcode.php:14) in /wp/wp-content/themes/fusion/framework/shortcodes/social-shortcodes.php on line 167

    WP admin site gives the same error and is unusable.

    Temporary workaround is to use a file editor to comment out the function tweakjp_sd_shortcode() in /wp/wp-content/plugins/jetpack-sharing-butttons-shortcode/jp-sd-shortcode.php

    But the theme should not conflict with Jetpack, and result in an unusable WP admin site.

    #23693
    dtrounce
    Member

    Ok, so it’s a conflict with the plug-in “Sharing buttons shortcode for Jetpack”, not Jetpack itself.

    But if you have that plug-in installed before installing the theme, you get this error. Maybe a warning to remove it before installing?

    #23706
    Raghavendra
    Moderator

    I have added a check in social-shortcodes.php file to ensure we don’t redeclare this method if it has already been defined. Will include the same in the next update. Thanks for bringing this to my attention.

    if (!function_exists('tweakjp_sd_shortcode')) {
        function tweakjp_sd_shortcode() {
            if (class_exists('Jetpack') && method_exists('Jetpack', 'get_active_modules') && in_array('sharedaddy', Jetpack::get_active_modules()))
                return sharing_display();
        }
    }
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Fusion Theme Support’ is closed to new topics and replies.