This file contains hidden or 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
add_filter('manage_upload_columns', 'size_column_register'); | |
function size_column_register($columns) { | |
$columns['dimensions'] = 'Dimensions'; | |
return $columns; | |
} | |
add_action('manage_media_custom_column', 'size_column_display', 10, 2); | |
function size_column_display($column_name, $post_id) { | |
if( 'dimensions' != $column_name || !wp_attachment_is_image($post_id)) | |
return; | |
list($url, $width, $height) = wp_get_attachment_image_src($post_id, 'full'); |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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 res_fromemail($email) { | |
$wpfrom = get_option('admin_email'); | |
return $wpfrom; | |
} | |
function res_fromname($email){ | |
$wpfrom = get_option('blogname'); | |
return $wpfrom; | |
} |
This file contains hidden or 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
// Go to Format > Conditional Formatting. Select "Custom formula is" then add the following formula followed by cell color you wish. | |
=MOD(ROW(A2),2) < 1 |
This file contains hidden or 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
add_filter( 'gform_field_validation_26_79', 'product_quantity_validation', 10, 4 ); | |
add_filter( 'gform_field_validation_26_4', 'product_quantity_validation', 10, 4 ); | |
add_filter( 'gform_field_validation_26_13', 'product_quantity_validation', 10, 4 ); | |
add_filter( 'gform_field_validation_26_14', 'product_quantity_validation', 10, 4 ); | |
add_filter( 'gform_field_validation_26_17', 'product_quantity_validation', 10, 4 ); | |
function product_quantity_validation( $result, $value, $form, $field ) { | |
$quantity = intval( rgar( $value, $field->id . '.3' ) ); | |
if ( $result['is_valid'] && !empty( $quantity ) && $quantity < 5 ) { |
This file contains hidden or 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 myRecalculate() { | |
// The code below opens a spreadsheet using its ID | |
// Note that the spreadsheet is NOT physically opened on the client side. | |
// It is opened on the server only (for modification by the script). | |
var ss = SpreadsheetApp.openById("Put_Your_Spreadsheet_ID_Here"); | |
var sheet = ss.getSheetByName("Support"); | |
var cell = sheet.getRange('B1') | |
cell.setValue(1) |
This file contains hidden or 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
// add text to the thank you page | |
add_action( 'woocommerce_email_before_order_table', 'add_content', 20 ); | |
function add_content() { | |
echo '<h2 id="h2lorem">Lorem Ipsum</h2><p id="pthanks">Illo fugiat mollitia itaque voluptates delectus platea, eius. Odio aperiam, voluptatibus, enim, risus asperiores?</p>'; | |
} |