Gestionnaire de fichiers - Editer - /home/wwgoat/public_html/blog/wp-content/plugins/foxiz-core/widgets/sb-post.php
Arrière
<?php if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Foxiz_W_Post', false ) ) : class Foxiz_W_Post extends WP_Widget { private $params = array(); private $widgetID = 'widget-post'; function __construct() { $this->params = array( 'title' => '', 'posts_per_page' => '4', 'category' => '', 'categories' => '', 'tags' => '', 'tag_not_in' => '', 'format' => '0', 'post_not_in' => '', 'post_in' => '', 'offset' => '', 'featured_position' => '', 'order' => 'date_post', 'entry_meta' => 'category' ); parent::__construct( $this->widgetID, esc_html__( 'Foxiz - Post Listing', 'foxiz-core' ), array( 'classname' => $this->widgetID, 'description' => esc_html__( '[Sidebar Widget] Display a small list latest post listing in the sidebar.', 'foxiz-core' ) ) ); } function update( $new_instance, $old_instance ) { if ( current_user_can( 'unfiltered_html' ) ) { return wp_parse_args( (array) $new_instance, $this->params ); } else { $instance = array(); foreach ( $new_instance as $id => $value ) { $instance[ $id ] = sanitize_text_field( $value ); } return wp_parse_args( $instance, $this->params ); } } function form( $instance ) { $instance = wp_parse_args( (array) $instance, $this->params ); foxiz_create_widget_text_field( array( 'id' => $this->get_field_id( 'title' ), 'name' => $this->get_field_name( 'title' ), 'title' => esc_html__( 'Title', 'foxiz-core' ), 'value' => $instance['title'] ) ); foxiz_create_widget_select_field( array( 'id' => $this->get_field_id( 'category' ), 'name' => $this->get_field_name( 'category' ), 'title' => esc_html__( 'Category Filter', 'foxiz-core' ), 'description' => esc_html__( 'Select a category you would like to show.', 'foxiz-core' ), 'data' => 'category', 'value' => $instance['category'] ) ); foxiz_create_widget_text_field( array( 'id' => $this->get_field_id( 'categories' ), 'name' => $this->get_field_name( 'categories' ), 'title' => esc_html__( 'Categories Filter', 'foxiz-core' ), 'description' => esc_html__( 'Filter posts by multiple category IDs, separated category IDs by commas (for example: 1,2,3).', 'foxiz-core' ), 'value' => $instance['categories'] ) ); foxiz_create_widget_text_field( array( 'id' => $this->get_field_id( 'tags' ), 'name' => $this->get_field_name( 'tags' ), 'title' => esc_html__( 'Tags Slug Filter', 'foxiz-core' ), 'description' => esc_html__( 'Filter posts by tag slugs, separated by commas (for example: tagslug1,tagslug2,tagslug3).', 'foxiz-core' ), 'value' => $instance['tags'] ) ); foxiz_create_widget_text_field( array( 'id' => $this->get_field_id( 'tag_not_in' ), 'name' => $this->get_field_name( 'tag_not_in' ), 'title' => esc_html__( 'Exclude Tags Slug', 'foxiz-core' ), 'description' => esc_html__( 'Exclude tag slugs, separated by commas (for example: tagslug1,tagslug2,tagslug3).', 'foxiz-core' ), 'value' => $instance['tag_not_in'] ) ); foxiz_create_widget_select_field( array( 'id' => $this->get_field_id( 'format' ), 'name' => $this->get_field_name( 'format' ), 'title' => esc_html__( 'Post Format', 'foxiz-core' ), 'description' => esc_html__( 'Filter posts by post format.', 'foxiz-core' ), 'options' => array( '0' => esc_html__( '-- All --', 'foxiz-core' ), 'default' => esc_html__( '- Default -', 'foxiz-core' ), 'gallery' => esc_html__( 'Gallery', 'foxiz-core' ), 'video' => esc_html__( 'Video', 'foxiz-core' ), 'audio' => esc_html__( 'Audio', 'foxiz-core' ) ), 'value' => $instance['format'], ) ); foxiz_create_widget_text_field( array( 'id' => $this->get_field_id( 'post_not_in' ), 'name' => $this->get_field_name( 'post_not_in' ), 'title' => esc_html__( 'Exclude Post IDs', 'foxiz-core' ), 'description' => esc_html__( 'Exclude posts by Post IDs, separated by commas (for example: 1,2,3).', 'foxiz-core' ), 'value' => $instance['post_not_in'] ) ); foxiz_create_widget_text_field( array( 'id' => $this->get_field_id( 'post_in' ), 'name' => $this->get_field_name( 'post_in' ), 'title' => esc_html__( 'Post IDs Filter', 'foxiz-core' ), 'description' => esc_html__( 'Filter posts by post IDs. separated by commas (for example: 1,2,3).', 'foxiz-core' ), 'value' => $instance['post_in'] ) ); foxiz_create_widget_select_field( array( 'id' => $this->get_field_id( 'order' ), 'name' => $this->get_field_name( 'order' ), 'title' => esc_html__( 'Order By', 'foxiz-core' ), 'options' => array( 'date_post' => esc_html__( 'Latest Posts', 'foxiz-core' ), 'update' => esc_html__( 'Last Updated', 'foxiz-core' ), 'comment_count' => esc_html__( 'Popular Comment', 'foxiz-core' ), 'popular' => esc_html__( 'Popular', 'foxiz-core' ), 'popular_m' => esc_html__( 'Popular Published last 30 Days', 'foxiz-core' ), 'popular_w' => esc_html__( 'Popular Published last 7 Days', 'foxiz-core' ), 'top_review' => esc_html__( 'Top Review', 'foxiz-core' ), 'last_review' => esc_html__( 'Latest Review', 'foxiz-core' ), 'post_type' => esc_html__( 'Post Type', 'foxiz-core' ), 'sponsored' => esc_html__( 'Latest Sponsored', 'foxiz-core' ), 'rand' => esc_html__( 'Random', 'foxiz-core' ), 'author' => esc_html__( 'Author', 'foxiz-core' ), 'alphabetical_order_decs' => esc_html__( 'Title DECS', 'foxiz-core' ), 'alphabetical_order_asc' => esc_html__( 'Title ACS', 'foxiz-core' ), 'by_input' => esc_html__( 'by input IDs Data (Post IDs filter)', 'foxiz-core' ) ), 'value' => $instance['order'], ) ); foxiz_create_widget_text_field( array( 'id' => $this->get_field_id( 'posts_per_page' ), 'name' => $this->get_field_name( 'posts_per_page' ), 'title' => esc_html__( 'Posts per Page', 'foxiz-core' ), 'value' => $instance['posts_per_page'] ) ); foxiz_create_widget_text_field( array( 'id' => $this->get_field_id( 'offset' ), 'name' => $this->get_field_name( 'offset' ), 'title' => esc_html__( 'Post Offset', 'foxiz-core' ), 'description' => esc_html__( 'Select number of posts to pass over. Leave this option blank to set at the beginning.', 'foxiz-core' ), 'value' => $instance['offset'] ) ); foxiz_create_widget_text_field( array( 'id' => $this->get_field_id( 'entry_meta' ), 'name' => $this->get_field_name( 'entry_meta' ), 'title' => esc_html__( 'Entry Meta Tags', 'foxiz-core' ), 'description' => esc_html__( 'Input custom entry meta tags to show, separate by comma. For example: avatar,author,date. Keys include: [avatar, author, date, category, tag, view, comment, update, read, custom]', 'foxiz-core' ), 'value' => $instance['entry_meta'] ) ); foxiz_create_widget_select_field( array( 'id' => $this->get_field_id( 'featured_position' ), 'name' => $this->get_field_name( 'featured_position' ), 'title' => esc_html__( 'Featured Position', 'foxiz-core' ), 'options' => array( '0' => esc_html__( 'Left', 'foxiz-core' ), 'right' => esc_html__( 'Right', 'foxiz-core' ) ), 'value' => $instance['featured_position'] ) ); } function widget( $args, $instance ) { $instance = wp_parse_args( (array) $instance, $this->params ); $instance['review'] = 'replace'; if ( empty( $instance['entry_meta'] ) ) { $instance['entry_meta'] = 'category'; } else { $instance['entry_meta'] = strval( $instance['entry_meta'] ); } if ( ! function_exists( 'foxiz_query' ) || ! function_exists( 'foxiz_loop_list_small_2' ) ) { return false; } echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . esc_html( $instance['title'] ) . $args['after_title']; } $_query = foxiz_query( $instance ); echo '<div class="widget-p-listing">'; if ( $_query->have_posts() ) { foxiz_loop_list_small_2( $instance, $_query ); wp_reset_postdata(); } echo '</div>'; echo $args['after_widget']; } } endif;
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0 |
proxy
|
phpinfo
|
Réglages