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 / 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
*/
@damiencarbery
damiencarbery / carousel-in-boss-pro.php
Last active May 13, 2019
Replace Boss Pro header with carousel - Liven up the Boss Pro home hero area with a carousel. https://www.damiencarbery.com/2019/05/replace-boss-pro-header-with-carousel/
View carousel-in-boss-pro.php
@damiencarbery
damiencarbery / multisite-plugins-activated.php
Last active May 6, 2019
Active Multisite Plugins: List of active plugins on a Multisite installation. https://www.damiencarbery.com/2019/05/active-multisite-plugins/
View multisite-plugins-activated.php
<?php
/*
Plugin Name: Multisite Plugins Activate
Plugin URI: http://www.damiencarbery.com
Description: List of active plugins on a Multisite installation.
Author: Damien2
*/
// Based on: http://wordpress.stackexchange.com/a/54782/57684
@damiencarbery
damiencarbery / move-title-off-hero-essence-pro.php
Created Apr 29, 2019
Move title off hero image in Essence Pro: Move title off the hero image and back into the content area in Essence Pro theme https://www.damiencarbery.com/2019/04/move-title-off-hero-image-in-essence-pro/
View move-title-off-hero-essence-pro.php
<?php
/*
Plugin Name: Move title off hero image in Essence Pro
Plugin URI: https://www.damiencarbery.com/2019/04/move-title-off-hero-image-in-essence-pro/
Description: Move title off the hero image and back into the content area in Essence Pro theme.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
View slug-to-body-class.php
<?php
/*
Plugin Name: Slug to Body Class
Version: 0.1
Plugin URI: http://www.wpbeginner.com/wp-themes/how-to-add-page-slug-in-body-class-of-your-wordpress-themes/
Description: Add Page/Post Slug to Body Class
Author: Syed Balkhi
Author URI: https://plus.google.com/101623299936375408403/
*/
View essence-pro-titles-to-content.php
<?php
// Disable putting the page title on top of the hero image but retain the hero image creation.
add_action( 'genesis_meta', 'lmtt_essence_page_hero_header', 5 );
function lmtt_essence_page_hero_header() {
remove_action( 'genesis_meta', 'essence_page_hero_header' );
// Hero area setup.
add_action( 'genesis_before_header', 'essence_header_hero_start' );
add_action( 'genesis_after_header', 'essence_header_title_wrap', 90 );
add_action( 'genesis_after_header', 'essence_header_title_end_wrap', 98 );
You can’t perform that action at this time.