Skip to content

Instantly share code, notes, and snippets.

Daron Daronspence

Block or report user

Report or block Daronspence

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
@Daronspence
Daronspence / acf-copy-repeater-field-to-singular.php
Created May 2, 2019
Copy last row of ACF field to hidden custom fields on save
View acf-copy-repeater-field-to-singular.php
<?php
/**
* Plugin Name: ACF Copy Repeater Field to Singular - docs_list_renew
* Version: 0.1
* Description: Copies the values of the last row of a repeater field to separate custom fields to be used with Admin Columns
*/
// Rename the second argument if you're going to copy the plugin to work with another repeater.
add_action('wp_insert_post', 'reddit_acf_copy_repeater_field_to_singular', 10);
@Daronspence
Daronspence / webpack.mix.js
Created Apr 27, 2019
Laravel Mix with Sass and Tailwind 1.0 Configuration
View webpack.mix.js
const mix = require('laravel-mix');
require('laravel-mix-tailwind');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
View acf-ajax.php
<?php
add_action('admin_head', function(){
?>
<script type="text/javascript">
/*
updated JS file for use with ACF >= 5.7.0
*/
View acfw-repeater-example.php
<?php if( have_rows('partners_logos', $acfw) ): ?>
<?php while( have_rows('partners_logos', $acfw) ): the_row(); ?>
<div class="col-md-6">
<img src="<?php the_sub_field('logo', $acfw); ?>" alt="" class="img-responsive">
</div>
<?php endwhile; ?>
<?php endif; ?>
@Daronspence
Daronspence / documentation.md
Last active Apr 11, 2017
Documentation for basic WordPress Usage
View documentation.md

Posts (Blog)

Editing a Post

  • Click on Posts in the left hand menu.
  • Click the title of the post you would like to edit.
  • Make your edits.
  • Click the "Update" button near the top right hand corner.

Update Button

@Daronspence
Daronspence / count-podcasts.php
Last active Dec 12, 2016
Podcast Count Shortcode
View count-podcasts.php
<?php
/**
* Plugin Name: Podcast Shortcode
* Description: Adds a shortcode to display your podcast count. <code>[podcast-count]</code>
* Version: 1.0
* Author: Daron Spence
* Author URI: https://daronspence.com/
*
* A simple shortcode to display the number of published podcasts on your site. Uses the `podcast` post type.
*
@Daronspence
Daronspence / mehTotal.js
Last active Aug 5, 2016
Calculate Meh.com Total
View mehTotal.js
// Run this is the JS console of your Browser.
// jQuery must be loaded
// https://meh.com/orders
var total = 0;
$('span.summary').each(function() {
// Get the QTY and Purchase Price
var nums = $(this).text().match(/\d+\.\d+|\d+\b|\d+(?=\w)/g);
// Multiply QTY by Purchase Price
View sorority-edits.css
.woocommerce-main-image img { width: 100%; }
img {
width: 100%;
}
.single-product div.product .images .thumbnails a.zoom:focus { outline: none; }
@Daronspence
Daronspence / .htaccess-new-requests
Created Aug 2, 2016
Redirect and preserve POST requests
View .htaccess-new-requests
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_METHOD} GET
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R=307,L]
View edd-sl-update-snippet.php
<?php
$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
You can’t perform that action at this time.