Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
building things

Chuck Reynolds chuckreynolds

🤖
building things
View GitHub Profile
@norcross
norcross / filter-pages-admin-link.php
Last active Aug 29, 2015
change default 'pages' link to show only published
View filter-pages-admin-link.php
@norcross
norcross / bypass-auto-update-email.php
Last active Aug 29, 2015
Disable the email notification for successful update
View bypass-auto-update-email.php
<?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 Jun 13, 2012
Adds autoembedding of gist urls in WordPress
View embed-gist.php
<?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 Jan 15, 2016
Programmatically tell SearchWP your license key without having to enter it into the license key field
View functions.php
<?php
add_filter( 'searchwp_license_key', function(){
return 'MJqNKfmhT3gVG6kpeyjXvM'; // your license key (found on your payment receipt)
});
View genesis-async.php
<?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 Apr 24, 2014
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.
View permissions.sh
#!/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
@CoastalP47
CoastalP47 / get_posts_terms_fields.php
Last active Apr 14, 2016
WordPress post+terms+fields query
View get_posts_terms_fields.php
<?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 Jan 3, 2017
This is an object-oriented sample Wordpress plugin. Blog Post: http://www.kernelcurry.com/blog/object-oriented-wordpress-plugin
View hello_dolly_oop.php
<?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 Mar 6, 2012
AuthorityLabs JSON Google SERP with Ads
View al-json-serp-ads.json
{
"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 Feb 6, 2017
Display Likes, Tweets, Pageviews, and Comment Counts. Use transient cache to store data for 30 minutes.
View display-social-media-counts.php
<?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 ) ) ) {