Skip to content

Instantly share code, notes, and snippets.

@allendav
Created November 15, 2016 23:25
Show Gist options
  • Save allendav/3e072c3fef10206c184e1646e5749f6b to your computer and use it in GitHub Desktop.
Save allendav/3e072c3fef10206c184e1646e5749f6b to your computer and use it in GitHub Desktop.
Sample dev.php
<?php
/*
Plugin Name: Dev
Plugin URI: http://wordpress.org/plugins/
Description: Does dev things
Author: Allen Snook
Version: 1.0
Author URI: http://allendav.com
*/
define( 'WOOCOMMERCE_CONNECT_FREQUENT_FETCH', true );
define( 'WOOCOMMERCE_CONNECT_DEV_SERVER_URL', 'http://localhost:8085/' );
define( 'WOOCOMMERCE_CONNECT_SERVER_URL', 'http://localhost:5000/' );
function allendav_admin_init() {
// delete_option( 'woocommerce_connect_origin_address' );
// delete_option( 'wc_connect_services' );
// delete_option( 'wcc_debug_logging_enabled' );
// delete_option( 'wc_connect_predefined_packages' );
// delete_option( 'wc_connect_packages' );
// $foo = get_option( 'woocommerce_connect_origin_address' );
// error_log( print_r( $foo, true ) );
// delete_option( 'wc_connect_payment_methods' );
// delete_option( 'wc_connect_account_settings' );
// delete_option( 'wc_connect_store_guid' );
// delete_option( 'wc_connect_tos_accepted' );
$origin = array(
'name' => 'Allen Snook',
'company' => 'FancyPants.com',
'address' => '311 Maple St',
'address_2' => '',
'city' => 'Snohomish',
'state' => 'WA',
'postcode' => '98290',
'country' => 'US'
);
// update_option( 'wc_connect_origin_address', $origin );
}
add_action( 'admin_init', 'allendav_admin_init' );
function allendav_wc_connect_jetpack_access_token( $token ) {
$token = new stdClass();
$token->secret = "askjdflasjdlfkajsldfkjaslkdf.asdkfjlaskjdflajskd";
$token->external_user_id = 0;
return $token;
}
add_filter( 'wc_connect_jetpack_access_token', 'allendav_wc_connect_jetpack_access_token' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment