Skip to content

Instantly share code, notes, and snippets.

View DustinHartzler's full-sized avatar

Dustin Hartzler DustinHartzler

View GitHub Profile
@DustinHartzler
DustinHartzler / REST API Example
Created November 24, 2020 21:03
Example for pulling in data from the REST API
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<h1>REST API Application</h1>
<?php
@DustinHartzler
DustinHartzler / functions.php
Created September 4, 2018 15:55
Pass details to Stripe Receipt
// Pass details to Stripe so Stripe receipts are triggered
add_filter( 'wc_stripe_send_stripe_receipt', 'wc_trigger_stripe_receipts' );
function wc_trigger_stripe_receipts() {
return true;
}
add_filter( 'wc_shipment_tracking_get_providers', 'custom_shipment_tracking' );
function custom_shipment_tracking( $providers ) {
unset($providers['Australia']);
unset($providers['Austria']);
unset($providers['Brazil']);
unset($providers['Belgium']);
unset($providers['Canada']);
unset($providers['Czech Republic']);
@DustinHartzler
DustinHartzler / functions.php
Created December 13, 2016 14:16
Remove Flat Rate Envelopes and Small Boxes
/**
* Remove USPS Flat rate envelopes from the available options
* Once added the customer will not see any rates for envelopes
* Only Small, Medium, and Large Flat Rate boxes will be used
*/
add_filter( 'usps_flat_rate_boxes', 'custom_usps_flat_rate_boxes' );
function custom_usps_flat_rate_boxes( $flat_rate_boxes ) {
unset($flat_rate_boxes["d29"]);
unset($flat_rate_boxes["d30"]);
.form-row {
position: relative;
margin-bottom: 25px;
}
.form-row label {
color: #7bae23;
background: #f4f4f4;
border-radius: 3px 0 0 3px;
border-style: solid;
<?php get_header(); ?>
<div role="main" class="main">
<section class="page-top">
<div class="container">
<div class="row">
<div class="col-md-12">
<ul class="breadcrumb">
<li><a href="#">Home</a></li>
<?php
/*
Plugin Name: Custom Post Types
Description: Add on plugin that adds custom post types to theme
Version: 1.0
Plugin URI: http://yourwebsiteengineer.com
Author: Dustin Hartzler
*/
#-----------------------------------------------------------------
function customise_product_brand_slug ( $tax ) {
$tax['rewrite']['slug'] = 'artists';
$tax['labels']['name'] = 'Artists';
$tax['labels']['add_new_item'] = 'Add New Artist';
$tax['labels']['search_items'] = 'Search Artists';
$tax['labels']['all_items'] = 'All Artists';
$tax['labels']['edit_item'] = 'Update Artist';
$tax['labels']['update_item'] = 'Update Artist';
$tax['labels']['new_item_name'] = 'New Artist Name';
return $tax;
function customise_product_brand_slug ( $tax ) {
$tax['rewrite']['slug'] = 'artists';
$tax['labels']['name'] = 'Brands';
return $tax;
}
add_filter( 'register_taxonomy_product_brand', 'customise_product_brand_slug' );
function my_custom_admin_styles() {
?>
<style type="text/css">
.wp-customizer #customize-info, #customize-theme-controls>ul>.accordion-section#accordion-panel-sprh_panel {
display: inherit !important;
}
</style>
<?php
}
add_action('admin_head', 'my_custom_admin_styles');