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
/** | |
* custom_woocommerce_template_loop_add_to_cart | |
*/ | |
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' ); | |
function custom_woocommerce_product_add_to_cart_text() { | |
global $product; | |
$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; | |
$text = "View Product"; |
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 | |
/** | |
* @snippet Show Total Sales | |
* @how-to Get CustomizeWoo.com FREE | |
* @author Md Abul Bashar | |
* @compatible Woo 3.7+ | |
*/ | |
add_action( 'woocommerce_before_add_to_cart_button', 'bbloomer_product_sold_count', 11 ); |
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 | |
//Using some WC_Order and WC_Abstract_Order methods (example): | |
// Get an instance of the WC_Order object (same as before) | |
$order = wc_get_order( $order_id ); | |
$order_id = $order->get_id(); // Get the order ID | |
$parent_id = $order->get_parent_id(); // Get the parent order ID (for subscriptions…) | |
$user_id = $order->get_user_id(); // Get the costumer ID | |
$user = $order->get_user(); // Get the WP_User object |
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 | |
/* | |
Plugin Name: Homepage Settings for BigBang | |
Plugin URI: http://www.inboundnow.com/ | |
Description: Adds additional functionality to the big bang theme. | |
Author: David Wells | |
Author URI: http://www.inboundnow.com | |
*/ | |
// Specify Hooks/Filters |
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 NEW COLUMN | |
function suga_columns_head($defaults) { | |
$defaults['featured_image'] = 'Post ID'; | |
return $defaults; | |
} | |
// show value in the new column | |
function suga_columns_content($column_name, $post_ID) { | |
if ($column_name == 'featured_image') { | |
echo 'Post ID: <strong>'.get_the_ID().'</strong>'; | |
} |
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 | |
function nova_allowed_html() { | |
$allowed_tags = array( | |
'a' => array( | |
'class' => array(), | |
'href' => array(), | |
'rel' => array(), | |
'title' => 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
<?php | |
//comment time ago convert | |
function varsity_get_comment_time( $comment_id = 0 ){ | |
return sprintf( | |
_x( '%s ago', 'Human-readable time', 'varsity' ), | |
human_time_diff( | |
get_comment_date( 'U', $comment_id ), | |
current_time( 'timestamp' ) | |
) | |
); |
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 | |
/** | |
* Bangla Date translate class for WordPress | |
* | |
* Converts English months, dates to equivalent Bangla digits | |
* and month names. | |
* | |
* @author Tareq Hasan <[email protected]> | |
*/ | |
class WP_BanglaDate { |
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 | |
class BanglaConverter { | |
public static $bn = array("১", "২", "৩", "৪", "৫", "৬", "৭", "৮", "৯", "০"); | |
public static $en = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); | |
public static function bn2en($number) { | |
return str_replace(self::$bn, self::$en, $number); | |
} | |
public static function en2bn($number) { |