Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /var/www/theprintave/wp-content/plugins/dokan-lite/includes/Order/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/theprintave/wp-content/plugins/dokan-lite/includes/Order/Ajax.php
<?php

namespace WeDevs\Dokan\Order;

// don't call the file directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/**
 * Class Ajax
 *
 * @since 3.10.3
 *
 * @package WeDevs\Dokan\Order
 */
class Ajax {
    /**
     * Class constructor
     *
     * @since 3.10.3
     *
     * @return void
     */
    public function __construct() {
        add_action( 'wp_ajax_dokan_search_downloadable_products', [ $this, 'search_downloadable_products' ] );
    }

    /**
     * Search downloadable products
     *
     * @since 3.10.3
     *
     * @return void
     */
    public function search_downloadable_products() {
        check_ajax_referer( 'search-downloadable-products', '_nonce' );

        $limit = absint( apply_filters( 'woocommerce_json_search_limit', 30 ) );
        if ( ! empty( $_GET['limit'] ) ) {
            $limit = absint( $_GET['limit'] );
        }

        $page = 1;
        if ( ! empty( $_GET['page'] ) ) {
            $page = absint( $_GET['page'] );
        }

        $term = isset( $_GET['q'] ) ? (string) wc_clean( wp_unslash( $_GET['q'] ) ) : '';
        $args = [
            'status'       => 'publish',
            'downloadable' => true,
            'author'       => dokan_get_current_user_id(),
            'page'         => $page,
            'limit'        => $limit,
        ];

        if ( is_numeric( $term ) ) {
            $args['include'] = (array) $term;
        } else {
            $args['s'] = $term;
        }

        $product_objects = wc_get_products( $args );

        $products = array();
        foreach ( $product_objects as $product_object ) {
            $products[ $product_object->get_id() ] = rawurldecode( wp_strip_all_tags( $product_object->get_formatted_name() ) );
        }

        wp_send_json( $products );
    }
}

Spamworldpro Mini