Skip to content

Instantly share code, notes, and snippets.

View agusmu's full-sized avatar

agusmu

  • Indonesia
  • 14:57 (UTC +07:00)
View GitHub Profile
<?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.

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@agusmu
agusmu / functions1a.php
Last active May 1, 2024 13:27
Customize WooCommerce Categories & Tags Label
/* Customize Product Categories Labels */
add_filter( 'woocommerce_taxonomy_args_product_cat', 'custom_wc_taxonomy_args_product_cat' );
function custom_wc_taxonomy_args_product_cat( $args ) {
$args['label'] = __( 'Product Categories', 'woocommerce' );
$args['labels'] = array(
'name' => __( 'Product Categories', 'woocommerce' ),
'singular_name' => __( 'Product Category', 'woocommerce' ),
'menu_name' => _x( 'Categories', 'Admin menu name', 'woocommerce' ),
'search_items' => __( 'Search Product Categories', 'woocommerce' ),
'all_items' => __( 'All Product Categories', 'woocommerce' ),
@agusmu
agusmu / functions.php
Created February 20, 2014 10:48 — forked from kloon/functions.php
WooCommerce 2.1 variation price, revert to 2.0 format
// 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 );
@agusmu
agusmu / 0_reuse_code.js
Created December 23, 2013 04:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@agusmu
agusmu / style.css
Created December 10, 2013 11:55
PrimaShop - Customize Font Size
/* Default Font Size */
body {
font-size: 14px;
}
/* Top Navigation Font Size */
#topnav {
font-size: 12px;
}
/* Footer Widgets Font Size */
#footer-widgets {
@agusmu
agusmu / page_withcomments.php
Last active December 30, 2015 10:29
PrimaShop - Create Page With Comments Displayed
<?php
/**
* Template Name: Page With Comments
* Description: The template for displaying comments on a page.
*
* @category PrimaShop
* @package Templates
* @author PrimaThemes
* @link http://www.primathemes.com
*/
@agusmu
agusmu / functions.php
Created November 28, 2013 09:59
WooCommerce - Add custom block to the end of product summary
add_action( 'woocommerce_single_product_summary', 'prima_custom_block_product_summary', 50 );
function prima_custom_block_product_summary() {
?>
YOUR CUSTOM HTML CODE HERE
<?php
}
@agusmu
agusmu / sale-flash.php
Created November 23, 2013 12:51
WooCommerce - Replace Sale Flash Content With Product Price
<?php
/**
* Replace Sale Flash Content With Product Price
*
* @author PrimaThemes
* @package WooCommerce
* @version 1.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly