array( $this, 'render_callback' ), ) ); } public function get_label() { return __( 'Section', 'getwid' ); } public function block_frontend_assets( $attributes = array(), $content = '' ) { if ( is_admin() ) { return; } $has_background_slider = false !== strpos( $content, 'wp-block-getwid-section__background-slider-item' ); if ( ! empty( $attributes['entranceAnimation'] ) ) { wp_enqueue_script( 'wow' ); wp_enqueue_style( 'animate' ); } if ( $has_background_slider ) { wp_enqueue_script( 'slick' ); wp_enqueue_style( 'slick' ); wp_enqueue_style( 'slick-theme' ); wp_enqueue_script( 'imagesloaded' ); } } public function render_callback( $attributes, $content ) { $this->block_frontend_assets( $attributes, $content ); return $content; } } getwid()->blocksManager()->addBlock( new Section() );