Skip to content

Instantly share code, notes, and snippets.

@helen
helen / wp-chosen-tax-metabox.php
Last active April 24, 2022 02:25
Use Chosen for a replacement WordPress taxonomy metabox
<?php
/**
* WordPress Chosen Taxonomy Metabox
* Author: Helen Hou-Sandi
*
* Use Chosen for a replacement taxonomy metabox in WordPress
* Useful for taxonomies that aren't changed much on the fly and are
* non-hierarchical in nature, as Chosen is for flat selection only.
* You can always use the taxonomy admin screen to add/edit taxonomy terms.
* Categories need slightly different treatment from the rest in order to
@johnmegahan
johnmegahan / functions.php
Created January 12, 2012 01:50
Extended Walker class for use with the Twitter Bootstrap toolkit Dropdown menus in Wordpress.
<?php
add_action( 'after_setup_theme', 'bootstrap_setup' );
if ( ! function_exists( 'bootstrap_setup' ) ):
function bootstrap_setup(){
add_action( 'init', 'register_menu' );
@luetkemj
luetkemj / wp-query-ref.php
Last active September 14, 2024 13:06
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@Latz
Latz / testlisttable.php
Created March 21, 2012 14:27
Sample plugin for usage of WP_List_Table class (basic version)
<?php
/*
Plugin Name: Test List Table Example
*/
if( ! class_exists( 'WP_List_Table' ) ) {
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
}
class My_Example_List_Table extends WP_List_Table {
@imjjss
imjjss / gist:2758279
Created May 20, 2012 14:19
Find Posts Dialog Box
http://shibashake.com/wordpress-theme/find-posts-dialog-box
<?php
?>
<form name="plugin_form" id="plugin_form" method="post" action="">
<?php wp_nonce_field('plugin_nonce'); ?>
// Other form elements and code ...
<?php find_posts_div(); ?>
</form>
<?php
@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
*/
@wdalmut
wdalmut / .htaccess
Created July 9, 2012 08:14
Maintenance with .htaccess
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(css|jpg|png)$
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteCond %{REMOTE_ADDR} !^10\.64\.98\.201$
#RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
#RewriteRule ^.*$ /system/maintenance.html [L]
RewriteRule ^.*$ /maintenance.html [L]
@wgh000
wgh000 / province.php
Last active May 18, 2021 15:52
Province Italia - Array PHP
<?php
$province= array(
'AG' => 'Agrigento',
'AL' => 'Alessandria',
'AN' => 'Ancona',
'AO' => 'Aosta',
'AR' => 'Arezzo',
'AP' => 'Ascoli Piceno',
'AT' => 'Asti',
'AV' => 'Avellino',
@johnbillion
johnbillion / wp_mail.md
Last active June 3, 2024 13:31
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail