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
View ACF Group Fields.php
<?php
/**
* acf_group_fields
*
* This function return an array of all the field names within a field group.
*
* @type function
* @date 24/9/14
* @since 5.0.8
*
@Daronspence
Daronspence / Fade & Repeat.js
Last active Aug 29, 2015
jQuery Fade Each & Repeat
View Fade & Repeat.js
(function($) {
function fadeloop(){ // loops through elements and fades them sequentially
$('.my-element').each(function( index, element){
$(element).delay(index*4000).fadeIn(500).delay(3000).fadeOut(500);
});
}
function fade(){ // calls itself to repeat
window.setTimeout(fadeloop, 0);
window.setTimeout(fade, 16000);
}
@Daronspence
Daronspence / WordpressNav.scss
Last active Aug 29, 2015
Wordpress Navigation
View WordpressNav.scss
.main-navigation {
background: #333;
position: fixed;
top: 0;
height: 4.5rem;
width: 100%;
.nav-menu {
@include container();
list-style: none;
}
View g-map-acf-bug-fix.js
// LINE 3927 of input.js
/////////////////////////////
// OLD CODE
////////////////////////////
// update inputs
this.$el.find('.input-lat').val( lat );
this.$el.find('.input-lng').val( lng ).trigger('change');
View page-content-from-child-templates.php
<?php
$args = array(
// Get children of current page
'post_parent' => $post->ID,
'post_type' => 'page',
);
$query = new WP_Query($args);
View location rules.php
<?php
'location' => array(
array(
array(
'param' => 'widget',
'op' => '==',
'value' => 'pages'
),
array(
'param' => 'widget',
View acf_namespacing_ex1.php
<?php
$args = array(
'post_type' => 'morning_show'
);
$actors = new WP_Query($args);
if ( $actors->have_posts() ) : while ( $actors->have_posts() ) : $actors->the_post() :
the_field('actors');
View is-plugin-installed.php
$installed_plugins = array();
// check if ACF is installed
if ( is_multisite() ) :
$network_plugins = get_site_option( 'active_sitewide_plugins', array() );
$site_plugins = get_option( 'active_plugins', array() );
$installed_plugins = array_merge($network_plugins, $site_plugins);
else :
@Daronspence
Daronspence / remove-anonymous-object.php
Last active Aug 29, 2015
Remove actions/filters from anonymous class instance
View remove-anonymous-object.php
// All of your classes in /acf/forms/ are called anonymously
// so it's near impossible to filter them out without this jargon. :(
// example of won't work, but should
remove_filter('in_widget_form', array('acf_form_widget', 'edit_widget'), 10 );
// See http://wordpress.stackexchange.com/questions/137688/remove-actions-filters-added-via-anonymous-functions
function acfw_remove_object_filter( $tag, $class, $method = NULL, $priority = NULL ) {
$filters = $GLOBALS['wp_filter'][ $tag ];
if ( empty ( $filters ) ) {
View edd-sl-changlog-widget-output.php
// Line 109 from EDD_SL_Changelog_Widget.php
$changelog = apply_filters( 'edd_sl_changeloge_widget_output' , get_post_meta( $post_id, '_edd_sl_changelog', true ) );
You can’t perform that action at this time.