poopymonster
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Theme: Divi] Use CSS as backgroundThanks, it’s working now ??
Forum: Themes and Templates
In reply to: [Theme: Divi] Use CSS as backgroundOfcourse ??
https://koffid.nl/gfxForum: Hacks
In reply to: Preg_replace can it ignore shortcodes?Very insightful. Thanks again for your detailed help.
Forum: Hacks
In reply to: Preg_replace can it ignore shortcodes?I have no idea what’s going wrong on my end.
I removed the code from the plugin and added the code to my themes functions.php and the shortcode still gets converted.
Forum: Hacks
In reply to: Preg_replace can it ignore shortcodes?What the i does I’m not entirely sure. You can remove or add it to any of their addresses and every page still loads like they would otherwise.
eg:
https://imgur.com/a/s9CIv/all
https://i.imgur.com/a/s9CIv/allhttps://i.imgur.com/yNf67Rt.png
https://imgur.com/yNf67Rt.pngBoth instances get converted.
[wpws url=”https://i.imgur.com/a/zaNdd/all” query=”.posts”]
Becomes
[wpws url=”https://i.imgur.com/memegen/create/a/zaNdd/all” query=”.posts”][wpws url=”https://imgur.com/a/zaNdd/all” query=”.posts”]
Becomes
[wpws url=”https://imgur.com/memegen/create/a/zaNdd/all” query=”.posts”]Forum: Hacks
In reply to: Preg_replace can it ignore shortcodes?The shortcode still gets converted to
[wpws url="https://i.imgur.com/memegen/create/a/zaNdd/all" query=".posts"]
This is what the code looks like after your proposed edit:
add_filter('wp_insert_post_data', 'pm_add_memegen'); function pm_add_memegen( $data ) { $data['post_content'] = preg_replace('/(?<!\[wpws\surl="http:\/\/)imgur.com\/(?!memegen\/create)/', 'imgur.com/memegen/create/', $data['post_content']); return $data; }
Thanks for the suggestion though ??
Forum: Hacks
In reply to: Formatting Images generated by shortcodeIt worked like a charm. Thanks a lot!
Forum: Fixing WordPress
In reply to: Imgur oEmbeds, not oEmbedding thumnails.Alright, thanks.
Forum: Fixing WordPress
In reply to: Let users create new posts and add content to old postsHm, fair point.
Thanks!
Forum: Hacks
In reply to: Adding a "Upload to imgur" button under every new gallery thumbnailAdapting the plugin is way out of my league. I only have a basic understanding of html/css/php.
I’m using php 5.2, for the same reason you gave. A lot of older scripts break when the server runs php7.
Forum: Hacks
In reply to: Adding a "Upload to imgur" button under every new gallery thumbnailI’m afraid to use that script, as I have installed it 2 times, and everytime my whole WP install breaks and I get 500 errors.
There is also the regular WP Imgur plugin, which does work. I’ll take a look at it, maybe it will be adaptable.
Thanks for the suggestion.
Forum: Hacks
In reply to: Append to outgoing linksI used a plugin to add the code you wrote, and it seems to work great.
Thanks again!
Forum: Hacks
In reply to: Append to outgoing linksWow, thanks for this detailed explanation.
I will try it out as soon as I can.Edit:
After adding it to wp-includes/functions.php the entire wordpress broke and only returned 500 errors ??Forum: Hacks
In reply to: Append to outgoing linksAfter some reading up on preg_replace it indeed sounds like what I need.
But to be honest, I have no idea on how to implement it. My coding experiences don’t go beyond basic html and css.
Thanks for pointing me in the right direction though, much appreciated!
Forum: Hacks
In reply to: Append to outgoing linksThanks for the advice.
But there is a little problem with this method. When I paste in the correct URL https://imgur.com/memegen/create/ a placeholder image is displayed instead of the image that is being referred to. This is a “feature” of Imgur.
An example of this can be seen here: https://www.koffid.nl/mem/uncategorized/example/
The first image is the pasted link https://imgur.com/CySWUsw
The second image is pasted as https://imgur.com/memegen/create/CySWUswBoth should look the same, but as you can see when I add memegen/create Imgur returns a placeholder image.
Ideally I want users to paste links like https://imgur.com/CySWUsw, have WP automatically generate a thumbnail and have it linked to https://imgur.com/memegen/create/CySWUsw without anyone having to manually edit the links afterwards.
I will look into ‘wp_insert_post_data’ filter to see if that will work for my needs.
Thanks!