Sharing : Add wp_sharing_email_send_post_subject filter#8284
Sharing : Add wp_sharing_email_send_post_subject filter#8284zinigor merged 6 commits intoAutomattic:masterfrom Umangvaghela:add-subject-filter
Conversation
jeherve
left a comment
There was a problem hiding this comment.
Thanks for the contribution.
In my review I just suggested a few changes to match coding standards.
modules/sharedaddy/sharedaddy.php
Outdated
| $title = $data['sharing_source']->get_share_title( $data['post']->ID ); | ||
|
|
||
| wp_mail( $data['target'], '[' . __( 'Shared Post', 'jetpack' ) . '] ' . $title, $content, $headers ); | ||
| $subject = apply_filters('wp_sharing_email_send_post_subject',sprintf(__('Shared Post','jetpack'))); |
There was a problem hiding this comment.
Could you add a docblock before the filter, as with the other filters in this file?
modules/sharedaddy/sharedaddy.php
Outdated
| $title = $data['sharing_source']->get_share_title( $data['post']->ID ); | ||
|
|
||
| wp_mail( $data['target'], '[' . __( 'Shared Post', 'jetpack' ) . '] ' . $title, $content, $headers ); | ||
| $subject = apply_filters('wp_sharing_email_send_post_subject',sprintf(__('Shared Post','jetpack'))); |
There was a problem hiding this comment.
Could you add spacing around quotes, parenthesis, and before sprintf?
|
Greetings of the day !! Thanks for reply. Thanks |
jeherve
left a comment
There was a problem hiding this comment.
A few changes to match the previous subject line.
modules/sharedaddy/sharedaddy.php
Outdated
| * | ||
| * @param string $var Sharing Email Send Post Subject. Default is "Shared Post". | ||
| */ | ||
| $subject = apply_filters( 'wp_sharing_email_send_post_subject', __( 'Shared Post', 'jetpack' ) ); |
There was a problem hiding this comment.
Could you add square brackets ([]) around the subject line, like in the original message?
Thanks!
|
Changes Done. Thanks |
jeherve
left a comment
There was a problem hiding this comment.
One last change and we should be good to go!
Thank you!
| * Filter the Sharing Email Send Post Subject. | ||
| * | ||
| * @module sharedaddy | ||
| * |
There was a problem hiding this comment.
Could you add @since 5.7.0 here too?
|
Done. Thanks |
oskosk
left a comment
There was a problem hiding this comment.
Thanks for the changes @Umangvaghela .
I left some comments about the usage of $title.
modules/sharedaddy/sharedaddy.php
Outdated
| * | ||
| * @param string $var Sharing Email Send Post Subject. Default is "Shared Post". | ||
| */ | ||
| $subject = apply_filters( 'wp_sharing_email_send_post_subject', '[' . __( 'Shared Post', 'jetpack' ) . '] ' ); |
There was a problem hiding this comment.
I think something is missing here.
The $title needs to be concatenated in the subject.
modules/sharedaddy/sharedaddy.php
Outdated
| */ | ||
| $subject = apply_filters( 'wp_sharing_email_send_post_subject', '[' . __( 'Shared Post', 'jetpack' ) . '] ' ); | ||
|
|
||
| wp_mail( $data['target'], $subject, $title, $content, $headers ); |
There was a problem hiding this comment.
Here $title shouldn't be the third argument. $title should be concatenated into the subject`.
|
Changes Done. Thanks |
|
Thanks for the changes @Umangvaghela ! I've relabeled as needs review... Code looks good now, but how do I test that the funcionality updated here is not affected? "Testing instructions" on the description of the PR, pleaseee 😄 |
|
Testing instruction. 1 ) Enable sharing email option. Thanks |
|
Hello Sir Can you told me anything is missing for "testing description" or In PR. If you find anyhting else so told me I will change or add it as soon as possible. :) Thanks, |
zinigor
left a comment
There was a problem hiding this comment.
Sorry, but this PR missed the 5.7.0 release, and we're aiming for 5.8.0 now. Can you please fix the version number?
Thank you!
|
changes done. Thanks |
Thanks for the review, Osk! Your comments have been addressed.
* Changelog 5.8: create base for changelog. * Update 5.8 release post link * fix 5.8 release date * Updates to plugin description * Changelog: add #8499 * Changelog: add #8506 * Changelog: add #8509 * Changelog: add #8516 * Changelog: add #8517 * Changelog: add #8523 * Changelog: add #8547 * Changelog: add #8496 * Changelog: add #8584 * Changelog: add #8595 * Changelog: add #8445 * Changelog: add #8431 * Changelog: add #8284 * Changelog: add #8270 * Changelog: add #8124 * Changelog: add #8581 * Changelog: add #8463 * Changelog: add #8568 (#8646) * Updates to testing list and changelog * Changelog: add #8443 * Changelog: add #8459 * Changelog: add #8469 * Changelog: add #8464 * Changelog: add #8478 and #8479 * Changelog: add #8483 * Changelog: add #8488 * Changelog: add #8513 * Changelog: add #8555 * Changelog: add #8565 * Changelog: add #8601 * Changelog: add #8612 * Changelog: add first pass at Search items. * Changelog: add more info to help test Search. * Changelog: add #8144 * Changelog: add #8313 * Changelog: add #8419 * Changelog: add #8465 * Changelog: add #8515 * Changelog: add #8587 * Changelog: add #8591 * Changelog: add #8659 * Changelog: add #8661 * Changelog: add #8671 * Changelog: add 5.7.1 to archived changelog too. * Reverted changes to readme, removed entry about backups.
Fixes #8165
Changes proposed in this Pull Request:
Testing instructions: