Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions includes/class-wp-push-syndication-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,13 @@ public function add_syndicate_metabox( ) {

echo '</ul>';

$post_source = get_post_meta( $post->ID, 'syn_source_url', true );
if ( isset( $post_source ) && '' !== $post_source ) {
echo '<div class="syn-post-source">';
echo esc_html( sprintf( 'Source: %s', parse_url( $post_source, PHP_URL_HOST ) ), 'push-syndication' );
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks okay but 2 points:

  • There's no internationalisation here for Source:
  • If the post source is not empty and not a valid URL then it will return false or null, but sprintf is expecting a string, which could lead to some oddness.

Copy link
Contributor

Choose a reason for hiding this comment

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

Only took you 7 years, 8 months and 22 days Tom 😂

Copy link
Contributor

Choose a reason for hiding this comment

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

I needed to think long and hard about this one

echo '</div>';
}

}

public function checked_array( $value, $group ) {
Expand Down