Plugin Directory

Changeset 2474729


Ignore:
Timestamp:
02/15/2021 08:10:25 AM (5 years ago)
Author:
karlogitlea
Message:

Added Ajax support

Location:
miqid-core/trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • miqid-core/trunk/miqid-core.php

    r2467105 r2474729  
    33 * Plugin Name:       MIQID-Core
    44 * Description:       MIQID-Core handle the basics.
    5  * Version:           1.5.4
     5 * Version:           1.5.5
    66 * Requires at least: 5.2
    77 * Requires PHP:      7.2
  • miqid-core/trunk/readme.md

    r2467105 r2474729  
    44Tested up to: 5.6
    55Requires PHP: 7.2 
    6 Stable tag: 1.5.4 
     6Stable tag: 1.5.5 
    77License: GPL v3 or later 
    88
  • miqid-core/trunk/src/Classes/API/Base.php

    r2466954 r2474729  
    2323     */
    2424    protected function RemoteGet( $url, $JWT = null, array $args = [] ): HttpResponse {
     25        if ( !is_null($JWT) && is_string( $JWT ) ) {
     26            $JWT = new JWT( $JWT );
     27        }
    2528
    2629        $default = [ 'headers' => [ 'Content-Type' => 'application/json; charset=utf-8' ] ];
     
    4750        if ( is_object( $body ) || is_array( $body ) ) {
    4851            $body = json_encode( $body );
     52        }
     53        if ( !is_null($JWT) && is_string( $JWT ) ) {
     54            $JWT = new JWT( $JWT );
    4955        }
    5056
  • miqid-core/trunk/src/Classes/API/CompanyProfile.php

    r2466954 r2474729  
    2727
    2828        if ( in_array( $HttpResponse->get_response_code(), [ 200 ] ) ) {
    29             return new \MIQID\Plugin\Core\Classes\DTO\Profile( $HttpResponse->get_body() );
     29            return new \MIQID\Plugin\Core\Classes\DTO\CompanyProfile( $HttpResponse->get_body() );
    3030        }
    31         $HttpResponse->save_log( $this, __FUNCTION__ );
    32 
    33         return new \MIQID\Plugin\Core\Classes\DTO\Profile( [
    34             'HttpResponse' => $HttpResponse,
    35         ] );
     31        return $HttpResponse;
    3632    }
    3733}
  • miqid-core/trunk/src/Classes/DTO/Profile.php

    r2467105 r2474729  
    189189    }
    190190
     191    public function get_full_name() {
     192        return implode( ' ', array_filter( [ $this->get_first_name(), $this->get_last_name() ] ) );
     193    }
     194
    191195    /**
    192196     * @return string
  • miqid-core/trunk/src/Frontend/Frontend.php

    r2466954 r2474729  
    44namespace MIQID\Plugin\Core\Frontend;
    55
     6use MIQID\Plugin\Core\Frontend\Ajax\Ajax;
    67use MIQID\Plugin\Core\Frontend\Filter\Filter;
    78use MIQID\Plugin\Core\Frontend\Shortcode\Shortcode;
     
    2627        }
    2728
     29        Ajax::Instance();
     30
    2831        Filter::Instance();
    2932
Note: See TracChangeset for help on using the changeset viewer.