Skip to content

Instantly share code, notes, and snippets.

Cory corypratt

Block or report user

Report or block corypratt

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
View gist:f590198243d3c5d7d509cda8e3d57806
$url = 'https://login.libsyn.com';
$args = array(
'headers' => array(
array( 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8' ),
),
'body' => array(
'req' => 'https://four.libsyn.com/stats/ajax-export/show_id/' . $showID . '/type/downloads/target/show/id/' . $showID . '/',
'email' => $email,
'password' => $password
),
View gist:9fa53d2571e19c6c2ae3c51caaf47fa6
if ( $response ) {
$csv = csv_with_headers_to_array( $response['body'] );
if ( array_key_exists('time_period', $csv[0]) ) {
set_transient('_libsyn_transient', 'found', 60 * 60);
set_transient('_libsyn_month', $csv[0]['time_period'], 0);
set_transient('_libsyn_count', $csv[0]['downloads'], 0);
} else {
return;
}
}
@corypratt
corypratt / progress-circle.svg
Created Feb 27, 2018
Progress Circle for FeatherIcons
View progress-circle.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@corypratt
corypratt / cp_get_episode_stats.php
Last active Mar 14, 2019
Wordpress function to get episode stats from Simplecast
View cp_get_episode_stats.php
<?php
/*
* This function can be used to pull total episode stats from Simplecast
*
*/
function cp_get_episode_stats( $podcast_id ) {
if ( ! $podcast_id) {
return "-";
}
View lm_cta_option_page.php
<?php
/*
*
* This code should go in your functions.php
*
*/
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
@corypratt
corypratt / lm_cta_shortcode.php
Last active Apr 9, 2019
Shortcode using ACF to store global calls to action
View lm_cta_shortcode.php
<?php
/*
* This goes in your functions file and will create a shortcode that returns a CTA created with Advanced Custom Fields
*
*/
function lm_global_cta($atts, $content) {
$params = shortcode_atts( array(
'id' => ''
), $atts );
You can’t perform that action at this time.