: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
class WPML_Admin_Pagination_Render {
const TEMPLATE = 'pagination.twig';
* @var IWPML_Template_Service
* @var WPML_Admin_Pagination
public function __construct( IWPML_Template_Service $template, WPML_Admin_Pagination $pagination ) {
$this->template = $template;
$this->pagination = $pagination;
public function get_model() {
'listNavigation' => __( 'Navigation', 'sitepress' ),
'firstPage' => __( 'First page', 'sitepress' ),
'previousPage' => __( 'Previous page', 'sitepress' ),
'nextPage' => __( 'Next page', 'sitepress' ),
'lastPage' => __( 'Last page', 'sitepress' ),
'currentPage' => __( 'Current page', 'sitepress' ),
'of' => __( 'of', 'sitepress' ),
'totalItemsText' => sprintf(
_n( '%s item', '%s items', $this->pagination->get_total_items(), 'sitepress' ),
$this->pagination->get_total_items()
'pagination' => $this->pagination,
'total_items' => $this->pagination->get_total_items(),
public function paginate( $items ) {
$total = count( $items );
$limit = $this->pagination->get_items_per_page(); //per page
$total_pages = ceil( $total / $limit );
$page = max( $this->pagination->get_current_page(), 1 );
$page = min( $page, $total_pages );
$offset = ( $page - 1 ) * $limit;
return array_slice( $items, $offset, $limit );