Skip to content

Instantly share code, notes, and snippets.

@MZAWeb
MZAWeb / 0_reuse_code.js
Created May 13, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:5438318
<?php
add_filter( 'pre_get_posts', 'cambia_queries', 10, 1 );
function cambia_queries( $query ) {
if ( $query->is_category( 31 ) && $query->is_main_query() ) {
$query->set( 'cat', array( 18, 31 ) );
$query->set( 'posts_per_page', - 1 );
}
return $query;
View plugin.php
<?php
/* Plugin Name: Damn Vulnerable WordPress Plugin
* Description: Intentionally vulnerable plugin for plugin author education
* Version: 0.1
* Plugin URI: http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/
* Author: Jon Cave
* Author URI: http://joncave.co.uk
* License: GPLv2+
*
* DO NOT RUN THIS PLUGIN ON AN INTERNET ACCESSIBLE SITE