Skip to content

Instantly share code, notes, and snippets.

@bjork
bjork / h1-remove-full-image-size.php
Created April 26, 2015 10:16
Prevent users from using full size images on WordPress
/*
How to prevent users from using full size images by removing
the full image size option from WordPress image dialog.
*/
function h1_remove_full_image_size( $sizes ) {
unset( $sizes['full'] );
return $sizes;
}
add_filter( 'image_size_names_choose',
@bjork
bjork / h1-move-script-to-bottom.php
Last active August 29, 2015 14:19
Helper functions to move scripts enqueued by WordPress or plugins to bottom
<?php
/**
* Move script(s) to bottom
*
* @param string|array $script_handles Script handles to be moved to bottom
* @param array $args Additional arguments. Defaults to array( 'move_deps' => false ). Set to true to also move scripts dependencies.
*/
function h1_move_script_to_bottom( $script_handles, $args = array() ) {
$defaults = array(