Custom permalink for attachment
Custom permalink for attachment
Custom permalink for attachment
You call wp_delete_attachment passing $attachmentid which is undefined, so it can’t work… Also the $force_delete variable isn’t defined anywhere in your code. Also there is no point in using normal loop in here – you don’t use template tags in this action, so calling the_post is just a waste of resources… add_action( ‘set_user_role’, function( $user_id, … Read more
It took me a while to figure this out… In the end all it takes is: <?php echo wp_audio_shortcode( array( “src” => wp_get_attachment_url() ) ); ?>
To do this, go into Settings » Media and set all the values to 0. Like this:
Send data URL string as an attachment in wp_email
I did it! In the end, I used the standard $_REQUEST and $_GET to store and fetch the value in the date-picker instead of all the fancy hooks and filters. The only thing I am not able to fathom out is the deal with input type-button. It was not storing the value in $_REQUEST. But … Read more
The simplest way is to use the built-in custom fields. If you don’t see them by default, while you’re editing a Post/Page/CPT, choose “Screen Options” at the top right of the screen and check the “Custom Fields” box. Then scroll down through the editor until you see the Custom Fields box. Decide what you want … Read more
You can delete Images from Admin panel Media Tab manually using Multi-select Deletion option OR Delete from DB also as per media attachment ids. I think Multi select deletion from Media tab is the best way to delete. Hope this will help you!
There’s a couple functions to get different attachment parameters based on one another, but a cursory look doesn’t indicate there’s one to get one based on the Attachment Page URL. You could try and get the Post ID based on the Name (or Title) using the $wpdb class, and then drop that ID into the … Read more
wp_delete_attachment doesn’t delete image files / doesn’t work