Skip to content

Instantly share code, notes, and snippets.

Avatar

Todd Lahman toddlahman

View GitHub Profile
View sphp.sh
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.5","5.6","7.0","7.1","7.2", "7.3")
php_array=("php@5.5" "php@5.6" "php@7.0" "php@7.1" "php@7.2" "php@7.3")
valet_support_php_version_array=("php@5.5" "php@5.6" "php@7.0" "php@7.1" "php@7.2" "php@7.3")
php_installed_array=()
php_version="php@$1"
View find the scheme of the blog on WordPress for a URL
/**
* This goes in the main/root plugin file
*/
function my_plugin_url() {
return plugins_url( '/', __FILE__ );
}
@toddlahman
toddlahman / gist:8974532
Created Feb 13, 2014
API Manager api_manager_extra_software_status_data filter hook function usage example
View gist:8974532
<?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 Feb 13, 2014
API Manager api_manager_extra_software_status_data filter hook data array example.
View gist:8974499
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 Jul 4, 2017
API Manager api_manager_extra_software_activation_data filter hook function usage example
View gist:8974365
<?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 Aug 29, 2015
API Manager api_manager_extra_software_activation_data filter hook data array example.
View gist:8974260
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 Aug 29, 2015
API Manager Status Query String
View gist:8974133
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
View gist:8723243
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
View gist:8723225
define(‘DISABLE_WP_CRON’, true);
You can’t perform that action at this time.