Skip to content

Social Notes: no post title is saved when post is published #42884

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

Open
jeherve opened this issue Apr 3, 2025 · 0 comments
Open

Social Notes: no post title is saved when post is published #42884

jeherve opened this issue Apr 3, 2025 · 0 comments
Labels
[Feature] Social Notes [Feature] Stats Data Feature that enables users to track their site's traffic and gain insights on popular content. [Plugin] Social Issues about the Jetpack Social plugin [Pri] Normal Triaged [Type] Bug When a feature is broken and / or not performing as intended

Comments

@jeherve
Copy link
Member

jeherve commented Apr 3, 2025

This is a follow-up to #36718.

Steps to reproduce

  1. On a site running the Jetpack Social plugin, activate Social Notes in the Social settings
  2. Go to Social Notes > Add New
  3. Publish a note
  4. Log in to your site via SSH.
  5. Fetch all notes: wp post list --post_type=jetpack-social-note
wp post list --post_type=jetpack-social-note
+----+------------+-----------+---------------------+-------------+
| ID | post_title | post_name | post_date           | post_status |
+----+------------+-----------+---------------------+-------------+
| 10 |            | 10        | 2025-04-03 09:36:14 | publish     |
+----+------------+-----------+---------------------+-------------+

Ideally, the post title would not be empty. Leaving an empty post title will cause issues like the one experienced in #36718, but also in other areas of the site, such as RSS feeds or Jetpack Stats.

I think it woudl be nice if we saved a default post title like we do to overwrite the display here:

/**
* Use the_title hook so we show the social note's exceprt in the post list view.
*
* @param array $title The title of the post, which we have set to be an empty string for Social Notes.
* @param array $post_id The Post ID.
*/
public function override_empty_title( $title, $post_id ) {
if ( get_post_type( $post_id ) === self::JETPACK_SOCIAL_NOTE_CPT ) {
return wp_trim_words( get_the_excerpt(), 10 );
}
// Return the original title for other cases.
return $title;
}

@jeherve jeherve added [Feature] Social Notes [Feature] Stats Data Feature that enables users to track their site's traffic and gain insights on popular content. [Plugin] Social Issues about the Jetpack Social plugin [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended Triaged labels Apr 3, 2025
@jeherve jeherve moved this from Needs Triage to Triaged in Automattic Prioritization: The One Board ™ Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Social Notes [Feature] Stats Data Feature that enables users to track their site's traffic and gain insights on popular content. [Plugin] Social Issues about the Jetpack Social plugin [Pri] Normal Triaged [Type] Bug When a feature is broken and / or not performing as intended
Projects
Development

No branches or pull requests

1 participant