Skip to content

Instantly share code, notes, and snippets.

View Welland's full-sized avatar

Shane Welland Welland

  • Creare
  • United Kingdom
View GitHub Profile
@Welland
Welland / gist:ecd3080fa1cebe691565
Created September 1, 2015 15:30
WooCommerce API - Input Functions
/**
* Text Input
*/
woocommerce_wp_text_input(
array(
'id' => '_text_field',
'label' => __( 'My Text Field', 'woocommerce' ),
'placeholder' => 'http://',
'desc_tip' => 'true',
'description' => __( 'Enter the custom value here.', 'woocommerce' )
@Welland
Welland / Unset WooCommerce Reviews Tab
Last active September 1, 2015 15:33
Unset WooCommerce Reviews Tab
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['reviews'] );
return $tabs;
}
@Welland
Welland / gist:d4c106e38f349bd68c6a
Created June 18, 2014 15:38
WooCommerce - Logout URL
$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
if ( $myaccount_page_id ) {
$logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) );
//make ssl if needed
if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' )
$logout_url = str_replace( 'http:', 'https:', $logout_url );
}
@Welland
Welland / gist:5f8c3d7c32839c1fa3ab
Created June 18, 2014 15:37
WooCommerce - Payment Page URL
$payment_page = get_permalink( woocommerce_get_page_id( 'pay' ) );
//make ssl if needed
if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' ) $payment_page = str_replace( 'http:', 'https:', $payment_page );
@Welland
Welland / gist:6f262e542098b9cc46a5
Created June 18, 2014 15:36
WooCommerce - Checkout URL
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
@Welland
Welland / gist:38fd64cfed8740e12405
Created June 18, 2014 15:35
WooCommerce - Cart URL
global $woocommerce;
$cart_url = $woocommerce->cart->get_cart_url();
@Welland
Welland / gist:b33c8b5a5b273449aadb
Last active September 1, 2015 15:33
WooCommerce - My Account URL
$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
if ( $myaccount_page_id ) {
$myaccount_page_url = get_permalink( $myaccount_page_id );
}
@Welland
Welland / gist:4759d026514c641f61df
Last active September 1, 2015 15:34
WooCommerce - Shop Page URL
$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );