Setting name of attachment URL

You can hook onto add_attachment and force the slug to work off the filename like so: Update: To uppercase the slug, you’ll need to add a temporary filter onto wp_unique_post_slug. You can’t simply use strtoupper( $slug ) as WordPress sanitises (lowercases) it within the update function. /** * Force attachment slug to ignore title from … Read more

Extract url from next_image_link

The function below is derived from adjacent_image_link() function. You can get both previous and next image source by this function. It can be used inside or outside loop. Uses // get next image src $src = wpse145194_get_adjacent_image_link(); // get previous image src $src = wpse145194_get_adjacent_image_link(true); Function function wpse145194_get_adjacent_image_link( $prev = false, $size=”thumbnail”, $post_id = false) … Read more

Add link to attachment for old posts

You can use the the_content filter to access the contents of the post before it is printed to the screen. The function that you use to filter it can either go two routes – using regex to parse the contents (not the “right” way but faster/dirtier) or an HTML parser. You should then be able … Read more

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