Codeinwp / tweet-old-post

Plugin to tweet about your old posts to get more hits for them and keep them alive.
GNU General Public License v2.0
13 stars 16 forks source link

Camel case hashtags are automatically converted to lowercase #860

Closed vytisbulkevicius closed 1 year ago

vytisbulkevicius commented 1 year ago

Description

All the issue was explained on this thread - https://wordpress.org/support/topic/camel-case-hashtags-are-automatically-converted-to-lowercase-2/#post-16453953

As the title suggests, user uses camel case for hashtags like #ThisIsMyExample

But when this plugin publishes a post, the hashtag is converted to #thisismyexample

I would like it to simply not do that because it reduces accessibility. Screen readers and sometimes people cannot read a hashtag when it’s all lowercase.

In this particular case, ACF checkboxes are in use so that it's not needed have to always remember the common hashtags in use. In a post, it looks like this.

This is the checkbox field in ACF (screenshot 1) I created and its field names is hashtags

And for the blog article, this is the ACF settings (screenshot 2) of one that was automatically “revived” by your plugin.

So for this article, I’m expecting the hashtags to be: #Neurodiversity #Autism #ActuallyAutistic #KarateMama with the capital letters remaining capital.

User also shared a solution already so it's just a small change in the code (I see no reason to keep it lowercase so we should make the change):

All I did was remove the strtolower() call from line 444 of the class-rop-post-format-helper.php and I could see my hashtags in camel case as expected in the sharing queue. If you could make that update in your plugin, that’d be super.

Line 444 current: $hashtags = $hashtags . ' #' . preg_replace( '/-/', '', strtolower( $hashtag ) );

My edit to line 444: $hashtags = $hashtags . ' #' . preg_replace( '/-/', '', $hashtag );

Step-by-step reproduction instructions

There are all the steps described here - https://wordpress.org/support/topic/camel-case-hashtags-are-automatically-converted-to-lowercase-2/#post-16453953 But it's pretty complicated to replicate this as it depends on the theme in use.

Screenshots, screen recording, code snippet or Help Scout ticket

No response

Environment info

No response

Is the issue you are reporting a regression

No

girishpanchal30 commented 1 year ago

Hey @vytisbulkevicius,

I've reviewed this issue and fixed it with this PR https://github.com/Codeinwp/tweet-old-post/pull/862

Thanks

irinelenache commented 1 year ago

@girishpanchal30 Tested and the issue is fixed now, thank you 👍

pirate-bot commented 1 year ago

:tada: This issue has been resolved in version 9.0.13 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: