Convert (-) and (escape) signs to (_) when uploading files on wordpress media library automatically

You can use sanitize_file_name hook for this. function my_sanitize_file_name( $filename ) { $chars_table = array( ‘ ‘ => ‘_’, ‘-‘ => ‘_’, ); $friendly_filename = preg_replace( array_keys( $chars_table ), array_values( $chars_table ), $filename ); return strtolower( $friendly_filename ); } add_filter( ‘sanitize_file_name’, ‘my_sanitize_file_name’, 10 ); It will also convert letters to lowercase to avoid conflicts on … Read more

Adding custom directory and PHP files in wordpress

The github repo seems to be a custom code that you need drop into your theme directory, update your config file using your twitter credentials and try putting this code inside the body in any of your intended theme files that you will use(eg, index.php) <h1>Tweets of a certain user</h1> <div class=”stream”> <h2><span>Twitter</span></h2> <ul class=”timeline”></ul> … Read more