GRAYBYTE WORDPRESS FILE MANAGER1970

Server IP : 68.65.123.43 / Your IP : 216.73.216.162
System : Linux server266.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/inteuuod/public_html/wp-content/plugins/userswp/widgets/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/inteuuod/public_html/wp-content/plugins/userswp/widgets//user-post-counts.php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * UsersWP user post counts widget.
 */
class UWP_User_Post_Counts_Widget extends WP_Super_Duper {

	/**
	 * Register the user post counts widget with WordPress.
	 *
	 */
	public function __construct() {


		$options = array(
			'textdomain'     => 'userswp',
			'block-icon'     => 'admin-site',
			'block-category' => 'widgets',
			'block-keywords' => "['userswp','user']",
			'class_name'     => __CLASS__,
			'base_id'        => 'uwp_user_post_counts',
			'name'           => __( 'UWP > User Post Counts', 'userswp' ),
			'no_wrap'        => true,
			'block-wrap'     => '',
			'widget_ops'     => array(
				'classname'   => 'uwp-user-post-counts bsui',
				'description' => esc_html__( 'Display user post, comments and other custom post type counts.', 'userswp' ),
			),
			'arguments'      => array(
				'title' => array(
					'title'    => __( 'Title', 'userswp' ),
					'desc'     => __( 'Enter widget title.', 'userswp' ),
					'type'     => 'text',
					'desc_tip' => true,
					'default'  => '',
					'advanced' => false
				),
				'disable_greedy'  => array(
					'title' => __('Disable Greedy Menu', 'userswp'),
					'desc' => __('Greedy menu prevents a large menu falling onto another line by adding a dropdown select.', 'userswp'),
					'type' => 'checkbox',
					'desc_tip' => true,
					'value'  => '1',
					'default'  => '',
					'advanced' => true,
				),
			)

		);


		parent::__construct( $options );
	}

