Plugin Directory

Changeset 2404324


Ignore:
Timestamp:
10/22/2020 01:49:30 AM (5 years ago)
Author:
rnlab
Message:

bump: 1.3.0

Location:
mobile-builder/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • mobile-builder/trunk/README.txt

    r2374395 r2404324  
    4242
    4343== Changelog ==
     44= 1.3.0 =
     45
     46* Feature: Vendor register
     47* Added: Get roles when login
     48* API: Get min max price
     49* API: Query products by multi attribute
    4450
    4551= 1.2.0 =
  • mobile-builder/trunk/api/class-mobile-builder-wcfm.php

    r2382574 r2404324  
    116116        global $WCMp, $WCFM, $wpdb;
    117117
     118        $range = $request->get_param( 'range' ) ? $request->get_param( 'range' ) : 'month';
     119
    118120        include_once( $WCFM->plugin_path . 'includes/reports/class-wcfmmarketplace-report-sales-by-date.php' );
    119         $wcfm_report_sales_by_date = new WCFM_Marketplace_Report_Sales_By_Date( 'month' );
    120         $wcfm_report_sales_by_date->calculate_current_range( 'month' );
     121        $wcfm_report_sales_by_date = new WCFM_Marketplace_Report_Sales_By_Date( $range );
     122        $wcfm_report_sales_by_date->calculate_current_range( $range );
    121123
    122124        return $wcfm_report_sales_by_date->get_report_data();
     
    134136        global $wp_locale, $wpdb, $WCFM, $WCFMmp;
    135137
     138        $range = $request->get_param( 'range' ) ? $request->get_param( 'range' ) : 'month';
     139
    136140        include_once( $WCFM->plugin_path . 'includes/reports/class-wcfmmarketplace-report-sales-by-date.php' );
    137         $wcfm_report_sales_by_date = new WCFM_Marketplace_Report_Sales_By_Date( 'month' );
    138         $wcfm_report_sales_by_date->calculate_current_range( 'month' );
     141        $wcfm_report_sales_by_date = new WCFM_Marketplace_Report_Sales_By_Date( $range );
     142        $wcfm_report_sales_by_date->calculate_current_range( $range );
    139143
    140144        $report_data = $wcfm_report_sales_by_date->get_report_data();
     
    323327                      . '}';
    324328
    325 
    326329        return array(
    327330            'chart' => json_decode( $chart_data ),
  • mobile-builder/trunk/helpers/mobile-builder-functions.php

    r2374395 r2404324  
    132132    $rest_prefix = trailingslashit( rest_get_url_prefix() );
    133133    $uri         = $_SERVER['REQUEST_URI'];
    134     $allows      = array( 'mobile-builder/', 'wcfmmp/', 'dokan/', 'wp/' );
     134    $allows      = array( 'mobile-builder/', 'wcfmmp/', 'dokan/', 'wp/', 'wc/' );
    135135
    136136    foreach ( $allows as $allow ) {
  • mobile-builder/trunk/includes/class-mobile-builder.php

    r2372265 r2404324  
    153153        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'api/class-mobile-builder-vendor.php';
    154154        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'api/class-mobile-builder-wcfm.php';
     155        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'api/class-mobile-builder-products.php';
    155156
    156157        /**
     
    232233        $this->loader->add_action( 'rest_api_init', $wcfm_api, 'add_api_routes', 10 );
    233234
     235        // Products
     236        $products_api = new Mobile_Builder_Products( $this->get_plugin_name(), $this->get_version() );
     237        $this->loader->add_action( 'rest_api_init', $products_api, 'add_api_routes', 10 );
     238        $this->loader->add_filter( 'woocommerce_rest_product_object_query', $products_api, 'woocommerce_rest_product_object_query', 10, 2 );
     239
    234240    }
    235241
  • mobile-builder/trunk/mobile-builder.php

    r2382574 r2404324  
    1111 * Plugin URI:        https://doc-oreo.rnlab.io
    1212 * Description:       The most advanced drag & drop app builder. Create multi templates and app controls.
    13  * Version:           1.2.2
     13 * Version:           1.3.0
    1414 * Author:            Rnlab.io
    1515 * Author URI:        https://rnlab.io
  • mobile-builder/trunk/public/class-mobile-builder-public.php

    r2372265 r2404324  
    105105         */
    106106        register_rest_route( $namespace, 'reviews', array(
    107             'methods'  => WP_REST_Server::CREATABLE,
    108             'callback' => array( $review, 'create_item' ),
    109             'permission_callback'   => '__return_true',
     107            'methods'             => WP_REST_Server::CREATABLE,
     108            'callback'            => array( $review, 'create_item' ),
     109            'permission_callback' => '__return_true',
    110110        ) );
    111111
     
    120120
    121121        register_rest_route( $namespace, 'token', array(
    122             'methods'  => WP_REST_Server::READABLE,
    123             'callback' => array( $this, 'app_token' ),
    124             'permission_callback'   => '__return_true',
     122            'methods'             => WP_REST_Server::READABLE,
     123            'callback'            => array( $this, 'app_token' ),
     124            'permission_callback' => '__return_true',
    125125        ) );
    126126
    127127        register_rest_route( $namespace, 'login', array(
    128             'methods'  => WP_REST_Server::CREATABLE,
    129             'callback' => array( $this, 'login' ),
    130             'permission_callback'   => '__return_true',
     128            'methods'             => WP_REST_Server::CREATABLE,
     129            'callback'            => array( $this, 'login' ),
     130            'permission_callback' => '__return_true',
    131131        ) );
    132132
    133133        register_rest_route( $namespace, 'logout', array(
    134             'methods'  => WP_REST_Server::READABLE,
    135             'callback' => array( $this, 'logout' ),
    136             'permission_callback'   => '__return_true',
     134            'methods'             => WP_REST_Server::READABLE,
     135            'callback'            => array( $this, 'logout' ),
     136            'permission_callback' => '__return_true',
    137137        ) );
    138138
    139139        register_rest_route( $namespace, 'login-otp', array(
    140             'methods'  => WP_REST_Server::CREATABLE,
    141             'callback' => array( $this, 'login_otp' ),
    142             'permission_callback'   => '__return_true',
     140            'methods'             => WP_REST_Server::CREATABLE,
     141            'callback'            => array( $this, 'login_otp' ),
     142            'permission_callback' => '__return_true',
    143143        ) );
    144144
    145145        register_rest_route( $namespace, 'current', array(
    146             'methods'  => WP_REST_Server::READABLE,
    147             'callback' => array( $this, 'current' ),
    148             'permission_callback'   => '__return_true',
     146            'methods'             => WP_REST_Server::READABLE,
     147            'callback'            => array( $this, 'current' ),
     148            'permission_callback' => '__return_true',
    149149        ) );
    150150
    151151        register_rest_route( $namespace, 'facebook', array(
    152             'methods'  => WP_REST_Server::CREATABLE,
    153             'callback' => array( $this, 'login_facebook' ),
    154             'permission_callback'   => '__return_true',
     152            'methods'             => WP_REST_Server::CREATABLE,
     153            'callback'            => array( $this, 'login_facebook' ),
     154            'permission_callback' => '__return_true',
    155155        ) );
    156156
    157157        register_rest_route( $namespace, 'google', array(
    158             'methods'  => WP_REST_Server::CREATABLE,
    159             'callback' => array( $this, 'login_google' ),
    160             'permission_callback'   => '__return_true',
     158            'methods'             => WP_REST_Server::CREATABLE,
     159            'callback'            => array( $this, 'login_google' ),
     160            'permission_callback' => '__return_true',
    161161        ) );
    162162
    163163        register_rest_route( $namespace, 'apple', array(
    164             'methods'  => WP_REST_Server::CREATABLE,
    165             'callback' => array( $this, 'login_apple' ),
    166             'permission_callback'   => '__return_true',
     164            'methods'             => WP_REST_Server::CREATABLE,
     165            'callback'            => array( $this, 'login_apple' ),
     166            'permission_callback' => '__return_true',
    167167        ) );
    168168
    169169        register_rest_route( $namespace, 'register', array(
    170             'methods'  => WP_REST_Server::CREATABLE,
    171             'callback' => array( $this, 'register' ),
    172             'permission_callback'   => '__return_true',
     170            'methods'             => WP_REST_Server::CREATABLE,
     171            'callback'            => array( $this, 'register' ),
     172            'permission_callback' => '__return_true',
    173173        ) );
    174174
    175175        register_rest_route( $namespace, 'lost-password', array(
    176             'methods'  => WP_REST_Server::CREATABLE,
    177             'callback' => array( $this, 'retrieve_password' ),
    178             'permission_callback'   => '__return_true',
     176            'methods'             => WP_REST_Server::CREATABLE,
     177            'callback'            => array( $this, 'retrieve_password' ),
     178            'permission_callback' => '__return_true',
    179179        ) );
    180180
    181181        register_rest_route( $namespace, 'settings', array(
    182             'methods'  => WP_REST_Server::READABLE,
    183             'callback' => array( $this, 'settings' ),
    184             'permission_callback'   => '__return_true',
     182            'methods'             => WP_REST_Server::READABLE,
     183            'callback'            => array( $this, 'settings' ),
     184            'permission_callback' => '__return_true',
    185185        ) );
    186186
    187187        register_rest_route( $namespace, 'change-password', array(
    188             'methods'  => WP_REST_Server::CREATABLE,
    189             'callback' => array( $this, 'change_password' ),
    190             'permission_callback'   => '__return_true',
     188            'methods'             => WP_REST_Server::CREATABLE,
     189            'callback'            => array( $this, 'change_password' ),
     190            'permission_callback' => '__return_true',
    191191        ) );
    192192
    193193        register_rest_route( $namespace, 'update-location', array(
    194             'methods'  => WP_REST_Server::CREATABLE,
    195             'callback' => array( $this, 'update_location' ),
    196             'permission_callback'   => '__return_true',
     194            'methods'             => WP_REST_Server::CREATABLE,
     195            'callback'            => array( $this, 'update_location' ),
     196            'permission_callback' => '__return_true',
    197197        ) );
    198198
    199199        register_rest_route( $namespace, 'zones', array(
    200             'methods'  => WP_REST_Server::READABLE,
    201             'callback' => array( $this, 'zones' ),
    202             'permission_callback'   => '__return_true',
     200            'methods'             => WP_REST_Server::READABLE,
     201            'callback'            => array( $this, 'zones' ),
     202            'permission_callback' => '__return_true',
    203203        ) );
    204204
    205205        register_rest_route( $namespace, 'get-continent-code-for-country', array(
    206             'methods'  => WP_REST_Server::READABLE,
    207             'callback' => array( $this, 'get_continent_code_for_country' ),
    208             'permission_callback'   => '__return_true',
     206            'methods'             => WP_REST_Server::READABLE,
     207            'callback'            => array( $this, 'get_continent_code_for_country' ),
     208            'permission_callback' => '__return_true',
    209209        ) );
    210210
    211211        register_rest_route( $namespace, 'payment-stripe', array(
    212             'methods'  => WP_REST_Server::CREATABLE,
    213             'callback' => array( $this, 'payment_stripe' ),
    214             'permission_callback'   => '__return_true',
     212            'methods'             => WP_REST_Server::CREATABLE,
     213            'callback'            => array( $this, 'payment_stripe' ),
     214            'permission_callback' => '__return_true',
    215215        ) );
    216216
    217217        register_rest_route( $namespace, 'payment-hayperpay', array(
    218             'methods'  => WP_REST_Server::CREATABLE,
    219             'callback' => array( $this, 'payment_hayperpay' ),
    220             'permission_callback'   => '__return_true',
     218            'methods'             => WP_REST_Server::CREATABLE,
     219            'callback'            => array( $this, 'payment_hayperpay' ),
     220            'permission_callback' => '__return_true',
    221221        ) );
    222222
     
    228228         */
    229229        register_rest_route( $namespace, 'process_payment', array(
    230             'methods'  => WP_REST_Server::CREATABLE,
    231             'callback' => array( $this, 'rnlab_process_payment' ),
    232             'permission_callback'   => '__return_true',
     230            'methods'             => WP_REST_Server::CREATABLE,
     231            'callback'            => array( $this, 'rnlab_process_payment' ),
     232            'permission_callback' => '__return_true',
    233233        ) );
    234234
     
    266266         */
    267267        register_rest_route( $namespace, 'check-phone-number', array(
    268             'methods'  => WP_REST_Server::CREATABLE,
    269             'callback' => array( $this, 'mbd_check_phone_number' ),
    270             'permission_callback'   => '__return_true',
     268            'methods'             => WP_REST_Server::CREATABLE,
     269            'callback'            => array( $this, 'mbd_check_phone_number' ),
     270            'permission_callback' => '__return_true',
    271271        ) );
    272272
     
    278278         */
    279279        register_rest_route( $namespace, 'check-info', array(
    280             'methods'  => WP_REST_Server::CREATABLE,
    281             'callback' => array( $this, 'mbd_validate_user_info' ),
    282             'permission_callback'   => '__return_true',
     280            'methods'             => WP_REST_Server::CREATABLE,
     281            'callback'            => array( $this, 'mbd_validate_user_info' ),
     282            'permission_callback' => '__return_true',
    283283        ) );
    284284
     
    290290         */
    291291        register_rest_route( $namespace, 'categories', array(
    292             'methods'  => WP_REST_Server::READABLE,
    293             'callback' => array( $this, 'categories' ),
    294             'permission_callback'   => '__return_true',
     292            'methods'             => WP_REST_Server::READABLE,
     293            'callback'            => array( $this, 'categories' ),
     294            'permission_callback' => '__return_true',
    295295        ) );
    296296
     
    728728                'templates'              => $decode ? $templates : $templates_data,
    729729                'checkout_user_location' => apply_filters( 'wcfmmp_is_allow_checkout_user_location', true ),
    730         );
     730            );
    731731
    732732            wp_cache_set( 'settings_' . $decode, $result, 'rnlab' );
     
    946946        $password   = $request->get_param( 'password' );
    947947        $subscribe  = $request->get_param( 'subscribe' );
     948        $role       = $request->get_param( 'role' );
     949
     950        if ( ! $role || $role != 'wcfm_vendor' ) {
     951            $role = "customer";
     952        }
    948953
    949954        $enable_phone_number = $request->get_param( 'enable_phone_number' );
     
    10101015            "display_name" => "$first_name $last_name",
    10111016            "first_name"   => $first_name,
    1012             "last_name"    => $last_name
     1017            "last_name"    => $last_name,
     1018            "role"         => $role,
    10131019
    10141020        ) );
     
    18121818        $user_data->avatar     = 'https://www.gravatar.com/avatar/' . md5( $user_data->user_email );
    18131819        $user_data->location   = get_user_meta( $user->ID, 'mbd_location', true );
     1820        $user_data->roles      = $user->roles;
    18141821
    18151822        return $user_data;
Note: See TracChangeset for help on using the changeset viewer.