Skip to content

Commit

Permalink
Elementor Episode List widget pagination fix #800
Browse files Browse the repository at this point in the history
  • Loading branch information
zahardev committed Oct 29, 2021
1 parent c4c3e80 commit 09a2012
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 7 additions & 5 deletions php/classes/controllers/class-episode-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,27 +252,29 @@ public function episode_list( $episode_ids, $include_title = false, $include_exc
*
* @param $settings
*
* @return mixed|void
* @return string
*/
public function render_episodes($settings) {
public function render_episodes( $settings ) {
global $ss_podcasting;
$player = $ss_podcasting->players_controller;
$paged = get_query_var( 'paged' );

$args = array(
$args = array(
'post_type' => SSP_CPT_PODCAST,
'posts_per_page' => 10,
'paged' => $paged ?: 1,
);

$episodes = new WP_Query( $args );
$episodes_template_data = array(
'player' => $player,
'player' => $player,
'episodes' => $episodes,
'settings' => $settings,
);

$episodes_template_data = apply_filters( 'episode_list_data', $episodes_template_data );

return $this->renderer->render_deprecated( $episodes_template_data, 'episodes/all-episodes-list' );
return $this->renderer->fetch( 'episodes/all-episodes-list', $episodes_template_data );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace SeriouslySimplePodcasting\Integrations\Elementor\Widgets;

use SeriouslySimplePodcasting\Controllers\Players_Controller;

class Elementor_Html_Player_Widget extends \Elementor\Widget_Base {
use Elementor\Widget_Base;

class Elementor_Html_Player_Widget extends Widget_Base {

/**
* Class constructor.
Expand Down

0 comments on commit 09a2012

Please sign in to comment.