Disable edit media attachments?

I figured it out. Just put this in your functions.php file add_action(‘admin_head-media-upload-popup’, ‘remove_edit_image_button’); // for the pop up media box add_action(‘admin_head’, ‘remove_edit_image_button’); // for the media page function remove_edit_image_button() { ?> <style> .A1B1 p .button { display:none; } </style> <?php }

Adding class to next/prev image link in attachment.php

There two hooks to filter these links: previous_image_link and next_image_link. So we can add these classes per filter: add_filter( ‘previous_image_link’, ‘wpse_77296_img_link_class’ ); add_filter( ‘next_image_link’, ‘wpse_77296_img_link_class’ ); /** * Add CSS class to image navigation links. * * @wp-hook previous_image_link * @wp-hook next_image_link * @param string $link Complete markup * @return string */ function wpse_77296_img_link_class( $link … Read more

Insert custom ID into wp_get_attachment_link

You have to supply a argument count when adding the filter callback, and add the arguments you are expecting to receive to your callback function. Looking at the wp_get_attachment_link source you can tell that 6 arguments is supplied when applying the filters (the link markup and $id, $size, $permalink, $icon, $text). Here’s how you could … Read more

Confused with attachment mimetype order

Yes, this does seem like a lapse in template hierarchy. The easiest for case described would probably be handling logic in image.php, along the lines of (see get_attachment_template() for mime type retrieval): if( ‘gif’ === $subtype ) { include ‘gif.php’; } else { // generic image template } For more complicated logic it might be … Read more

How can I change wordpress attachment url and protect it?

I’ve figured out a solution, here is my answer 1, we can’t modify WordPress original data input, but we can modify and rewrite the output. So we can use the_content,wp_get_attachment_url to change this. add this code snippets into your plugins if (function_exists(‘add_filter’)) { add_filter(‘the_content’, array($scplugin, ‘AttachmentRewrite’), 10, 1); add_filter(‘wp_get_attachment_url’, array($scplugin, ‘AttachmentUrlRewrite’), 10, 1); } the … Read more

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