PATH:
home
/
letacommog
/
entrepro
/
wp-content
/
plugins
/
dokan-pro
/
includes
/
modules
/
follow-store
/
includes
<?php class Dokan_Follow_Store_Ajax { /** * Class constructor * * @since 1.0.0 * * @return void */ public function __construct() { add_action( 'wp_ajax_dokan_follow_store_toggle_status', array( $this, 'toggle_follow_status' ) ); } /** * Toggle follow store status * * @since 1.0.0 * * @return void */ public function toggle_follow_status() { if ( empty( $_POST ) || ! isset( $_POST['_nonce'] ) || ! wp_verify_nonce( $_POST['_nonce'], 'dokan_follow_store' ) ) { wp_send_json_error( new WP_Error( 'invalid_nonce', __( 'Nonce is invalid', 'dokan' ) ), 403 ); } if ( empty( $_POST['vendor_id'] ) ) { wp_send_json_error( new WP_Error( 'missing_required_field', __( 'vendor_id field is required', 'dokan' ) ), 422 ); } $customer_id = get_current_user_id(); $vendor = dokan()->vendor->get( $_POST['vendor_id'] ); if ( ! $vendor->id ) { wp_send_json_error( new WP_Error( 'invalid_vendor', __( 'Invalid vendor_id', 'dokan' ) ), 422 ); } $status = dokan_follow_store_toggle_status( $vendor->id, $customer_id ); if ( is_wp_error( $status ) ) { wp_send_json_error( $status, 422 ); } wp_send_json_success( array( 'status' => $status ), 200 ); } }
[+]
..
[-] class-dokan-follow-store-follow-button.php
[edit]
[-] class-dokan-follow-store-email.php
[edit]
[-] class-dokan-follow-store-vendor-dashboard.php
[edit]
[-] class-dokan-follow-store-my-account.php
[edit]
[-] class-dokan-follow-store-install.php
[edit]
[-] class-dokan-follow-store-email-loader.php
[edit]
[-] class-dokan-follow-store-ajax.php
[edit]
[-] class-dokan-follow-store-cron.php
[edit]
[-] class-dokan-follow-store-scripts.php
[edit]
[-] class-dokan-follow-store-send-updates.php
[edit]
[-] functions.php
[edit]