This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$userID = 2; | |
$args = array( 'author' => $userID, 'post_type' => 'product', 'posts_per_page' => -1, 'post_status' => array( 'publish', 'pending', 'draft', 'future' ) ); | |
$the_query = new WP_Query( $args ); | |
// The Loop | |
if ( $the_query->have_posts() ) { | |
while ( $the_query->have_posts() ) { | |
$the_query->the_post(); | |
wp_delete_post( get_the_ID(), true ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'dokan_seller_meta_fields', 'dokan_load_store_seo_field_in_admin', 10 ); | |
add_action( 'dokan_process_seller_meta_fields', 'dokan_process_seller_seo_data', 10 ); | |
function dokan_load_store_seo_field_in_admin( $user ) { | |
$seo = new Dokan_Pro_Store_Seo(); | |
$seller_profile = dokan_get_store_info( $user->ID ); | |
$seo_meta = isset( $seller_profile['store_seo'] ) ? $seller_profile['store_seo'] : array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this actions | |
add_action( 'user_new_form', 'add_seller_store_field', 10 ); | |
add_action( 'edit_user_created_user', 'add_shop_url_for_seller' , 10, 2); | |
// Add this filter | |
add_filter( 'user_profile_update_errors', 'check_fields_add_new_user', 10, 3 ); | |
function add_shop_url_for_seller( $user_id, $notify ) { | |
if ( ! $user_id ) { | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First Register the Tab by hooking into the 'woocommerce_product_data_tabs' filter | |
add_filter( 'woocommerce_product_data_tabs', 'add_my_custom_product_data_tab' ); | |
function add_my_custom_product_data_tab( $product_data_tabs ) { | |
$product_data_tabs['my-custom-tab'] = array( | |
'label' => __( 'My Custom Tab', 'my_text_domain' ), | |
'target' => 'my_custom_product_data', | |
); | |
return $product_data_tabs; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce price adjustment for WPUF | |
* | |
* @param int $post_id | |
* | |
* @return void | |
*/ | |
function wpufe_update_post_price( $post_id ) { |