Skip to content

Instantly share code, notes, and snippets.

💻
<code />

Greg Rickaby gregrickaby

💻
<code />
Block or report user

Report or block gregrickaby

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
@gregrickaby
gregrickaby / composer.json
Created Jul 12, 2019
WDS New Project Composer Setup
View composer.json
{
"name": "foo-project/wordpress-wp-content",
"description": "Plugins and Theme to power the Foo Project website built atop WordPress.",
"type": "project",
"require": {
"webdevstudios/sso": "^2.0",
"webdevstudios/advanced-custom-fields-pro": "^5.8",
"yoast/wordpress-seo-premium": "^11.6",
"wpackagist-plugin/stream": "^3.3",
"webdevstudios/wp-migrate-db-pro": "^1.9",
@gregrickaby
gregrickaby / disable-beaver-builder-global-padding-margin.php
Last active Oct 2, 2019
Disable Beaver Builder global padding and margin
View disable-beaver-builder-global-padding-margin.php
<?php
/**
* Set Beaver Builder defaults
*
* @param {object} $defaults The default settings.
* @param {object} $form)_type The module settings.
* @return $defaults
*/
function grd_set_bb_defaults( $defaults, $form_type ) {
@gregrickaby
gregrickaby / javascript_101.md
Last active Sep 15, 2017
JavaScript: How to create new div dynamically, change it, move it, modify it in every way possible?
View wp-query-ref.php
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
View get-related-posts-by-tag.php
View gist:5d3bc24e60d272bb74255cfdb7828f41

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
View output-buffer-correct.php
<?php
/**
* Create the hero markup based on arguments.
*
* @param array $args The hero arguments
* @return string The hero markup
* @author Greg Rickaby
*/
function wds_client_get_hero( $args = array() ) {
@gregrickaby
gregrickaby / functions.php
Created Jun 9, 2016
Filter a custom post type after it's been registered
View functions.php
<?php
/**
* Filter the Products CPT to register more options.
*
* @param $args array The original CPT args.
* @param $post_type string The CPT slug.
*
* @return array
*/
You can’t perform that action at this time.