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 /*Load WP functions and DB access*/ | |
include('wp-load.php'); | |
/*required for wp_user_delete*/ | |
require_once(ABSPATH . 'wp-admin/includes/user.php'); | |
/*Let it run forever*/ | |
set_time_limit(0); | |
/*Get the $wpdb database object*/ |
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 /*Load WP functions and DB access*/ | |
include('wp-load.php'); | |
/*required for wp_user_delete*/ | |
require_once(ABSPATH . 'wp-admin/includes/user.php'); | |
/*Let it run forever*/ | |
set_time_limit(0); | |
/*Get the $wpdb database object*/ |
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
/** | |
* Bypass logout confirmation. | |
*/ | |
function amanhstu_bypass_logout_confirmation() | |
{ | |
global $wp; | |
if (isset($wp->query_vars['customer-logout'])) { | |
wp_redirect(str_replace('&', '&', wp_logout_url(wc_get_page_permalink('myaccount')))); | |
exit; |
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 | |
public function give_user_subscription( $product, $user_id, $note = '' ){ | |
// First make sure all required functions and classes exist | |
if( ! function_exists( 'wc_create_order' ) || ! function_exists( 'wcs_create_subscription' ) || ! class_exists( 'WC_Subscriptions_Product' ) ){ | |
return false; | |
} | |
$order = wc_create_order( array( 'customer_id' => $user_id ) ); |
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
add_action( 'wp_footer', 'redirect_cf7' ); | |
function redirect_cf7() { | |
?> | |
<script> | |
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
location = 'https://www.example.com/thanks/'; | |
}, false ); | |
</script> | |
<?php |
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
//woocommerce | |
/* | |
Show Seller name on the product thumbnail | |
For WooCommerce | |
*/ | |
add_action( 'woocommerce_after_shop_loop_item_title','sold_by_vendor_name' ); | |
function sold_by_vendor_name(){ | |
?> |
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
//woocommerce | |
/* | |
Show Seller name on the product thumbnail | |
For WooCommerce | |
*/ | |
add_action( 'woocommerce_after_shop_loop_item_title','sold_by' ); | |
function sold_by(){ | |
?> |
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
//woocommerce | |
/* | |
Show Seller name or store name in the top of Product title from Dokan Plugin | |
For WooCommerce | |
*/ | |
add_action( 'woocommerce_before_single_product','sold_by' ); |
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 wpse55748_filter_post_thumbnail_html( $html ) { | |
// If there is no post thumbnail, | |
// Return a default image | |
if ( '' == $html ) { | |
return '<img src="' . get_template_directory_uri() . '/images/default-featured-image.png" />'; | |
} | |
// Else, return the post thumbnail | |
return $html; | |
} |
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 | |
/** | |
* The main template file | |
*/ | |
get_header(); ?> | |
<?php // Advertisement Placeing Number Functions ?> |
NewerOlder