Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
// Use WC 2.0 variable price format, now include sale price strikeout | |
add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 ); | |
add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 ); | |
function wc_wc20_variation_price_format( $price, $product ) { | |
// Main Price | |
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) ); | |
$price = $prices[0] !== $prices[1] ? sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); | |
// Sale Price | |
$prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) ); | |
sort( $prices ); |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
<?php | |
/** | |
* Dont Update the Theme | |
* | |
* If there is a theme in the repo with the same name, this prevents WP from prompting an update. | |
* | |
* @since 1.0.0 | |
* @param array $r Existing request arguments | |
* @param string $url Request URL | |
* @return array Amended request arguments |
<?php | |
/** | |
* _s Theme Options | |
* | |
* @package _s | |
* @since _s 1.0 | |
*/ | |
/** | |
* Register the form setting for our _s_options array. |
<?php | |
define( 'THEMENAME', 'Kallyas' ); | |
require_once dirname( __FILE__ ) . '/framework/class-tgm-plugin-activation.php'; | |
add_action( 'tgmpa_register', 'kallyas_register_required_plugins' ); | |
function kallyas_register_required_plugins() { | |
/** |
<?php | |
function sb_edd_filter_license_limit( $limit, $download_id, $license_id, $price_id ) { | |
$payment_id = get_post_meta( $license_id, '_edd_sl_payment_id', true ); | |
$is_bundle = false; | |
$bundle_items = array(); | |
$downloads = edd_get_payment_meta_downloads( $payment_id ); | |
if( $downloads ) { | |
foreach( $downloads as $download ) { |
<?php | |
function themename_customize_register($wp_customize){ | |
$wp_customize->add_section('themename_color_scheme', array( | |
'title' => __('Color Scheme', 'themename'), | |
'priority' => 120, | |
)); | |
// ============================= |
<?php | |
/** | |
* @class Export_Import_Install_Control | |
*/ | |
final class Export_Import_Install_Control extends WP_Customize_Control { | |
/** | |
* @method render_content | |
* @protected |
if ( $post->post_parent ) | |
{ | |
wp_redirect( get_permalink( $post->post_parent ), 301 ); | |
} | |
else | |
{ | |
wp_redirect( site_url(), 301 ) ); | |
} | |
die(); |
<?php | |
add_filter("the_content", "the_content_filter"); | |
function the_content_filter($content) { | |
// array of custom shortcodes requiring the fix | |
$block = join("|",array("col","shortcode2","shortcode3")); | |
// opening tag |