Skip to content

Instantly share code, notes, and snippets.

Damien Carbery damiencarbery

Block or report user

Report or block damiencarbery

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@damiencarbery
damiencarbery / allow-wc-rest-api-queries.php
Last active Jun 30, 2019
Disable WooCommerce REST API authentication: Override WooCommerce capability check so that all REST API queries are allowed. https://www.damiencarbery.com/2019/07/disable-woocommerce-rest-api-authentication/
View allow-wc-rest-api-queries.php
<?php
/*
Plugin Name: Disable WooCommerce REST API authentication
Plugin URI: https://www.damiencarbery.com/2019/07/disable-woocommerce-rest-api-authentication/
Description: Override WooCommerce capability check so that all REST API queries are allowed.
Author: Damien Carbery
Version: 0.1
*/
View allow-wc-rest-api-queries.php
<?php
/*
Plugin Name: Disable WooCommerce REST API authentication
Plugin URI: https://www.damiencarbery.com/2019/07/disable-woocommerce-rest-api-authentication/
Description: Override WooCommerce capability check so that all REST API queries are allowed.
Author: Damien Carbery
Version: 0.1
*/
@damiencarbery
damiencarbery / order-details.txt
Last active Jun 21, 2019
WooCommerce REST API authentication: Use Oauth 1 and the WooCommerce REST API to retrieve order details. https://www.damiencarbery.com/2019/06/woocommerce-rest-api-authentication/
View order-details.txt
{
"id": 7755,
"parent_id": 0,
"number": "7755",
"order_key": "wc_order_YjITxJBWgJIFu",
"created_via": "programatically",
"version": "3.6.4",
"status": "completed",
"currency": "EUR",
"date_created": "2019-06-11T08:58:35",
@damiencarbery
damiencarbery / grouped-carousel.php
Last active Jun 17, 2019
Use CMB2 to create a carousel: Add photos to multiple groups and randomise group order in a carousel. https://www.damiencarbery.com/2019/06/use-cmb2-to-create-a-carousel/
View grouped-carousel.php
@damiencarbery
damiencarbery / ninja-forms-submissions.php
Last active Jun 10, 2019
Display Ninja Forms Submissions - Demonstrate viewing form submission data outside of the admin area. https://www.damiencarbery.com/2019/06/display-ninja-forms-submissions/
View ninja-forms-submissions.php
<?php
header('HTTP/1.1 200 OK');
define('WP_USE_THEMES', false);
/** Loads the WordPress Environment */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
$id = 3;
@damiencarbery
damiencarbery / regular-wc-api.php
Created Jun 7, 2019
Trying WooCommerce REST API and then reverting to regular API
View regular-wc-api.php
<?php
// Convert ThriveCart order to WooCommerce order.
// ThriveCart order data is passed via ThriveCart Webhook into $_POST.
// By Damien Carbery, damien@damiencarbery.com, https://www.damiencarbery.com
//
// $Id: tc-to-wc-order.php 4726 2019-06-07 11:10:43Z damien $
// Avoid warnings about element not being set.
function get_post_parameter( $key, $default ) {
@damiencarbery
damiencarbery / mk-local-order.php
Last active Jun 3, 2019
Duplicate a ThriveCart order in WooCommerce: Convert ThriveCart order data into a WooCommerce order. https://www.damiencarbery.com/2019/06/duplicate-a-thrivecart-order-in-woocommerce/
View mk-local-order.php
<?php
/*
// Restrict who can access this script.
$permitted_ips = array('12.34.56.78', '87.65.43.21');
if (in_array($_SERVER['REMOTE_ADDR'], $permitted_ips) == false) {
header('HTTP/1.0 403 Forbidden');
die();
}
*/
@damiencarbery
damiencarbery / nf-copy-email-to-hidden.php
Last active May 27, 2019
Ninja Forms - Copy Fields on Submission: Simplify copying Ninja Forms field values between fields early in the submission. https://www.damiencarbery.com/2019/05/ninja-forms-copy-data-during-submission/
View nf-copy-email-to-hidden.php
<?php
/*
Plugin Name: Copy Email field to Hidden
Plugin URI: https://www.damiencarbery.com
Description: Copy the email field to the hidden field using the NinjaFormsCopyFieldsOnSubmission class.
Author: Damien Carbery
Version: 0.1
*/
View playlist-with-download-link.php
@damiencarbery
damiencarbery / genesis-remove-page-title.php
Created May 22, 2019
Remove the entry-header area on pages. Do not change single posts or archives
View genesis-remove-page-title.php
<?php
/*
Plugin Name: Remove page title (Genesis)
Plugin URI: http://www.damiencarbery.com
Description: Remove the entry-header section (with page title, post info and featured image) from pages but not posts or archives.
Author: Damien Carbery
Version: 0.1
*/
You can’t perform that action at this time.