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

Fix: adding isCanonical lately after removing falsy items #72

Merged
merged 1 commit into from
Jul 8, 2021

Conversation

dinhtungdu
Copy link
Contributor

@dinhtungdu dinhtungdu commented Jul 8, 2021

Description of the Change

In #71, we changed the tracking data sent to Sophi collector to send isCanonical value. This change introduces another issue: we're sending empty array and false values as well. We only need a boolean value for isCanonical field, so this PR reverts the change made in #71 and adds the isCanonical key after filtering the tracking data.

Verification Process

Ensure the tracking data doesn't contain empty strings, empty arrays, and false (except isCanonical field).

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

Changelog Entry

@dinhtungdu dinhtungdu requested a review from felipeelia July 8, 2021 03:21
@jeffpaul jeffpaul added this to the 1.0.4 milestone Jul 8, 2021
@felipeelia
Copy link

The change makes sense @dinhtungdu! While reviewing it, I've noticed that the example introduced in #71 probably should be adjusted to the following (see the number of accepted parameters there). It probably can be handled through a different PR though.

add_filter(
	'sophi_post_content_type',
	function( $type, $post ) {
		// You logic here.

		return $new_type;
	},
	10,
	2
);

Thanks!

@jeffpaul jeffpaul merged commit a0bd910 into develop Jul 8, 2021
@jeffpaul jeffpaul deleted the fix/more-content-shema-update branch July 8, 2021 14:22
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