Skip to content

Instantly share code, notes, and snippets.

View fribibb's full-sized avatar

Tim Hurley fribibb

View GitHub Profile
@fribibb
fribibb / wp-rename-uploads.php
Last active June 28, 2022 08:11 — forked from onnimonni/rename-uploads.php
Remove accents from Wordpress uploads. This renames all files and replaces corresponding attachment in WordPress database. This helps to avoid possible problems with *EXITSTING* filenames. To avoid this in future install mu-plugin which hooks in 'sanitize_file_name'
<?php
/**
* Replace-uploads.php
* This replaces all accents from your uploads
* you can run this with wp-cli: $ php wp-cli.phar eval-file rename-uploads.php
*
* You may need to run the outputted move commands in order to update the filenames.
*/
if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) {
@fribibb
fribibb / wordpress-force-login.php
Created January 20, 2017 12:55 — forked from isGabe/wordpress-force-login.php
WordPress: force log in to view any page, with redirect to requested URL#snippet #WordPress
<?php
/*
* Password protect a WordPress site, with a redirect to the requested URL after successful login
*
* Based on:
* http://wordpress.stackexchange.com/a/64999
* http://kovshenin.com/2012/current-url-in-wordpress/
*
**/