Skip to content

Camel case hashtags are automatically converted to lowercase #860

@vytisbulkevicius

Description

@vytisbulkevicius

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

Metadata

Metadata

Labels

bugThis label could be used to identify issues that are caused by a defect in the product.releasedIndicate that an issue has been resolved and released in a particular version of the product.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions