HEX
HEX
Server: Apache
System: Linux localhost.localdomain 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www (1001)
PHP: 8.1.32
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/ahmsolaiman.com/wp-content/plugins/types/application/models/term/service.php
<?php

/**
 * @since 2.3
 */
class Types_Term_Service {

	/**
	 * Returns WP_User of $params['user_id'] | $params['user_name'] | $params['user_current'].
	 * If all keys not set it will return the author of the current post.
	 *
	 * @param array $params
	 *
	 * @return WP_Term|array|WP_Error|null
	 */
	public function find_by_user_params( $params ) {
		if ( isset( $params['term_id'] ) && $params['term_id'] ) {
			// by user param id
			return get_term( $params['term_id'] );
		}

		// by Views loop
		// @refactoring Get rid of the hardcoded dependency.
		global $WP_Views;

		/** @noinspection NotOptimalIfConditionsInspection */
		if ( class_exists( 'WP_Views' )
			&& $WP_Views instanceof WP_Views
			&& isset( $WP_Views->taxonomy_data['term']->term_id ) // @phpstan-ignore-line
			&& ! empty( $WP_Views->taxonomy_data['term']->term_id )
		) {
			return get_term( $WP_Views->taxonomy_data['term']->term_id );
		}

		// by current page
		if ( is_tax() || is_category() || is_tag() ) {
			global $wp_query;
			$term = $wp_query->get_queried_object();
			if ( $term && isset( $term->term_id ) ) {
				return get_term( $term->term_id );
			}
		}

		return null;
	}
}