Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wordpress programmatically change slug of media attachment site:wordpress.stackexchange.com

add_filter('wp_handle_upload_prefilter', 'custom_upload_filter' );
function custom_upload_filter( $file ){
	$unique = rand(0,100);
	$finalstr = str_replace('.', "-".$unique.".", $file['name']);
   	$file['name'] = $finalstr;
    return $file;
}
Comment

PREVIOUS NEXT
Code Example
Php :: how to install mysql and phpmyadmin on windows 10 
Php :: how to store array in variable php 
Php :: laravel validation 
Php :: artisan command to add resources to controller 
Php :: php catch mysqli_connect(): (HY000/1045): Access denied 
Php :: Laravael Blog Project 
Php :: wp site url link from admin 
Php :: how to do taxonomy filter in wordpress 
Php :: laravel display multiple selected values 
Php :: php csv to array with headers 
Php :: doctrine update entity 
Php :: addphp calculate next letter 
Java :: java get screen size 
Java :: set size of a jframe 
Java :: register listener spigot 
Java :: import android.support.v4.app.ActivityCompat; 
Java :: string to date conversion java 
Java :: java get excectuon time 
Java :: java how to print an array 
Java :: random object of array java 
Java :: ranfom number between 1 to 100 java 
Java :: java random 6 digit number 
Java :: input double java 
Java :: spigot scheduler 
Java :: java create txt file 
Java :: java jcombobox itemlistener only if value changed 
Java :: java split string into list 
Java :: random processing 
Java :: glide latest version android 
Java :: convert object to map scala 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =