Skip to content

Instantly share code, notes, and snippets.

View josephhinson's full-sized avatar

Joseph Hinson josephhinson

View GitHub Profile
@josephhinson
josephhinson / remote_folder_rewrite
Last active September 18, 2015 01:25
serve wp-uploads from production in dev htaccess
RewriteEngine On
RewriteBase /wp-content/uploads/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^tempurl.com$
RewriteRule ^(.+)$ http://siteurl.com/wp-content/uploads/$1 [L,R=301,NE]
@AramZS
AramZS / Post related objects
Last active December 31, 2015 16:09
WordPress Objects
<?php
/**
* Tag
object(stdClass)#427 (9) {
["term_id"]=>
string(2) "18"
["name"]=>
string(4) "test"
["slug"]=>
string(4) "test"
@arelthia
arelthia / get_user_level.php
Last active December 16, 2015 00:59
Determines if the specified WLM membership level exists for the current user
/*
* determines if the specified membership level exists for the current user
* returns 0 (level does not match user) or 1 (level matched user)
*accepts string level name
*/
function pp_get_level($culevel){
//get the current user
$current_user = wp_get_current_user();
//get the users id