// SYSTEM PANEL //
[ROOT]
/
home
/
salvufkx
/
homedir
/
public_html
/
wp-content
/
plugins
/
gallery-images-ape
/
libs
[ PARENT ]
EDIT :: widget.php
<?php /* * Ape Gallery http://wpape.net * Version: 1.2.4 - 61253 * Author: Wp Ape (c) * Author URI: http://wpape.net * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt * Date: Thu, 08 Dec 2016 16:31:35 GMT */ class wpApeGalleryWidget extends WP_Widget { function __construct(){ parent::__construct( 'wpApeGalleryWidget', __( 'Ape Gallery' , 'wpape_gallery' ), array( 'description' => __( "Add Ape Gallery to the frontend", 'wpape_gallery' ), ) ); } public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', $instance['title'] ); $galleryId = $instance['galleryId']; echo $args['before_widget']; if( ! empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; if( function_exists( 'wpape_premium_widget' ) ){ wpape_premium_widget($galleryId); } if(!WPAPE_GALLERY_PREMIUM) echo _e( 'Please activate PREMIUM version to enable this widget','wpape_gallery'); echo $args['after_widget']; } public function form( $instance ) { if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; } else { $title = __( 'Ape gallery', 'wpape_gallery' ); } if ( isset( $instance[ 'galleryId' ] ) ) { $galleryId = (int) $instance[ 'galleryId' ]; } else { $galleryId = 0; } $args = array( 'child_of' => 0, 'sort_order' => 'ASC', 'sort_column' => 'post_title', 'hierarchical' => 1, 'selected' => $galleryId, 'name' => $this->get_field_name( 'galleryId' ), 'id' => $this->get_field_id( 'galleryId' ), 'echo' => 1, 'post_type' => WPAPE_GALLERY_POST ); ?> <?php if(!WPAPE_GALLERY_PREMIUM){ ?> <p><a href="http://wpape.net/open.php?type=gallery&action=premium" target="_blank"> <?php _e( 'Please activate PREMIUM version','wpape_gallery');?> </a></p> <?php } ?> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"> <?php _e( 'Title' ); ?>: </label> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id( 'galleryId' ); ?>"><?php _e( 'Gallery:' ); ?></label> <?php wp_dropdown_pages( $args ); ?> </p> <p><?php _e( 'First setup some gallery in ','wpape_gallery');?> <a href="edit.php?post_type=<?php echo WPAPE_GALLERY_POST; ?>"> <?php _e( 'Ape Gallery manager','wpape_gallery');?> </a> </p> <script type="text/javascript">jQuery(function(){ jQuery('#<?php echo $this->get_field_id( 'galleryId' ); ?>').addClass('widefat'); });</script> <?php } public function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : ''; $instance['galleryId'] = ( ! empty( $new_instance['galleryId'] ) ) ? (int) $new_instance['galleryId'] : 0; return $instance; } } function wpApeGalleryLoadWidget() { register_widget( 'wpApeGalleryWidget' ); } add_action( 'widgets_init', 'wpApeGalleryLoadWidget' );
SAVE
CANCEL