PATH:
home
/
letacommog
/
laindinois
/
OLD
/
wp-content
/
plugins
/
dwt-listing-rest-api
/
classes
<?php add_action( 'rest_api_init', 'dwt_listing_packages_get', 0 ); function dwt_listing_packages_get() { register_rest_route( 'downtown/app', '/packages/', array( 'methods' => WP_REST_Server::READABLE, 'callback' => 'dwt_listing_get_mypackages', 'permission_callback' => function () { return dwt_listing_basic_auth(); }, ) ); } if(!function_exists('dwt_listing_get_mypackages')) { function dwt_listing_get_mypackages() { global $dwt_listing_api; if( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' )) ) || class_exists( 'WooCommerce' )) { $user_id = get_current_user_id(); $args = array( 'post_type' => 'product', 'tax_query' => array( 'relation' => 'OR', array( 'taxonomy' => 'product_type', 'field' => 'slug', 'terms' => 'dwt_listing_pkgs' ), array( 'taxonomy' => 'product_type', 'field' => 'slug', 'terms' => 'subscription' ), ), 'post_status' => 'publish', 'posts_per_page' => -1, 'order'=> 'DESC', 'orderby' => 'date' ); $my_data = array(); $packages = new WP_Query( $args ); if ( $packages->have_posts() ) { while ( $packages->have_posts() ) { $packages->the_post(); $packages_array[] = array( 'package_id' => get_the_ID() ); } $pack['packages'] = $packages_array; } //$my_data; return $pack; $response = array( 'success' => true, 'data' => ''); return $response; } else { return array( 'success' => false, 'data' => '', 'message' => esc_html__('Woocommerce is required for packages','dwt-listing-api')); } } }
[+]
..
[-] events.php
[edit]
[-] author-listings.php
[edit]
[-] fetch_data.php
[edit]
[-] forget.php
[edit]
[-] categories.php
[edit]
[-] listing-detail.php
[edit]
[-] packages.php
[edit]
[-] home.php
[edit]
[+]
packages
[-] reviews.php
[edit]
[+]
submit-listing
[-] profile.php
[edit]
[-] register.php
[edit]
[-] settings.php
[edit]
[-] events-search.php
[edit]
[-] listing-search.php
[edit]
[+]
profile
[-] event-detail.php
[edit]
[-] login.php
[edit]
[+]
payments
[-] blog.php
[edit]