PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.7
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.7
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / blocks / includes / pagination / Pagination.php

Pagination.php in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.7, at blocks/includes/pagination/Pagination.php

53 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Pagination class for Smart Post Show Blocks.
4 *
5 * @package Smart_Post_Show
6 * @subpackage Smart_Post_Show/blocks/includes
7 */
8
9 namespace SmartPostShow\Blocks;
10
11 use SmartPostShow\Blocks\Helper;
12
13 use SmartPostShow\Blocks\Block_Base;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 /**
20 * Pagination block for Smart Post Show.
21 *
22 * Handles the pagination logic for Smart Post Show blocks.
23 */
24 class Pagination extends Block_Base {
25 /**
26 * Set_block_properties
27 *
28 * @return void
29 */
30 protected function set_block_properties() {
31 $this->block_name = 'pagination';
32 $this->styles = array( 'sp_smart_post_blocks_google_fonts' );
33 }
34 /**
35 * Block render function.
36 *
37 * @param array $attributes attributes.
38 * @param string $content Content to be rendered.
39 * @param string $blocks Nested blocks.
40 * @return string Rendered HTML content.
41 */
42 public function render_block( $attributes, $content = '', $blocks = array() ) {
43 if ( Helper::is_editor_page() ) {
44 return $content;
45 }
46
47 ob_start();
48 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The HTML output is already properly escaped at the time of generation, so additional escaping is not required here.
49 echo Template_Part::pagination_block_html( $attributes );
50 return ob_get_clean();
51 }
52 }
53