-
Notifications
You must be signed in to change notification settings - Fork 2
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
hide social previews if not premium #70
Conversation
this can be used by a bunch of things to enable/disable features
premium overrides free version.
in fact it leads to problems with labelling & makes things appear that Premium is active when it's actually not
prevents the social tab from displaying in the yoast metabox if Yoast Premium is inactive
we're hard-coding what's going into the echo here with no possibility of outside insertions.
* preview buttons. If Yoast ever adds more panels to this sidebar, | ||
* this will need to be updated. | ||
*/ | ||
$styles = 'div.components-panel div:nth-child(6n) div.yoast.components-panel__body, div.components-panel div:nth-child(7n) div.yoast.components-panel__body { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good future update might be to ask if they can provide hooks to switch these on/off, or at least provide CSS class names for these items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this feels super hacky. The other option was disabling the inner elements that do have classes, but the border-bottom
is on the wrapping container, so you ended up with an extra thick border under the Google preview button.
If someone does install Yoast premium will our installer overrides place it in |
It should be |
This PR does some cleanup of Yoast loading code -- it's actually not in our best interest to spoof Yoast Premium because it changes the labels to say that Yoast SEO Premium is active.
It adds a helper function that is used here and can be used later (e.g. with #59) to determine if Yoast Premium is active, and then uses that function to load styles that conditionally hide the social previews if Premium is not active.
Fixes #69