Skip to content

Instantly share code, notes, and snippets.

@studiograsshopper
studiograsshopper / sgr-remove-default-image-sizes.php
Created October 10, 2011 11:49
WP Remove default image sizes
<?php
/**
* Remove standard image sizes so that these sizes are not
* created during the Media Upload process.
* Note: these sizes will appear "disabled" in the Media Uploader
*
* Hooked to intermediate_image_sizes_advanced filter
* See wp_generate_attachment_metadata( $attachment_id, $file ) in wp-admin/includes/image.php
*
* @param $sizes, array of default and added image sizes
@studiograsshopper
studiograsshopper / sgr-author-details.php
Created October 9, 2011 16:27
WP Show author details on author archive
<?php
/**
* Function to display author details on the author archive page
*
* @uses get_query_var()
*
* @return echo out the author's details
* @author Ade Walker http://www.studiograsshopper.ch
*/
function sgr_author_info() {
@studiograsshopper
studiograsshopper / test.php
Created October 9, 2011 14:13
WP Add image sizes to media uploader
<?php
/**
* Filter callback to add image sizes to Media Uploader
*
* WP 3.3 pre-beta adds a new filter 'image_size_names_choose' to
* the list of image sizes which are displayed in the Media Uploader after an image
* has been uploaded.
*
* See image_size_input_fields() in wp-admin/includes/media.php
*
@studiograsshopper
studiograsshopper / dump-all-filters.php
Created October 9, 2011 15:05
WP Dump all filters
<?php
add_action( 'all', create_function( '', 'var_dump( current_filter() );' ) );