Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%%sep%% variable doesn't resolve in the Snippet Preview #1260

Closed
GermanKiwi opened this issue Jun 26, 2014 · 10 comments
Closed

%%sep%% variable doesn't resolve in the Snippet Preview #1260

GermanKiwi opened this issue Jun 26, 2014 · 10 comments

Comments

@GermanKiwi
Copy link

I just added %%sep%% to the SEO Title field on my home page, because I want to use the separator symbol in my title there. So the SEO Title field looks like this:

My Site Name %%sep%% My Tag Line

However, in the Snippet Preview shown above this, in the WPSEO meta box, it doesn't resolve the %%sep%% variable to whatever it should be. It just leaves it as %%sep%%, which obviously makes it difficult to visualise how the title will look on Google.

Any chance that could be rectified? (I imagine this issue may also apply to any other variables which are added to the SEO Title field too).

@jrfnl jrfnl self-assigned this Jun 26, 2014
@jrfnl jrfnl added bug and removed bug labels Jun 26, 2014
@jrfnl
Copy link
Contributor

jrfnl commented Jun 26, 2014

The replacement variables are supposed to be used for the title/description templates. Not for the actual setting of a title in the SEO Metabox of a post/page. (am I right @jdevalk ?) This behaviour has not changed with the refactor.

@GermanKiwi
Copy link
Author

Oh, okay - because the variable does actually work when I use it there! (I mean it works for the actual title itself). It's just the Snippet Preview that it doesn't work for. :) And actually I assumed that this had always worked - I wasn't assuming it was related to the refactor thingy. :)

@jdevalk
Copy link
Contributor

jdevalk commented Jun 26, 2014

@jrfnl You're right that that's by design, but I've often pondered if that's smart. You see, actually being able to use %%sitename%% in a post's title might make sense, as that would make changing the site name a whole lot easier...

@jdevalk
Copy link
Contributor

jdevalk commented Jun 26, 2014

Ah, LOL. Well let's keep it working and I'll do some work to make the snippet preview work better. We should round trip that with AJAX anyway as it's currently entirely unreliable... Would that work after the refactor @jrfnl ?

@jrfnl
Copy link
Contributor

jrfnl commented Jun 26, 2014

@jdevalk Exactly what I was thinking and yes, that should definitely work well after the refactor. Just make sure to set the $omit array to the variables you want to replace via js during the live post edit.

@GermanKiwi
Copy link
Author

Thanks, both of you! 👍

@jrfnl jrfnl removed their assignment Jun 29, 2014
@jdevalk
Copy link
Contributor

jdevalk commented Jul 3, 2014

This was fixed by 948233f (but I just realized I could make this shitloads faster so I will in another commit)

@jdevalk jdevalk closed this as completed in 5d97e01 Jul 3, 2014
@GermanKiwi
Copy link
Author

Hi @jdevalk - I've just updated to v1.5.4 and unfortunately this issue is not fixed. When I enter %%sep%% into the "SEO Title" field of the WPSEO meta box when editing a Page, the Snippet Preview (directly above) still shows %%sep%% rather than the actual separator character.

FWIW, I'm defining my separator character via a function using the new "wpseo_replacements_filter_sep" filter.

@jdevalk
Copy link
Contributor

jdevalk commented Jul 15, 2014

1.5.4? Or 1.5.4.1?

On Tuesday, July 15, 2014, Jeremy [email protected] wrote:

Hi @jdevalk https://github.com/jdevalk - I've just updated to v1.5.4
and unfortunately this issue is not fixed. When I enter %%sep%% into the
"SEO Title" field of the WPSEO meta box when editing a Page, the Snippet
Preview (directly above) still shows %%sep%% rather than the actual
separator character.

FWIW, I'm defining my separator character via a function using the new
"wpseo_replacements_filter_sep" filter.


Reply to this email directly or view it on GitHub
#1260 (comment)
.

@GermanKiwi
Copy link
Author

It was 1.5.4. I've just now upgraded to 1.5.4.1, which has just come through to my WordPress, and now the issue seems to be fixed - the Snipped Preview is showing the separator character now and not the %%sep%% variable. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants