Timeline for Generate links on all images in posts - is there a hook?
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 15, 2018 at 1:53 | history | edited | Rick Hellewell | CC BY-SA 4.0 |
added 830 characters in body
|
Sep 15, 2018 at 0:00 | comment | added | Rick Hellewell | For images as attachments, try the code here as a starting point: wordpress.stackexchange.com/questions/63980/… . | |
Sep 14, 2018 at 22:41 | comment | added | Joschi | do_shortcode seems not to help, i might be wrong, but it does not seem to execute the shortcodes but filter them out -> returns (string) Content with shortcodes filtered out. edit ok, it actually should do the shortcoes... but thats also the case if i give it the priority 12 because the shortcodes run at 11... i dont get i O_o | |
Sep 14, 2018 at 22:21 | comment | added | Joschi | I was just about to post, that it works with normal images but not with shortcodes :D let me fiddle arround with this a little, thanks! | |
Sep 14, 2018 at 22:08 | history | edited | Rick Hellewell | CC BY-SA 4.0 |
added additional info on shortcodes not processed
|
Sep 14, 2018 at 21:53 | comment | added | Joschi |
Unfortunately this does not work for me, it has the same effect as $content = str_replace('<a href="https://example.com/wp-content/uploads/','<a href="https://example.com?editor=82&image=',$content); it does not find any strings at all, however this works (bit it will also replace urls in <img> tag: $content = str_replace('/wp-content/uploads/','<a /?editor=82&image=',$content); Kind of strange if you ask me, as if the tags are added way later...
|
|
Sep 14, 2018 at 20:30 | comment | added | Joschi | Hey Rick, thank you very much, that actually could help a lot! :) I will play around with this a little and will report back in a few days :) | |
Sep 14, 2018 at 1:32 | history | answered | Rick Hellewell | CC BY-SA 4.0 |