Skip to content

Instantly share code, notes, and snippets.

View robertdevore's full-sized avatar
🛠️
#NeverNotWorking

Robert DeVore robertdevore

🛠️
#NeverNotWorking
View GitHub Profile
@robertdevore
robertdevore / rd-git-pr-log.md
Last active March 23, 2018 16:12
RD Git PR log

Based on the AA Git Commit Log from Ahmad Awais 💯

sidenote: example text here

📦 NEW:

  • field name
  • function example
  • another item
@robertdevore
robertdevore / set-featured-images-programatically.php
Last active April 3, 2018 13:07
WooCommerce Set Featured Images function
@robertdevore
robertdevore / upgrade_php_5-5_7-1_ubuntu.md
Created April 24, 2018 15:07 — forked from zuhairkareem/upgrade_php_5-5_7-1_ubuntu.md
Upgrading php 5.5.9 to php 7.1 in Ubuntu 14.04 LTS

Add the PPA

sudo add-apt-repository ppa:ondrej/php

Update repos

sudo apt-get update
@robertdevore
robertdevore / install-google-fonts.sh
Created April 24, 2018 16:02 — forked from keeferrourke/install-google-fonts.sh
A bash script to install all Google Fonts, system wide, on debian based systems (ex. Ubuntu)
#!/bin/sh
# Written by: Keefer Rourke <https://krourke.org>
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git>
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git
sudo apt-get install fonts-cantarell, ttf-ubuntu-font-family, git
srcdir="/tmp/google-fonts"
pkgdir="/usr/share/fonts/truetype/google-fonts"
giturl="git://github.com/google/fonts.git"
<?php
$current_user = wp_get_current_user();
$billing_postcode = get_user_meta( $current_user->ID, 'billing_postcode', true );
@robertdevore
robertdevore / wordpress-all-pages-array.php
Last active May 9, 2018 19:20
Create array of all pages in WordPress.
<?php
// Get loop of all Pages.
$args = array(
'sort_column' => 'post_title',
'hierarchical' => 1,
'post_type' => 'page',
'post_status' => 'publish'
);
$pages = get_pages( $args );
@robertdevore
robertdevore / woocommerce-publish-product-action-hook.php
Created May 10, 2018 16:06
Do something when a product is published in WooCommerce
<?php
/**
* @snippet Do Something When Product is Published
* @how-to Watch tutorial @ https://businessbloomer.com/?p=19055
* @sourcecode https://businessbloomer.com/?p=543
* @author Rodolfo Melogli
* @testedwith WooCommerce 3.2.6
*/
function add_this_to_new_products( $new_status, $old_status, $post ) {
jQuery(function ($) {
$(".price-dropdown").hover(
function () {
$(this).addClass('display-block');
},
function () {
$(this).removeClass('display-block');
}
);
});
@robertdevore
robertdevore / pmpro-limit-available-plugins-and-themes.php
Created May 17, 2018 00:03 — forked from strangerstudios/pmpro-limit-available-plugins-and-themes.php
Limit the available plugins and themes for networks sites in a WordPress multisite install using Paid Memberships Pro.
<?php
/*
Plugin Name: PMPro Limit Available Plugins and Themes
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-limit-available-plugins/
Description: Limits Which Plugins are Available for Network Sites
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
1. Place this file in wp-content/mu-plugins.
@robertdevore
robertdevore / wpd-rest-api-flowers-category.php
Created May 19, 2018 19:53
The current way WP Dispensary adds in the custom flowers_category taxonomy to the Flowers REST API endpoint
<?php
/**
* Add Category taxonomy for the Flowers Custom Post Type
*/
function flowers_category( $data, $post, $request ) {
$_data = $data->data;
$_data['flowers_category'] = get_the_term_list( $post->ID, 'flowers_category', '', ' ', '' );
$data->data = $_data;
return $data;
}