THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
<?php | |
// change the date format for the filename from YYYY_MM_DD_HH_SS to YYYY-MM-DD | |
function wc_csv_export_edit_filename( $post_replace_filename, $pre_replace_filename ) { | |
// define your variables here - they can be entered in the WooCommerce > CSV Export > Settings tab | |
$variables = array( '%%timestamp%%' ); | |
// define the replacement for each of the variables in the same order | |
$replacement = array( date( 'Y-m-d' ) ); | |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
A little explanation for those who have no idea what NOBLOGREDIRECT is. | |
The define(‘NOBLOGREDIRECT’, ‘%siteurl%’); inside of the wp-config.php makes it so that when someone enters a subdomain that does not exist on your site to redirect to whatever url you wish it to. You can use this to have it either go to a specific FAQ page or directly back to the main root installation, anywhere you want to direct it. the %siteurl% can be replaced for example define(‘NOBLOGREDIRECT’, ‘http://frumph.net/FAQ/site-create’); | |
When someone in their browser tries to go to (for example) http://badsubdomain.frumph.net/ a subomain which doesn’t exist, it will go to what is defined in NOBLOGREDIRECT. | |
Without using NOBLOGREDIRECT the (for example) http://badsubdomain.frumph.net/ – which is a subdomain that doesn’t exist would direct to the signup page asking which reports whether or not the user can create the bad subdomain in question. This is fine, there’s nothing wrong with it redirecting to the signup page if someone put |
/** | |
* Get a random floating point number between `min` and `max`. | |
* | |
* @param {number} min - min number | |
* @param {number} max - max number | |
* @return {number} a random floating point number | |
*/ | |
function getRandomFloat(min, max) { | |
return Math.random() * (max - min) + min; | |
} |
/** | |
* Flatten a multi dimension array. For an associative array the child keys are separated by underscore(_). | |
* @author Muntasir Mohiuddin | |
* @param array $a multidimensional array to flatten | |
* @param array $a multidimensional array to save values | |
* @param string $p previous parents separated by underscore(_) | |
* @return array all flattened keys | |
*/ | |
function flatten_array($a, &$r, $p=NULL){ | |
foreach($a as $k => $v) { |
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 ); | |
function woo_rename_tabs( $tabs ) { | |
global $product; | |
if( $product->has_attributes() || $product->has_dimensions() || $product->has_weight() ) { // Check if product has attributes, dimensions or weight | |
$tabs['additional_information']['title'] = __( 'Product Data' ); // Rename the additional information tab | |
} | |
<?php /* | |
Plugin Name: Dynamic Image Resizer | |
Plugin URI: http://ottopress.com | |
Author: Otto42 / Modified by JochenT | |
Author URI: http://ottodestruct.com | |
Version: 1.0.0.1.jt-3 (11.10.2013) | |
Description: Change the WordPress image uploader system to do image resizing on the fly. | |
*/ | |
/* |
<?php | |
/** | |
* Symbolic Press is a helper to help you use your WordPress plugins with Symbolic Links. | |
* | |
* Read more about it on: | |
* @link http://www.gayadesign.com/diy/using-wordpress-plugins-as-symbolic-links/ | |
*/ | |
class Symbolic_Press { | |
public $plugin_path; | |
public $plugin_name; |
IMPORTANT | |
Please duplicate this radar for a Safari fix! | |
This will clean up a 50-line workaround. | |
rdar://22376037 (https://openradar.appspot.com/radar?id=4965070979203072) | |
////////////////////////////////////////////////////////////////////////////// | |
(Now available as a standalone repo.) |