Skip to content

Instantly share code, notes, and snippets.

View chuckreynolds's full-sized avatar
🤖
building things

Chuck Reynolds chuckreynolds

🤖
building things
View GitHub Profile
@norcross
norcross / filter-pages-admin-link.php
Last active August 29, 2015 14:04
change default 'pages' link to show only published
@norcross
norcross / bypass-auto-update-email.php
Last active August 29, 2015 14:04
Disable the email notification for successful update
<?php
function rkv_bypass_auto_update_email( $send, $type, $core_update, $result ) {
// check our type and bail if successful
if ( ! empty( $type ) && $type == 'success' ) {
return false;
}
// return the send function
return true;
@roborourke
roborourke / embed-gist.php
Created June 13, 2012 22:17
Adds autoembedding of gist urls in WordPress
<?php
/**
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*/
@jchristopher
jchristopher / functions.php
Created January 15, 2016 02:19
Programmatically tell SearchWP your license key without having to enter it into the license key field
<?php
add_filter( 'searchwp_license_key', function(){
return 'MJqNKfmhT3gVG6kpeyjXvM'; // your license key (found on your payment receipt)
});
<?php
/**
* Adding all Asynchronous Javascripts to posts and pages
*/
function add_bulk_async_sdk() { ?>
<script>
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
add = function(url, id) {
@chuckreynolds
chuckreynolds / permissions.sh
Created April 24, 2014 10:46
permissions.sh shell script for WordPress installs to set file and directory permissions and ownership. Change the path to fit your install. Make sure to 'chmod 700 permissions.sh' before using './permissions.sh' to run it.
#!/bin/bash
find /var/www/public -type d -exec chmod 755 {} +
find /var/www/public -type f -exec chmod 644 {} +
chown -R www-data:www-data /var/www/public
@pat-eason
pat-eason / get_posts_terms_fields.php
Last active April 14, 2016 08:24
WordPress post+terms+fields query
<?php
//create our mega query with post data, meta fields, and taxonomies
function get_posts_terms_fields($params=null){
global $wpdb;
$defaults=array(
'posts_per_page' => 5,
'offset' => 0,
'category' => '',
'category_name' => '',
@michaelcurry
michaelcurry / hello_dolly_oop.php
Last active January 3, 2017 03:28
This is an object-oriented sample Wordpress plugin. Blog Post: http://www.kernelcurry.com/blog/object-oriented-wordpress-plugin
<?php
/**
* @package Hello_Dolly_OOP
* @version 0.1
*/
/*
Plugin Name: Hello Dolly OOP
Plugin URI: http://kernelcurry.com/blog/object-oriented-wordpress-plugin
Description: This plugin is an object oriented version of Matt Mullenweg's Hello Dolly plugin.
Version: 0.1
@chasers
chasers / al-json-serp-ads.json
Created March 6, 2012 22:46
AuthorityLabs JSON Google SERP with Ads
{
"total_number_of_results": 47300000,
"blog_posts": false,
"video_packs": [
33
],
"invalid_term": false,
"integrated_places": false,
"rank_date": "2012-03-06",
"data_center": "us",
@gregrickaby
gregrickaby / display-social-media-counts.php
Last active February 6, 2017 08:56
Display Likes, Tweets, Pageviews, and Comment Counts. Use transient cache to store data for 30 minutes.
<?php
/**
* Get tweet count from Twitter API (v1.1)
*/
function wds_post_tweet_count( $post_id ) {
// Check for transient
if ( ! ( $count = get_transient( 'wds_post_tweet_count' . $post_id ) ) ) {