/var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/trx_utils/widgets
NameSizeModeActions
qrcode/-0755rm
banner.php94920644editdlrm
calendar.php72850644editdlrm
categories.php118820644editdlrm
flickr.php85560644editdlrm
give.php70330644editdlrm
popular_posts.php218730644editdlrm
recent_posts.php176580644editdlrm
recent_reviews.php183700644editdlrm
socials.php135440644editdlrm
top10.php209310644editdlrm
twitter.php133970644editdlrm
Edit: /var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/trx_utils/widgets/top10.php (20931B)
'widget_top10', 'description' => esc_html__('Top 10 posts by average reviews marks (by author and users)', 'trx_utils')); parent::__construct( 'charity_is_hope_widget_top10', esc_html__('Charity Is Hope - Top 10 Posts', 'trx_utils'), $widget_ops ); // Add thumb sizes into list charity_is_hope_add_thumb_sizes( array( 'layout' => 'widgets', 'w' => 75, 'h' => 75, 'title'=>esc_html__('Widgets', 'trx_utils') ) ); } // Show widget function widget($args, $instance) { extract($args); global $post; $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : ''); $title_tabs = array( isset($instance['title_author']) ? $instance['title_author'] : '', isset($instance['title_users']) ? $instance['title_users'] : '' ); $post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post'; $category = isset($instance['category']) ? (int) $instance['category'] : 0; $taxonomy = charity_is_hope_get_taxonomy_categories_by_post_type($post_type); $number = isset($instance['number']) ? (int) $instance['number'] : ''; $show_date = isset($instance['show_date']) ? (int) $instance['show_date'] : 0; $show_image = isset($instance['show_image']) ? (int) $instance['show_image'] : 0; $show_author = isset($instance['show_author']) ? (int) $instance['show_author'] : 0; $show_counters = isset($instance['show_counters']) ? (int) $instance['show_counters'] : 0; $show_counters = $show_counters==2 ? 'stars' : ($show_counters==1 ? 'rating' : ''); $titles = ''; $content = ''; $id = 'widget_top10_'.str_replace('.', '', mt_rand()); $reviews_first_author = charity_is_hope_get_theme_option('reviews_first')=='author'; $reviews_second_hide = charity_is_hope_get_theme_option('reviews_second')=='hide'; for ($i=0; $i<2; $i++) { if ($i==0 && !$reviews_first_author && $reviews_second_hide) continue; if ($i==1 && $reviews_first_author && $reviews_second_hide) continue; $post_rating = charity_is_hope_storage_get('options_prefix').'_reviews_avg'.($i==0 ? '' : '2'); $args = array( 'post_type' => $post_type, 'post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'post_password' => '', 'posts_per_page' => $number, 'ignore_sticky_posts' => true, 'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => $post_rating ); if ($category > 0) { if ($taxonomy=='category') $args['cat'] = $category; else { $args['tax_query'] = array( array( 'taxonomy' => $taxonomy, 'field' => 'id', 'terms' => $category ) ); } } $ex = charity_is_hope_get_theme_option('exclude_cats'); if (!empty($ex)) { $args['category__not_in'] = explode(',', $ex); } $q = new WP_Query($args); if ($q->have_posts()) { $post_number = 0; $output = ''; while ($q->have_posts()) { $q->the_post(); $post_number++; charity_is_hope_template_set_args('widgets-posts', array( 'post_number' => $post_number, 'post_rating' => $post_rating, 'show_date' => $show_date, 'show_image' => $show_image, 'show_author' => $show_author, 'show_counters' => $show_counters )); get_template_part(charity_is_hope_get_file_slug('templates/_parts/widgets-posts.php')); $output .= charity_is_hope_storage_get('widgets_posts_output'); if ($post_number >= $number) break; } if ( !empty($output) ) { $titles .= '
  • '.esc_html($title_tabs[$i]).'
  • '; $content .= '
    ' . $output . '
    '; } } } wp_reset_postdata(); if ( !empty($titles) ) { // Before widget (defined by themes) charity_is_hope_show_layout($before_widget); // Display the widget title if one was input (before and after defined by themes) if ($title) charity_is_hope_show_layout($title, $before_title, $after_title); ?>
    '', 'title_author' => '', 'title_users' => '', 'number' => '4', 'show_date' => '1', 'show_image' => '1', 'show_author' => '1', 'show_counters' => '1', 'category'=>'0', 'post_type' => 'post' ) ); $title = $instance['title']; $title_author = $instance['title_author']; $title_users = $instance['title_users']; $number = (int) $instance['number']; $show_date = (int) $instance['show_date']; $show_image = (int) $instance['show_image']; $show_author = (int) $instance['show_author']; $show_counters = (int) $instance['show_counters']; $post_type = $instance['post_type']; $category = (int) $instance['category']; $posts_types = charity_is_hope_get_list_posts_types(false); $categories = charity_is_hope_get_list_terms(false, charity_is_hope_get_taxonomy_categories_by_post_type($post_type)); ?>


    /> />


    /> />


    /> />


    /> /> />

    "", "title_author" => "", "title_users" => "", "number" => 4, "show_date" => 1, "show_image" => 1, "show_author" => 1, "show_counters" => 1, 'category' => '', 'cat' => 0, 'post_type' => 'post', // Common params "id" => "", "class" => "", "css" => "" ), $atts)); if ($atts['post_type']=='') $atts['post_type'] = 'post'; if ($atts['cat']!='' && $atts['category']=='') $atts['category'] = $atts['cat']; if ($atts['show_date']=='') $atts['show_date'] = 0; if ($atts['show_image']=='') $atts['show_image'] = 0; if ($atts['show_author']=='') $atts['show_author'] = 0; if ($atts['show_counters']=='') $atts['show_counters'] = 0; extract($atts); $type = 'charity_is_hope_widget_top10'; $output = ''; global $wp_widget_factory; if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) { $output = ''; ob_start(); the_widget( $type, $atts, charity_is_hope_prepare_widgets_args(charity_is_hope_storage_get('widgets_args'), $id ? $id.'_widget' : 'widget_top10', 'widget_top10') ); $output .= ob_get_contents(); ob_end_clean(); $output .= '
    '; } return apply_filters('charity_is_hope_shortcode_output', $output, 'trx_widget_top10', $atts, $content); } add_shortcode("trx_widget_top10", "charity_is_hope_sc_widget_top10"); } // Add [trx_widget_top10] in the VC shortcodes list if (!function_exists('charity_is_hope_widget_top10_reg_shortcodes_vc')) { //add_action('charity_is_hope_action_shortcodes_list_vc','charity_is_hope_widget_top10_reg_shortcodes_vc'); function charity_is_hope_widget_top10_reg_shortcodes_vc() { $posts_types = charity_is_hope_get_list_posts_types(false); $categories = charity_is_hope_get_list_terms(false, charity_is_hope_get_taxonomy_categories_by_post_type('post')); vc_map( array( "base" => "trx_widget_top10", "name" => esc_html__("Widget Top10 Reviews", 'trx_utils'), "description" => wp_kses_data( __("Insert Top10 reviews list with thumbs and post's meta", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), "icon" => 'icon_trx_widget_top10', "class" => "trx_widget_top10", "content_element" => true, "is_container" => false, "show_settings_on_create" => true, "params" => array( array( "param_name" => "title", "heading" => esc_html__("Widget title", 'trx_utils'), "description" => wp_kses_data( __("Title of the widget", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "title_author", "heading" => esc_html__("Author's tab title", 'trx_utils'), "description" => wp_kses_data( __("Title for the tab with authors's reviews", 'trx_utils') ), "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "title_users", "heading" => esc_html__("User's tab title", 'trx_utils'), "description" => wp_kses_data( __("Title for the tab with authors's reviews", 'trx_utils') ), "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "number", "heading" => esc_html__("Number posts to show", 'trx_utils'), "description" => wp_kses_data( __("How many posts display in widget?", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "4", "type" => "textfield" ), array( "param_name" => "post_type", "heading" => esc_html__("Post type", 'trx_utils'), "description" => wp_kses_data( __("Select post type to show", 'trx_utils') ), "class" => "", "std" => "post", "value" => array_flip($posts_types), "type" => "dropdown" ), array( "param_name" => "cat", "heading" => esc_html__("Parent category", 'trx_utils'), "description" => wp_kses_data( __("Select parent category. If empty - show posts from any category", 'trx_utils') ), "class" => "", "value" => array_flip(charity_is_hope_array_merge(array(0 => esc_html__('- Select category -', 'trx_utils')), $categories)), "type" => "dropdown" ), array( "param_name" => "show_image", "heading" => esc_html__("Show post's image", 'trx_utils'), "description" => wp_kses_data( __("Do you want display post's featured image?", 'trx_utils') ), "group" => esc_html__('Details', 'trx_utils'), "class" => "", "std" => 1, "value" => array("Show image" => "1" ), "type" => "checkbox" ), array( "param_name" => "show_author", "heading" => esc_html__("Show post's author", 'trx_utils'), "description" => wp_kses_data( __("Do you want display post's author?", 'trx_utils') ), "group" => esc_html__('Details', 'trx_utils'), "class" => "", "std" => 1, "value" => array("Show author" => "1" ), "type" => "checkbox" ), array( "param_name" => "show_date", "heading" => esc_html__("Show post's date", 'trx_utils'), "description" => wp_kses_data( __("Do you want display post's publish date?", 'trx_utils') ), "group" => esc_html__('Details', 'trx_utils'), "class" => "", "std" => 1, "value" => array("Show date" => "1" ), "type" => "checkbox" ), array( "param_name" => "show_counters", "heading" => esc_html__("Show post's counters", 'trx_utils'), "description" => wp_kses_data( __("Do you want display post's counters?", 'trx_utils') ), "admin_label" => true, "group" => esc_html__('Details', 'trx_utils'), "class" => "", "value" => array_flip(array( '2' => esc_html__('As stars', 'trx_utils'), '1' => esc_html__('As text', 'trx_utils'), '0' => esc_html__('Hide', 'trx_utils') )), "type" => "dropdown" ), charity_is_hope_get_vc_param('id'), charity_is_hope_get_vc_param('class'), charity_is_hope_get_vc_param('css') ) ) ); class WPBakeryShortCode_Trx_Widget_Top10 extends WPBakeryShortCode {} } } ?>