Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $new_rules['images/(d*)$'] = 'index.php?attachment_id=$matches[1]';
- function wpd_attachment_link( $link, $post_id ){
- $post = get_post( $post_id );
- return home_url( '/images/' . $post->post_title );
- }
- add_filter( 'attachment_link', 'wpd_attachment_link', 20, 2 );
- function ro_remove_attachment_title_caption( $attach_id ){
- $args = array(
- 'ID' => $attach_id,
- 'post_name' => "permalinkName",
- );
- wp_update_post( $args );
- }
- add_action( 'add_attachment', 'ro_remove_attachment_title_caption', 10, 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement