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

Add support for Yoast canonical URL #70

Merged
merged 2 commits into from
Jun 23, 2021
Merged

Conversation

dinhtungdu
Copy link
Contributor

This PR continues updating the data sent to the Sophi collector. In this PR:

  • Check if Yoast is active then use the Yoast canonical URL.
  • Add a filter around canonical URL to support other SEO plugins.

Relates #69 #65

@dinhtungdu dinhtungdu added this to the 1.0.4 milestone Jun 22, 2021
@dinhtungdu dinhtungdu requested a review from dkotter June 22, 2021 07:42
@dinhtungdu dinhtungdu self-assigned this Jun 22, 2021
@jeffpaul
Copy link
Contributor

@dinhtungdu may be worth adding a note into the readmes about the filter for others to know how to handle for this.

*
* @return {string} Canonical URL.
*/
$canonical_url = apply_filters( 'sophi_post_canonical_url', $canonical_url, $post );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, I'm fine if we want to leave this filter but there's probably not a great need to have this, since there are other places this data can be filtered. If we want to remove this to simplify things, that's good with me.

dkotter
dkotter previously approved these changes Jun 22, 2021
@jeffpaul jeffpaul merged commit 7ab01a7 into develop Jun 23, 2021
@jeffpaul jeffpaul deleted the fix/yoast-canonical branch June 23, 2021 01:00
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

Successfully merging this pull request may close these issues.

3 participants