	/**
	 * The Super block output function.
	 *
	 * @param array  $args
	 * @param array  $widget_args
	 * @param string $content
	 *
	 * @return mixed|string|bool
	 */
	public function output( $args = array(), $widget_args = array(), $content = '' ) {
		global $_uwp_user_post_counts;

		$user = uwp_get_displayed_user();

		if ( ! $user ) {
			return '';
		}

		ob_start();

		$output  = "";
		$counts  = array();
		$user_id = $user->ID;

		if ( is_user_logged_in() && $user_id == get_current_user_id() ) {

			$post_types = uwp_get_option( 'login_user_post_counts_cpts' );
			$post_types = apply_filters( 'uwp_login_user_count_cpts', $post_types, $user_id );

		} else {

			$post_types = uwp_get_option( 'user_post_counts_cpts' );
			$post_types = apply_filters( 'uwp_user_count_cpts', $post_types, $user_id );

		}

		if ( ! empty( $post_types ) ) {
			$_uwp_user_post_counts = true;

			foreach ( $post_types as $cpt ) {
				$post_type = get_post_type_object( $cpt );
				$count     = count_user_posts( $user_id, $cpt );

				if ( $post_type && $count ) {
					$counts[ $cpt ] = array(
						'name'          => $post_type->labels->name,
						'singular_name' => $post_type->labels->singular_name,
						'count'         => $count
					);
				}
			}

			$_uwp_user_post_counts = false;
		}

		$counts = apply_filters( 'uwp_get_user_post_counts', $counts, $user_id );
		$greedy_menu_class = empty($args['disable_greedy']) ? 'greedy' : '';

		if ( is_uwp_profile_page() ) {

			if ( ! empty( $counts ) ) {
				$output .= '<nav class="navbar navbar-expand-xl navbar-light bg-white p-xl-0 '.esc_attr($greedy_menu_class).'">';
				$output .= '<div class="w-100 justify-content-center">';
				$output .= '<ul class="navbar-nav flex-wrap m-0">';
				$class = " pl-0";
				foreach ( $counts as $cpt => $post_type ) {
					$post_count_text = $post_type['count'] > 1 ? esc_attr( $post_type['name'] ) . '<span class="badge badge-dark ml-1">' . esc_attr( $post_type['count'] ) . '</span>' : esc_attr( $post_type['singular_name'] ) . '<span class="badge badge-dark ml-1">' . esc_attr( $post_type['count'] ) . '</span>';
					$output          .= '<li class="nav-item"><span class="nav-link pr-0'.$class.'"><span class="badge badge-white text-muted'.$class.'">' . $post_count_text . '</span></span></li>' . " \n";
					$class = '';
				}
				$output .= '</ul>';
				$output .= '</div>';
				$output .= '</nav>';
			}

		} else {
			if ( ! empty( $counts ) ) {
				$class = " pl-0";
				foreach ( $counts as $cpt => $post_type ) {
					$post_count_text = $post_type['count'] > 1 ? esc_attr( $post_type['name'] ) . '<span class="badge badge-dark ml-1">' . esc_attr( $post_type['count'] ) . '</span>' : esc_attr( $post_type['singular_name'] ) . '<span class="badge badge-dark ml-1">' . esc_attr( $post_type['count'] ) . '</span>';
					$output          .= '<span class="badge badge-white nav-link text-muted pr-0'.$class.'">' . $post_count_text . '</span>' . " \n";
					$class = '';
				}
			}
		}

		echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

		return ob_get_clean();
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:23
inteuuod / inteuuod
0755
.htaccess
0.41 KB
July 10 2025 04:32:23
inteuuod / inteuuod
0644
account.php
3.679 KB
August 11 2020 15:42:14
inteuuod / inteuuod
0644
authorbox.php
7.871 KB
February 04 2025 23:32:52
inteuuod / inteuuod
0644
button-group.php
5.444 KB
April 28 2022 17:18:48
inteuuod / inteuuod
0644
change.php
3.71 KB
September 22 2021 17:04:04
inteuuod / inteuuod
0644
forgot.php
3.684 KB
September 22 2021 17:04:04
inteuuod / inteuuod
0644
login.php
7.884 KB
September 22 2021 17:04:04
inteuuod / inteuuod
0644
output-location.php
2.602 KB
September 22 2021 17:04:04
inteuuod / inteuuod
0644
profile-actions.php
1.735 KB
October 30 2019 18:46:22
inteuuod / inteuuod
0644
profile-header.php
5.928 KB
November 04 2021 10:28:08
inteuuod / inteuuod
0644
profile-section.php
3.427 KB
August 11 2020 15:42:14
inteuuod / inteuuod
0644
profile-social.php
2.062 KB
September 22 2021 17:04:04
inteuuod / inteuuod
0644
profile-tabs.php
6.597 KB
November 04 2021 10:28:08
inteuuod / inteuuod
0644
profile.php
2.304 KB
November 04 2021 10:28:08
inteuuod / inteuuod
0644
register.php
4.284 KB
February 04 2025 23:32:52
inteuuod / inteuuod
0644
reset.php
3.28 KB
June 21 2022 14:28:20
inteuuod / inteuuod
0644
user-actions.php
1.784 KB
May 30 2020 12:36:16
inteuuod / inteuuod
0644
user-avatar.php
4.309 KB
March 15 2023 16:33:38
inteuuod / inteuuod
0644
user-badge.php
10.726 KB
January 09 2025 21:52:58
inteuuod / inteuuod
0644
user-cover.php
3.991 KB
September 06 2021 15:30:56
inteuuod / inteuuod
0644
user-meta.php
7.332 KB
January 09 2025 21:52:58
inteuuod / inteuuod
0644
user-post-counts.php
4.469 KB
June 25 2024 02:23:32
inteuuod / inteuuod
0644
user-title.php
2.68 KB
March 14 2024 20:54:16
inteuuod / inteuuod
0644
users-item.php
1.725 KB
September 22 2021 17:04:04
inteuuod / inteuuod
0644
users-loop-actions.php
1.484 KB
September 22 2021 17:04:04
inteuuod / inteuuod
0644
users-loop.php
2.605 KB
September 22 2021 17:04:04
inteuuod / inteuuod
0644
users-search.php
1.919 KB
September 22 2021 17:04:04
inteuuod / inteuuod
0644
users.php
2.684 KB
September 22 2021 17:04:04
inteuuod / inteuuod
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF