__( "Publish slideshow on your website.", 'twoj_slideshow' ), ) ); } public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', $instance['title'] ); $slideshowId = $instance['slideshowId']; echo $args['before_widget']; if( ! empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; if( TWOJ_SLIDESHOW_PRO ){ twojSlideshowWidget($slideshowId); } if(!TWOJ_SLIDESHOW_PRO) echo _e( 'This widget available in Premium version','twoj_slideshow'); echo $args['after_widget']; } public function form( $instance ) { if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; } else { $title = __( 'New Slideshow', 'twoj_slideshow' ); } if ( isset( $instance[ 'slideshowId' ] ) ) { $slideshowId = (int) $instance[ 'slideshowId' ]; } else { $slideshowId = 0; } $args = array( 'child_of' => 0, 'sort_order' => 'ASC', 'sort_column' => 'post_title', 'hierarchical' => 1, 'selected' => $slideshowId, 'name' => $this->get_field_name( 'slideshowId' ), 'id' => $this->get_field_id( 'slideshowId' ), 'echo' => 1, 'post_type' => 'twoj_slideshow_post' ); ?>