Skip to content

Instantly share code, notes, and snippets.

View widoz's full-sized avatar
🍜
Ramen and Code

Guido Scialfa widoz

🍜
Ramen and Code
View GitHub Profile
<?php
/**
* Switch Upload Dir & Url
*
* @since 1.0.0
*
* @param string $file The file path.
* @param string $switch The reference to the string to replace. Allowed 'dir>url', 'url>dir'.
*
* @return string The file url
@widoz
widoz / extraImageNameChoose.php
Last active July 18, 2017 22:03
Media Functions
<?php
/**
* Add Extra Image sizes
*
* Add extra image size to chosen select
*
* @param array $list The list of the default wordpress image sizes
* @return array $list The filtered image sizes
*/
add_filter( 'image_size_names_choose', function( $list ) {