View nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
# multi_accept on; | |
} | |
http { |
View gist:2032898
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
View multiple-post-query.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => array( 'type1', 'type2', 'type3' ), | |
'posts_per_page' => -1 | |
); | |
$myquery = new WP_Query( $args ); | |
$type1 = 0; $type2 = 0; $type3 = 0; $count = 0; | |
while ( $myquery->have_posts() ) : $myquery->the_post(); |
View nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Start nginx.conf | |
user www-data; | |
worker_processes 8; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; |
View inspect_hooks.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Hook Debug Output | |
* Plugin URI: http://unserkaiser.com | |
* Description: Debug Hooked filter callback functions with adding <code>?debug=secret&hook=your_hook_name</code> to the URl | |
* Version: 0.1 | |
* Author: Stephen Harris, Franz Josef Kaiser | |
* Author URI: http://unserkaiser.com | |
*/ | |
// Prevent loading this file directly - Busted! |
View class-simple-local-avatars.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Custom WordPress Avatars | |
Plugin URI: http://c3mdigital.com | |
Description: Adds a custom avatar uploader in the user profile to replace gravatars with a custom avatar | |
Version: 1.0 | |
Author: Chris Olbekson | |
Author URI: http://c3mdigital.com/ | |
License: GPL v2 | |
*/ |
View get_perm_byname.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gets the permalink from the post slug | |
* @param string $name the post, page or custom post type slug | |
* @param string $p_type the post type | |
* | |
* @return string The permalink YAHHH!!! | |
*/ | |
function get_perm_byname( $name, $p_type = 'page' ) { |
View class-microcache-purge.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Micro Cache Purge PHP Class | |
* Sends a request header to nginx to purge the microcache when post are created or updated | |
* Include this file at plugins_loaded or in theme functions.php | |
*/ | |
new Micro_Cache_Purge(); | |
class Micro_Cache_Purge { |
View front-end-uploads.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* File upload ajax handler function to save the file and send image or file html back to the browser | |
* These functions are part of a class | |
*/ | |
function ajax_upload_file() { | |
check_ajax_referer( 'ugc_user_upload', 'nonce' ); | |
$file_data = array( | |
'name' => $_FILES['ugc_attachment_file']['name'], | |
'type' => $_FILES['ugc_attachment_file']['type'], | |
'tmp_name' => $_FILES['ugc_attachment_file']['tmp_name'], |
OlderNewer