Skip to content

Instantly share code, notes, and snippets.

$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
),
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 February 27, 2018 19:26
Progress Circle for FeatherIcons
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 March 14, 2019 22:06
Wordpress function to get episode stats from Simplecast
<?php
/*
* This function can be used to pull total episode stats from Simplecast
*
*/
function cp_get_episode_stats( $podcast_id ) {
if ( ! $podcast_id) {
return "-";
}
@corypratt
corypratt / lm_cta_option_page.php
Created April 9, 2019 13:54
Create ACF option page
<?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 April 9, 2019 14:24
Shortcode using ACF to store global calls to action
<?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 );
@corypratt
corypratt / remove-recent-comments.php
Created December 7, 2023 15:40
WordPress - Remove Recent Comments Box
<?php
/**
* Disable the Recent Comments Widget from the WordPress Admin dashboard.
*/
function remove_dashboard_widgets() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] );
}
add_action( 'wp_dashboard_setup', 'remove_dashboard_widgets' );