Skip to content

Instantly share code, notes, and snippets.

View ldgarc's full-sized avatar

Luis Garcia ldgarc

  • Madrid, Spain
View GitHub Profile
@ldgarc
ldgarc / wp-image-upload-meta.php
Last active December 28, 2017 12:30
Wordpress: Custom Taxonomy Image
<?php // This must be on functions.php
/* Add Image Upload to City Taxonomy */
// Add Upload fields to "Add New Taxonomy" form
function add_city_image_field() {
// this will add the custom meta field to the add new term page
?>
<div class="form-field">
<label for="city_image"><?php _e( 'City Image:', 'pprealty' ); ?></label>
@ldgarc
ldgarc / wp-woo-add-product-meta.php
Created December 28, 2017 12:31
Add Custom Meta to products on WooCommerce
<?php // Code should be on functions.php
// Display Fields
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' );
// Save Fields
add_action( 'woocommerce_process_product_meta', 'woo_add_custom_general_fields_save' );
function woo_add_custom_general_fields() {
@ldgarc
ldgarc / webtogdocs.js
Last active January 10, 2018 23:10 — forked from mhawksey/gist:1276293
Google App Script to insert data to a google spreadsheet via POST or GET - updated version as per https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software