Support » Plugin: Logo Carousel – Best Logo Slider and Clients Logo Gallery Plugin for WordPress » Enable shortcode to be displayed in widget content

  • Resolved dpowney

    (@dpowney)


    Hi there,

    Some page builders such as the SiteOrigin Page Builder allow you to drag and drop widgets onto the page. Therefore a user may decide to install a text like widget which allows you to display shortcodes e.g. the Shortcode Widget plugin.

    After upgrading to v3 of this plugin, I noticed the logo carousel is not loading the frontend scripts such as slick.js if it’s displayed within a custom widget. This obviously breaks the logo carousel.

    The plugin contains a check whether to load the frontend scripts or not. I have found a temporary workaround by simply returning true all the time.

    /**
    		 * Check if it should load frontend scripts
    		 *
    		 * @return mixed|void
    		 */
    		private function should_load_scripts() {
    			global $post;
    			$load_scripts = is_active_widget( false, false, 'widget_wpl_logo_carousel', true ) || ( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'logo_carousel_free' ) ) || ( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'logocarousel' ) );
    
    			return true; // apply_filters( 'logo_carousel_free_load_scripts', $load_scripts );
    		}

    Are you able to provide advice? Thanks,
    Daniel

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Enable shortcode to be displayed in widget content’ is closed to new replies.