403Webshell
Server IP : 5.144.175.180  /  Your IP : 216.73.216.131
Web Server : Apache/2.4.63 (Unix) OpenSSL/1.1.1
System : Linux vpsgpz1.itsimplycom.it 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64
User : edilchimica ( )
PHP Version : 7.4.33
Disable Function : getmyuid,passthru,leak,listen,diskfreespace,tmpfile,link,shell_exec,dl,exec,system,highlight_file,source,show_source,fpassthru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_open,proc_close,proc_nice,proc_terminate,escapeshellcmd,ini_alter,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,symlink,posix_geteuid,ini_alter,socket_listen,socket_create_listen,socket_read,socket_create_pair,stream_socket_server
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/edilchimica/webapps/edilchimica/wp-content/themes/edilchimica/includes/elementor/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/edilchimica/webapps/edilchimica/wp-content/themes/edilchimica/includes/elementor/helpers.php
<?php

namespace Kalium\Elementor;

/**
 * Kalium WordPress Theme
 *
 * Kalium Elementor helpers class.
 *
 * @author Laborator
 * @link   https://kaliumtheme.com
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Direct access not allowed.
}

class Helpers {

	/**
	 * Get terms option.
	 *
	 * @param string $taxonomy
	 * @param array  $args
	 *
	 * @return array
	 */
	public static function get_terms_options( $taxonomy, $args = [] ) {
		$terms_options = [];

		// Args
		$args = wp_parse_args( $args, [
			'field'   => 'id',
			'default' => null,
		] );

		// Default value
		if ( ! empty( $args['default'] ) ) {
			if ( is_array( $args['default'] ) ) {
				$keys = array_keys( $args['default'] );

				$terms_options[ $keys[0] ] = $args['default'][ $keys[0] ];
			} else {
				$terms_options[''] = $args['default'];
			}
		}

		// Terms list
		$terms = get_terms( [
			'taxonomy' => $taxonomy,
		] );

		if ( ! is_wp_error( $terms ) ) {
			foreach ( $terms as $term ) {
				$option_value = 'slug' === $args['field'] ? $term->slug : $term->term_id;

				$terms_options[ $option_value ] = $term->name;
			}
		}

		return $terms_options;
	}

	/**
	 * Get post type title.
	 *
	 * @param string $post_type
	 *
	 * @return string|null
	 */
	public static function get_post_type_title( $post_type ) {
		$post_type_obj = get_post_type_object( $post_type );

		if ( is_null( $post_type_obj ) ) {
			return null;
		}

		return $post_type_obj->labels->name;
	}

	/**
	 * Get posts list options.
	 *
	 * @param array $query_args
	 *
	 * @return array|null
	 */
	public static function get_posts( $query_args = [] ) {
		$query_args = wp_parse_args( $query_args, [
			'post_status' => 'publish',
			'posts_per_page' => -1,
		] );

		$query = new \WP_Query();
		$posts = $query->query( $query_args );

		if ( ! empty( $posts ) ) {
			return wp_list_pluck( $posts, 'post_title', 'ID' );
		}
	}

	/**
	 * Get authors list options.
	 *
	 * @return array|null
	 */
	public static function get_authors() {
		$users = get_users( [
			'who'                 => 'authors',
			'has_published_posts' => true,
			'fields'              => [
				'ID',
				'display_name',
			],
		] );

		if ( ! empty( $users ) ) {
			return wp_list_pluck( $users, 'display_name', 'ID' );
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit