Skip to content

Instantly share code, notes, and snippets.

View toddlahman's full-sized avatar

Todd Lahman toddlahman

View GitHub Profile
/**
* This goes in the main/root plugin file
*/
function my_plugin_url() {
return plugins_url( '/', __FILE__ );
}
@toddlahman
toddlahman / gist:8974532
Created February 13, 2014 12:51
API Manager api_manager_extra_software_status_data filter hook function usage example
<?php
function api_manager_example_get_activation_info( $activation_info ) {
return $activation_info;
}
add_filter( 'api_manager_extra_software_status_data', 'api_manager_example_get_activation_info' );
@toddlahman
toddlahman / gist:8974499
Created February 13, 2014 12:48
API Manager api_manager_extra_software_status_data filter hook data array example.
Array
(
[status_check] => active
[status_extra] => Array
(
[order_key] => wc_order_52f8c4c896636_am_6wcotdeElO4l
[instance] => FIT0DTcFYUgd
[product_id] => API Manager Example
[activation_time] => 2014-02-13 02:40:46
[activation_active] => 1
@toddlahman
toddlahman / gist:8974365
Last active July 4, 2017 00:30
API Manager api_manager_extra_software_activation_data filter hook function usage example
<?php
function api_manager_example_get_sku( $post_id, $data ) {
global $wpdb;
$sku = $wpdb->get_var( $wpdb->prepare( "
SELECT meta_value FROM {$wpdb->prefix}postmeta
WHERE post_id = %s
AND meta_key = '_sku'
LIMIT 1
@toddlahman
toddlahman / gist:8974260
Last active August 29, 2015 13:56
API Manager api_manager_extra_software_activation_data filter hook data array example.
Array
(
[activated] => 1
[instance] => wL3qHpt8HYJ7
[activation_extra] => Array
(
[user_id] => 2
[order_id] => 18
[order_key] => wc_order_52f8c4c896636
[license_email] => toddlahman@todds-macbook-pro.local
@toddlahman
toddlahman / gist:8974133
Last active August 29, 2015 13:56
API Manager Status Query String
http://localhost/toddlahman/?wc-api=am-software-api&email=toddlahman%40todds-macbook-pro.local&licence_key=wc_order_52ac24ebed6b0_am_HxntrDLPdYsM&request=status&product_id=API+Manager+Example&instance=gueGHcbrkdBQ&platform=localhost%2Ftoddlahman
0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * wget -q -O - http://www.mydomainname.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
crontab -e
define(‘DISABLE_WP_CRON’, true);
@toddlahman
toddlahman / gist:8706464
Created January 30, 2014 11:05
API Manager Lost API Page Shortcode
[woocommerce_api_manager_lost_api_key]