https://t.me/AnonymousX5
Server : Apache/2
System : Linux vps.sdns.vn 3.10.0-1160.15.2.el7.x86_64 #1 SMP Wed Feb 3 15:06:38 UTC 2021 x86_64
User : phatdatpq ( 1022)
PHP Version : 7.2.34
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/phatdatpq/public_html/wp-content/themes/flatsome/inc/builder/core/server/src/Ajax/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/phatdatpq/public_html/wp-content/themes/flatsome/inc/builder/core/server/src/Ajax/Terms.php
<?php

namespace UxBuilder\Ajax;

class Terms {

  public function get_terms() {
    $post_id = array_key_exists( 'id', $_GET ) ? $_GET['id'] : array();
    $term_ids = array_key_exists( 'values', $_GET ) ? $_GET['values'] : array();
    $option = array_key_exists( 'option', $_GET ) ? $_GET['option'] : array();

    // Return an error if nonce is invalid.
    check_ajax_referer( 'ux-builder-' . $post_id, 'security' );

    // Make sure ids are an array.
    if ( is_string( $term_ids ) ) {
      $term_ids = array( $term_ids );
    }

    // Make sure no empty ids are provided.
    $term_ids = array_filter( $term_ids, function ($value) {
      return $value != '';
    } );

    // Return an error if no term ids are provided.
    if ( empty( $term_ids ) ) {
      return wp_send_json_success( array() );
    }

    $terms = get_terms( $option['taxonomies'], array(
      'include' => is_array( $term_ids ) ? $term_ids : array( $term_ids ),
      'hide_empty' => false,
      'orderby' => 'include',
    ) );

    $items = array_map( function ($term) {
      return array(
        'id' => $term->term_id,
        'title' => $term->name,
      );
    }, $terms );

    wp_send_json_success( $items );
  }

  public function search_terms() {
    $query = array_key_exists( 'query', $_GET ) ? $_GET['query'] : array();
    $option = array_key_exists( 'option', $_GET ) ? $_GET['option'] : array();

    $terms = get_terms( $option['taxonomies'], array(
      'number' => 25,
      'search' => $query,
      'hide_empty' => false,
    ) );

    $items = array_map( function ($term) {
      return array(
        'id' => $term->term_id,
        'title' => $term->name,
      );
    }, $terms );

    wp_send_json_success( $items );
  }
}

https://t.me/AnonymousX5 - 2025