This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('upload_mimes', 'custom_upload_mimes'); | |
function custom_upload_mimes ( $existing_mimes=array() ) { | |
// add your extension to the array | |
$existing_mimes['swf'] = 'application/x-shockwave-flash'; | |
$existing_mimes['doc'] = 'application/msword'; | |
$existing_mimes['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; | |
$existing_mimes['pdf'] = 'application/pdf'; | |
// add as many as you like | |
// removing existing file types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on_sent_ok: "jQuery(String.fromCharCode(60)+'img/'+String.fromCharCode(62)).attr('height','1').attr('width','1').css('border-style','none').attr('src','REPLACE_THIS_WITH_YOUR_NOSCRIPT_SRC').appendTo('body');" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Add "Formats" dropdown to TinyMCE Editor | |
*/ | |
function matt2015_mce_formats($buttons) { | |
array_unshift($buttons, 'styleselect'); | |
return $buttons; | |
} | |
add_filter('mce_buttons_2', 'matt2015_mce_formats'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function asanaRequest($methodPath, $httpMethod = 'GET', $body = null) | |
{ | |
$apiKey = 'ASANA_API_KEY_HERE'; /// Get it from http://app.asana.com/-/account_api | |
$url = "https://app.asana.com/api/1.0/$methodPath"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ; | |
curl_setopt($ch, CURLOPT_USERPWD, $apiKey); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apikey=$(git config user.asana-key) | |
if [ $apikey == '' ] ; then exit 0; fi | |
comment=$(git log --pretty=oneline -n1) | |
taskid_pattern='.*#([0-9]*).*' | |
if [[ $comment =~ $taskid_pattern ]]; then | |
taskid=${BASH_REMATCH[1]} | |
apikey=$(git config user.asanakey) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
To use this you have to include the task ID on the commit message. | |
Example: Fixing typo, #9283764018 | |
You can as well close a task within the commit message. | |
Example: Improving the docs, closes #9823761989 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$apikey = ""; // Your API key | |
$workspace = ''; // your project's workspace ID | |
$project = ''; // your project's ID | |
$tasks = array( | |
'Task 1', | |
'Task 2', | |
'Task 3' | |
// etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Plugin Name: CLI Export Multisite | |
*/ | |
if ( ! defined( 'WP_CLI' ) ) return; | |
use \WP_CLI\Utils; | |
/** |
OlderNewer