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 / config.json
Created Oct 11, 2019
Tailwind Config - tailwindcss.now.sh
View config.json
{
"variants": {
"borderColor": ["responsive", "hover", "focus", "focus-within"]
}
}
View restaurant-menu.php
<?php
/*
Template Name: Restuarant Menu Template
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
@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
@Daronspence
Daronspence / FontAwesome.php
Last active Nov 7, 2018
Font Awesome Wordpress Admin Icons
View FontAwesome.php
<?php
// Loads FontAwesome & assigns dashicon prefixed classes to correspond to FontAwesome fallbacks.
// This allows 'dashicons-' to be used when declaring custom post type icons.
function font_awesome_icons(){ ?>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<style>
.dashicons-before:before { font-family: dashicons, FontAwesome; }
.dashicons-suitcase:before { content: "\f0f2"; }
.dashicons-cutlery:before { content: "\f0f5"; }
</style>
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 / acfw_location_rules.php
Last active May 19, 2017
Return an array of rules for use with register_field_group() 'location' key
View acfw_location_rules.php
<?php
/**
* @func acfw_location_rules
* Return an array of rules for use with register_field_group() 'location' key
* @param array $a
* @param str $param
* @param str $operator
* @param bool $extended
*/
function acfw_location_rules( array $a, $param, $op, $extended = false ){
@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 / Current User ACF Meta Fields.php
Last active Dec 27, 2016
Show edit form for current user ACF data/
View Current User ACF Meta Fields.php
<?php
acf_form_head(); // Place this before wp_header();
$options = array(
'post_id' => 'user_'.$current_user->ID,
'field_groups' => array($form_group_ID), // $form_group_ID is the post id of the form group to show.
'submit_value' => 'Update Profile'
);
echo '<p>Your username is <b>'.$current_user->user_login.'</b>. This cannot be changed.</p>';
acf_form( $options ); // http://support.advancedcustomfields.com/forums/topic/front-end-and-custom-user-meta/
?>
You can’t perform that action at this time.