Skip to content

Instantly share code, notes, and snippets.

@atwellpub
atwellpub / class.register-taxonomy.php
Last active Jun 24, 2021
taxonomy registration for CPT
View class.register-taxonomy.php
<?php
namespace Example\Register\Taxonomy;
class Profile_Tag {
static $taxonomy_name;
/**
* Initialize Profile_Tag class
@atwellpub
atwellpub / Google App Script - Replace Slide Content Using Google Sheet Data.js
Last active May 27, 2021
Google Apps Script function to replace text in Google Slides with Google Sheet values
View Google App Script - Replace Slide Content Using Google Sheet Data.js
/**
* Function to replace text in Google Slides with Google Sheet values
* @reference https://hudsonatwell.co/2020/10/03/how-to-use-google-slides-to-autogenerate-featured-images/
*/
function generate_featured_image() {
/* get spreadsheet from public view link */
var dataSpreadsheetUrl = "https://docs.google.com/spreadsheets/d/1necmbNPUsGJ3fwNiFpgNLbtH6c2RmJDwIQCPuhAfA7s/edit"; //make sure this includes the '/edit at the end
var ss = SpreadsheetApp.openByUrl(dataSpreadsheetUrl);
@atwellpub
atwellpub / inbound-cornerstone-builder.php
Last active Jul 29, 2019
An attempt to integrate Landing Pages by Inbound Now with the Cornerstone Page Builder. Landing Pages stores field variation data in separate meta keys, usually in the following format: `key-name` for variation A, `key-name-1' for variation B, `key-name-2` for C, etc. Notice how A does not have an appended suffix. The challenge for these page bu…
View inbound-cornerstone-builder.php
<?php
/*
Plugin Name: Inbound Extension - Cornerstone Builder
Plugin URI: http://www.inboundnow.com/
Description: Adds landing pages support to the cornerstone builder
Version: 1.0.8
Author: Inbound Now
Contributors: Hudson Atwell
Author URI: http://www.inboundnow.com/
*/
@atwellpub
atwellpub / functions.php
Last active Dec 11, 2018
Example of a Zapier Webhook listener that imports microblog entries into a CPT named 'news'
View functions.php
<?php
/**
* Zapier Webhook Listener - Creates a status update into the custom post type 'news' , tags it, categorizes it
*/
/* define your secret key - must match the webhook secret key you inputted into the Zapier Zap. */
$ztw_secretkey = 'supersecretkey';
/* hook action to the WordPress 'init' hook. This will process webhook requests from Zapier */
View tweetboost-pro-json-feed-example.json
{
"2018-10-16 15:00:00": {
"id": 923330759510888400,
"id_str": "923330759510888448",
"name": "TweetBoostPRO",
"screen_name": "WPTweetBoost",
"location": "",
"description": "WordPress Plugin - Advanced tweet scheduler that helps WordPress admins schedule tweets from directly within the wp-admin. Check us out!",
"followers_count": 6,
"friends_count": 7,
View tweetboost-pro-rss-feed-example.xml
<item>
<title>
Read our tutorial on how we use TweetBoostPro to create a novelty twitter bot! https://wptweetboost.com/tweet-campaigns/how-to-build-a-twitter-bot-using-wordpress-tweetboostpro/
#WordPress #DevChat #WPchat #devjournal #twitter
</title>
<pubDate>
Thu, 08 Nov 18 12:00:00 +0000
</pubDate>
<description>
View class.woocommerce-product-type.php
<?php
/**
* @credits https://jeroensormani.com/adding-a-custom-woocommerce-product-type/
*/
//error_reporting(E_ALL);
//ini_set('display_errors', 1);
add_action('init' , 'wc_pm_load_product_type');
function wc_pm_load_product_type() {
View functions.php
<?php
/**
* Class Liked_Videos_Custom_Shortcode
* @package
*/
final class Liked_Videos_Custom_Shortcode {
/**
* Main Liked_Videos_Custom_Shortcode Instance
View archive-liked-videos.php
<?php
/**
* The template for displaying archive pages
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* If you'd like to further customize these archive views, you may create a
* new template file for each one. For example, tag.php (Tag archives),
* category.php (Category archives), author.php (Author archives), etc.