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

Social: Register new CPT for Social Posts #35415

Merged
merged 5 commits into from
Feb 5, 2024

Conversation

spsiddarthan
Copy link
Contributor

@spsiddarthan spsiddarthan commented Feb 2, 2024

Proposed changes:

  • Added a new class Jetpack_Social_Note to register the custom post type
  • I have added this class to the src folder of the plugin, but if need be it can be refactored into its own package in the future.
  • I have used dashicons-welcome-write-blog as the menu icon for now, we can tweak this as well if need be.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

pdrWKz-156-p2#comment-1932

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Add define( 'JETPACK_SOCIAL_NOTES_ENABLED', true ); to your wp-config.php. If you're on JN, install the code snippets plugin and copy define( 'JETPACK_SOCIAL_NOTES_ENABLED', true ); into it.
  • Activate Jetpack Social on this branch
  • Ensure you're able to see the new CPT Social Note in the sidebar of your wp-admin and you're able to create new Social Notes.
  • Set JETPACK_SOCIAL_NOTES_ENABLED to false and ensure that you no longer see the new CPT in the sidebar.
Screenshot 2024-02-02 at 5 51 09 PM

@spsiddarthan spsiddarthan self-assigned this Feb 2, 2024
@github-actions github-actions bot added the [Plugin] Social Issues about the Jetpack Social plugin label Feb 2, 2024
Copy link
Contributor

github-actions bot commented Feb 2, 2024

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Social plugin:

  • Next scheduled release: March 5, 2024.
  • Scheduled code freeze: February 26, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@spsiddarthan spsiddarthan changed the title Add/register social note custom type Social: Register new CPT for Social Posts Feb 2, 2024
Copy link
Contributor

@pablinos pablinos left a comment

Choose a reason for hiding this comment

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

I think this is a good start! Just a couple of comments.


$args = array(
'public' => true,
'label' => 'Social Note',
Copy link
Contributor

@pablinos pablinos Feb 2, 2024

Choose a reason for hiding this comment

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

I think we might want to add in some of the other labels for the type, and make them translated too. Some examples are in these comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have done this, Paul, let me know what you think

projects/plugins/social/src/class-jetpack-social.php Outdated Show resolved Hide resolved
projects/plugins/social/src/class-jetpack-social-note.php Outdated Show resolved Hide resolved
@spsiddarthan spsiddarthan requested a review from pablinos February 5, 2024 07:57
pablinos
pablinos previously approved these changes Feb 5, 2024
Copy link
Contributor

@pablinos pablinos left a comment

Choose a reason for hiding this comment

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

I've noticed that on other types we're using hyphens rather than underscores in the post type slug/name. I don't know if that's a requirement or not!

@spsiddarthan spsiddarthan merged commit 08feaa4 into trunk Feb 5, 2024
51 checks passed
@spsiddarthan spsiddarthan deleted the add/register-social-note-custom-type branch February 5, 2024 12:35
spsiddarthan added a commit that referenced this pull request Feb 15, 2024
* Social : Register CPT for Social Notes.

* changelog

* Social: Added arguments for labels.

* Update labels for Social Note:

* Hypenate custom post type slug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Social Issues about the Jetpack Social plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants