View filter-wc-orders-by-gateway.php
<?php | |
/** | |
* Plugin Name: Filter WooCommerce Orders by Payment Method | |
* Plugin URI: http://skyverge.com/ | |
* Description: Filters WooCommerce orders by the payment method used :) | |
* Author: SkyVerge | |
* Author URI: http://www.skyverge.com/ | |
* Version: 1.0.0 | |
* Text Domain: wc-filter-orders-by-payment | |
* |
View gist:a8b8234ef720f988dae90db57046343a
<?php | |
/** | |
* start the customisation | |
*/ | |
function custom_woo_before_shop_link() { | |
add_filter('woocommerce_loop_add_to_cart_link', 'custom_woo_loop_add_to_cart_link', 10, 2); | |
add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop'); | |
} | |
add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link'); |
View function.php
function mytheme_setup() { | |
add_theme_support('custom-logo'); | |
} | |
add_action('after_setup_theme', 'mytheme_setup'); |
View add_action.php
add_action('post_submitbox_misc_actions', createCustomField); | |
add_action('save_post', saveCustomField); |
View remove-password-strength.php
add_action( 'wp_print_scripts', 'themeprefix_remove_password_strength', 100 ); | |
// Remove password strength script | |
function themeprefix_remove_password_strength() { | |
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) { | |
wp_dequeue_script( 'wc-password-strength-meter' ); | |
} | |
} |
View add-business-type-for-bp.php
<?php | |
/** | |
* Plugin Name: Add Business Type Option for Business Profile | |
* Plugin URI: http://themeofthecrop.com | |
* Description: Modifies the Business Profile plugin to include a new business type option from the Schema.org collection. | |
* Version: 0.0.1 | |
* Author: Theme of the Crop | |
* Author URI: http://themeofthecrop.com | |
* License: GNU General Public License v2.0 or later | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html |
View functions.php
<?php //<~ don't add in | |
// Declare WooCommerce support for your theme | |
add_theme_support( 'woocommerce' ); |
View header.php
global $woocommerce; | |
if ( sizeof( $woocommerce->cart->cart_contents) > 0 && !is_cart() && !is_checkout() ) : | |
echo '<a href="' . $woocommerce->cart->get_checkout_url() . '" title="' . __( 'Checkout' ) . '">' . __( 'Checkout' ) . '</a>'; | |
endif; |
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
View string-body-class.php
<?php | |
function string_body_class($classes) { | |
if ( isset($_GET) && isset( $_GET['class'] ) ) : | |
$classes[] = sanitize_html_class( $_GET['class'] ); | |
endif; | |
return $classes; |
NewerOlder