Skip to content

Instantly share code, notes, and snippets.

View isabelc's full-sized avatar
🕶️

Isabel C isabelc

🕶️
View GitHub Profile
@isabelc
isabelc / gist:ecf1a3bed0895bf49c24ddde7fd03b39
Created January 18, 2017 19:12
Add content to top of the Simple Membership Profile page
/**
* Add custom content at the top of the Simple Membership Profile page
*/
function abc_membership_profile_page_top( $default ) {
$url = 'http://yoursite.com/chart-page/';
$custom_content = '<p>Create a <a href="' . esc_url( $url ) . '" target="_blank">birth report</a>.</p>';
// Load the default edit profile template
@isabelc
isabelc / isa-check-if-woocommerce-pa-is-tax
Last active January 7, 2016 13:47
Check if your WooCommerce custom product attributes are taxonomies. This will show custom product attributes on your product page above the Add to Cart button. THIS WILL ALSO SHOW A NOTICE ON THE PRODUCT PAGE RIGHT UNDER THE ATTRIBUTES. THE NOTICE WILL EITHER SAY: "These ARE taxonomies." or "NOT a taxonomy."
/**
* Check if your WooCommerce custom product attributes are taxonomies.
*
* This will show custom product attributes on your product page
* above the Add to Cart button.
*
* THIS WILL ALSO SHOW A NOTICE ON THE PRODUCT PAGE
* RIGHT UNDER THE ATTRIBUTES.
*
* THE NOTICE WILL EITHER SAY:
@isabelc
isabelc / gist:8829632
Last active August 29, 2015 13:56
Migrate tickets from "wpsc Support Tickets" to "Email Support Tickets" plugin. This script should only be run BEFORE any new tickets in the new plugin are created. So, run immediately upon installing Email Support Tickets. STEPS: 1. Paste the following PHP script into a blank file. 2. Edit line three to replace YOUR_DB_HOST, YOUR_DB_NAME, YOUR_D…
<?php
$db = new PDO('mysql:host=YOUR_DB_HOST;dbname=YOUR_DB_NAME', 'YOUR_DB_USERNAME', 'YOUR_DB_PASSWORD', array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,));
// Tickets table
$row = array();
$table1 = "SELECT `primkey`, `title`, `initial_message`, `user_id`, `email`, `assigned_to`, `severity`, `resolution`, `time_posted`, `last_updated`, `last_staff_reply`, `target_response_time`, `type` FROM `wp_wpscst_tickets`";