芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/dt-the7-core/mods/team/public/widgets/team.php
'', 'show_excerpt' => '1', 'order' => 'DESC', 'orderby' => 'date', 'select' => 'all', 'show' => 6, 'cats' => array(), 'autoslide' => 0, ); /* Widget setup */ function __construct() { /* Widget settings. */ $widget_ops = array( 'description' => _x( 'Team', 'widget', 'dt-the7-core' ) ); /* Create the widget. */ parent::__construct( 'presscore-team', DT_WIDGET_PREFIX . _x( 'Team', 'widget', 'dt-the7-core' ), $widget_ops ); } /* Display the widget */ function widget( $args, $instance ) { extract( $args ); $instance = wp_parse_args( (array) $instance, self::$widget_defaults ); /* Our variables from the widget settings. */ $title = apply_filters( 'widget_title', $instance['title'] ); $args = array( 'no_found_rows' => 1, 'posts_per_page' => $instance['show'], 'post_type' => 'dt_team', 'post_status' => 'publish', 'orderby' => $instance['orderby'], 'order' => $instance['order'], 'suppress_filters' => false, 'tax_query' => array( array( 'taxonomy' => 'dt_team_category', 'field' => 'term_id', 'terms' => $instance['cats'] ) ), ); switch( $instance['select'] ) { case 'only': $args['tax_query'][0]['operator'] = 'IN'; break; case 'except': $args['tax_query'][0]['operator'] = 'NOT IN'; break; default: unset( $args['tax_query'] ); } $p_query = new WP_Query( $args ); $autoslide = absint($instance['autoslide']); echo $before_widget . "\n"; // title if ( $title ) { echo $before_title . $title . $after_title . "\n"; } if ( $p_query->have_posts() ) { echo '
', "\n"; // get config instance $config = presscore_config(); // backup and reset config $config_backup = $config->get(); $this->setup_config( $instance ); while( $p_query->have_posts() ) { $p_query->the_post(); presscore_populate_team_config(); $this->render_teammate( $instance ); } // while have posts wp_reset_postdata(); // restore config $config->reset($config_backup); echo '
', "\n"; } // if have posts echo $after_widget . "\n"; } /* Update the widget settings */ function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['show_excerpt'] = array_key_exists( 'show_excerpt', $new_instance ) ? 1 : 0; $instance['order'] = apply_filters('dt_sanitize_order', $new_instance['order']); $instance['orderby'] = apply_filters('dt_sanitize_orderby', $new_instance['orderby']); $instance['select'] = in_array( $new_instance['select'], array('all', 'only', 'except') ) ? $new_instance['select'] : 'all'; $instance['show'] = intval($new_instance['show']); $instance['cats'] = (array) $new_instance['cats']; if ( empty($instance['cats']) ) { $instance['select'] = 'all'; } $instance['autoslide'] = absint($new_instance['autoslide']); return $instance; } /** * Displays the widget settings controls on the widget panel. * Make use of the get_field_id() and get_field_name() function * when creating your form elements. This handles the confusing stuff. */ function form( $instance ) { /* Set up some default widget settings. */ $instance = wp_parse_args( (array) $instance, self::$widget_defaults ); $terms = get_terms( 'dt_team_category', array( 'hide_empty' => 1, 'hierarchical' => false ) ); $orderby_list = array( 'ID' => _x( 'Order by ID', 'widget', 'dt-the7-core' ), 'author' => _x( 'Order by author', 'widget', 'dt-the7-core' ), 'title' => _x( 'Order by title', 'widget', 'dt-the7-core' ), 'date' => _x( 'Order by date', 'widget', 'dt-the7-core' ), 'modified' => _x( 'Order by modified', 'widget', 'dt-the7-core' ), 'rand' => _x( 'Order by rand', 'widget', 'dt-the7-core' ), 'menu_order'=> _x( 'Order by menu', 'widget', 'dt-the7-core' ) ); ?>
/>
/>
/>
term_id, $instance['cats']) ); ?> />
name; ?>
/>
$name ): ?>
>
/>
/>
set( 'image_layout', 'resize' ); $config->set( 'thumb_proportions', array( 'width' => 1, 'height' => 1 ) ); $config->set( 'show_excerpts', $instance['show_excerpt'] ); $config->set( 'post.preview.content.visible', $instance['show_excerpt'] ); $config->set( 'post.preview.width.min', 370 ); $config->set( 'template.columns.number', 3 ); $config->set( 'post.preview.background.enabled', false ); $config->set( 'all_the_same_width', true ); } }