• Resolved doczimute

    (@doczimute)


    Hello

    In the file \wp-content\plugins\seriously-simple-podcasting\php\classes\controllers\class-players-controller.php on line 183 we have <p><?php echo $item[‘date’] . ‘ ? ‘ . $item[‘duration’]; ?></p>, obviously the variable $item[‘date’] returns the date according to this format Jun 29, 2023.

    How to have this format: 29 jun 2023?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    Hi @doczimute,

    Could you please specify what version of the SSP plugin you use? Unfortunately, I don’t see such a line in the class-players-controller.php file.

    Best regards,
    Sergiy, development team.

    Thread Starter doczimute

    (@doczimute)

    Error

    \wp-content\plugins\seriously-simple-podcasting\templates\players\castos-player.php line 183.

    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    Hi @doczimute,

    Thank you for bringing it to our attention, we’ll add a PHP filter for the date format in our future versions.
    Currently, you can use the ssp_html_player_data filter (put it in your functions.php file):

    add_filter( 'ssp_html_player_data', function ( $data ) {
    	if ( ! empty( $data['date'] ) ) {
    		$data['date'] = date( 'j M Y', strtotime( $data['date'] ) );
    	}
    
    	return $data;
    } );

    Hope this helps and best regards,
    Sergiy.

    Hello there – great plugin!

    Would the above filter work to alter the format of the $item[‘duration’] as well?

    One of my users reported a weird thing (nan:nan instead of time) with the duration label and I’d like to experiment a bit before opening a new thread.

    Thanks

    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    Hi @zemog,

    Sure, you can use this filter for the duration, and other properties as well.
    Here is the list of all properties that can be modified:

    $template_data = array(
     'episode' => $episode,
     'episode_id' => $episode->ID,
     'date' => $this->format_post_date( $episode->post_date ),
     'duration'  => $episode_duration,
     'current_url'=> $current_url,
     'audio_file' => $audio_file,
     'album_art' => $album_art,
     'podcast_title' => $podcast_title,
     'feed_url' => $feed_url,
     'subscribe_links' => $subscribe_links,
     'embed_code'   => $embed_code,
     'player_mode'   => $player_mode,
     'show_subscribe_button' => $show_subscribe_button,
     'show_share_button'   => $show_share_button,
     'title'   => $episode->post_title,
     'excerpt'  => ssp_get_episode_excerpt( $episode->ID ),
     'player_id' => wp_rand(),
    );

    Best regards,
    Sergiy.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Date format’ is closed to new replies.