This file contains 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 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 this on your theme functions.php file then use this shortcode [sc_customer_logout] | |
add_shortcode( 'sc_customer_logout', 'sc_customer_logout' ); | |
/** | |
* Add a logout shortcode button | |
*/ | |
function sc_customer_logout() { | |
ob_start(); | |
if ( is_user_logged_in()) : |
This file contains 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
<script> | |
( function( $ ) { | |
fetch('https://backend.turinlabs.com/graphql', { | |
method: 'POST', | |
headers: { | |
'apiKey': 'turinpay_sk_test_c6c713d9-d4e6-4b7e-893a-005b5b2a5bd2', | |
}, | |
body: JSON.stringify({ | |
query: ` | |
mutation CREATE_PAYMENT_INTENT_MUTATION($input: CreatePaymentIntentInput!) { |
This file contains 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 | |
function custom_rewrite_basic() { | |
add_rewrite_endpoint( 'custom_slug', EP_PAGES ); | |
add_rewrite_rule( 'custom_slug/([^/]+)/?$', 'index.php?custom_slug=$matches[1]', 'top' ); | |
} | |
add_action( 'init', 'custom_rewrite_basic' ); | |
function custom_register_query_var( $vars ) { | |
$vars[] = 'custom_slug'; |
This file contains 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
( function ( $ ) { | |
const wcf_page_title_notification = { | |
vars: { | |
originalTitle: document.title, | |
interval: null, | |
}, | |
On( notification, intervalSpeed ) { | |
const _this = this; | |
_this.vars.interval = setInterval( | |
function () { |
This file contains 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
/** | |
* Remove delete option from dokan vendor product listing | |
* add this script on your theme functions.php file | |
* | |
* @param array $actions | |
* | |
* @return array $actions | |
*/ | |
function remove_delete_option_dokan_product_row_actions( $actions ) { | |
unset( $actions['delete'] ); |
This file contains 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
/** | |
* Dokan product description media buttons added | |
* | |
* @param array $args | |
* | |
* @return array $args | |
*/ | |
function dokan_product_description_media_button_added( $args ) { | |
$args['media_buttons'] = true; |
This file contains 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
/** | |
* Dokan setting get support option force always checked | |
*/ | |
function dokan_settign_get_support_checkbox_force_checked() { | |
if ( is_user_logged_in() && function_exists( 'dokan_is_seller_dashboard' ) && dokan_is_seller_dashboard() ) { | |
?> | |
<script> | |
(function($) { | |
var Dokan_Settign_Get_Support_Checkbox_Customized = { | |
init: function() { |
This file contains 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
/** | |
* Dokan product page downloadable and virtual force always checked | |
*/ | |
function dokan_product_page_downloadable_virtual_checkbox_force_checked() { | |
if ( is_user_logged_in() && function_exists( 'dokan_is_seller_dashboard' ) && dokan_is_seller_dashboard() ) { | |
?> | |
<script> | |
(function($) { | |
var Dokan_Product_Virtual_Download_Checkbox_Customized = { | |
init: function() { |
This file contains 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
/** | |
* Removed dokan shipping tab from single product page | |
* | |
* @param array $tabs | |
*/ | |
function remove_dokan_registered_product_shipping_tab( $tabs ) { | |
unset( $tabs['shipping'] ); | |
return $tabs; | |
} |
NewerOlder