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

Add refresh podcast button to podcast player #26373

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[not verified] Add canUserRefreshPodcast flag on server
  • Loading branch information
daledupreez committed Dec 13, 2022
commit 7ebe0d4402933125c0bfa36bb27fb5764bb384b3
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,16 @@ function render_player( $player_data, $attributes ) {
$instance_id = wp_unique_id( 'jetpack-podcast-player-block-' . get_the_ID() . '-' );
$player_data['playerId'] = $instance_id;

$can_user_refresh_podcast = ! empty( get_current_user_id() ) && current_user_can( 'edit_post', get_the_ID() );

// Generate object to be used as props for PodcastPlayer.
$player_props = array_merge(
// Add all attributes.
array( 'attributes' => $attributes ),
// Add all player data.
$player_data
$player_data,
// Add flag for whether the current user can refresh the podcast
array( 'canUserRefreshPodcast' => $can_user_refresh_podcast )
);

$primary_colors = get_colors( 'primary', $attributes, 'color' );
Expand Down