How to trigger a refresh in the media modal

You can checkout this link https://codex.wordpress.org/Javascript_Reference/wp.media jQuery(function($){ // Set all variables to be used in scope var frame, metaBox = $(‘#meta-box-id.postbox’), // Your meta box id here addImgLink = metaBox.find(‘.upload-custom-img’), delImgLink = metaBox.find( ‘.delete-custom-img’), imgContainer = metaBox.find( ‘.custom-img-container’), imgIdInput = metaBox.find( ‘.custom-img-id’ ); // ADD IMAGE LINK addImgLink.on( ‘click’, function( event ){ event.preventDefault(); // If … Read more

Change attachment filename

This will allow you to rename an attachment as soon as its uploaded: add_action(‘add_attachment’, ‘rename_attachment’); function rename_attachment($post_ID){ $file = get_attached_file($post_ID); $path = pathinfo($file); //dirname = File Path //basename = Filename.Extension //extension = Extension //filename = Filename $newfilename = “NEW FILE NAME HERE”; $newfile = $path[‘dirname’].”https://wordpress.stackexchange.com/”.$newfilename.”.”.$path[‘extension’]; rename($file, $newfile); update_attached_file( $post_ID, $newfile ); }

How To Retrieve An Image Attachment’s Alt Text?

I recently did some research for a client project recently so lo-and-behold I get to use it here! After the text you’ll see a categorized list of most (all?) of the image handling functions from within WordPress 3.0.1 (I grouped them in some semblance of order but don’t put too much credence in my categorization.) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)