PluginProbe
Powerkit – Supercharge your WordPress Site / 2.4.4
Powerkit – Supercharge your WordPress Site v2.4.4
3.1.1 3.1.0 3.0.9 3.0.8 trunk 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 All 87 releases
powerkit / modules / posts / public / class-powerkit-posts-public.php

class-powerkit-posts-public.php in Powerkit – Supercharge your WordPress Site 2.4.4, at modules/posts/public/class-powerkit-posts-public.php

85 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The public-facing functionality of the module.
4 *
5 * @link https://codesupply.co
6 * @since 1.0.0
7 *
8 * @package Powerkit
9 * @subpackage Modules/public
10 */
11
12 /**
13 * The public-facing functionality of the module.
14 */
15 class Powerkit_Posts_Public extends Powerkit_Module_Public {
16 /**
17 * Initialize
18 */
19 public function initialize() {
20 add_filter( 'powerkit_pinit_exclude_selectors', array( $this, 'pinit_disable' ) );
21 add_action( 'init', array( $this, 'register_templates' ) );
22 add_filter( 'powerkit_featured_posts_templates', array( $this, 'list_templates' ) );
23 }
24
25 /**
26 * PinIt disable
27 *
28 * @param string $selectors List selectors.
29 */
30 public function pinit_disable( $selectors ) {
31 $selectors[] = '.pk-block-posts';
32
33 return $selectors;
34 }
35
36 /**
37 * Register Templates
38 *
39 * @since 1.0.0
40 * @access private
41 *
42 * @param array $templates List of Templates.
43 */
44 public function register_templates( $templates = array() ) {
45 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/posts-template.php';
46 }
47
48 /**
49 * Filter Register Templates
50 *
51 * @since 1.0.0
52 * @access private
53 *
54 * @param array $templates List of Templates.
55 */
56 public function list_templates( $templates = array() ) {
57 $templates = array(
58 'list' => array(
59 'name' => esc_html__( 'Simple List', 'powerkit' ),
60 'func' => 'powerkit_featured_posts_default_template',
61 ),
62 'numbered' => array(
63 'name' => esc_html__( 'Numbered List', 'powerkit' ),
64 'func' => 'powerkit_featured_posts_default_template',
65 ),
66 'large' => array(
67 'name' => esc_html__( 'Large Thumbnails', 'powerkit' ),
68 'func' => 'powerkit_featured_posts_default_template',
69 ),
70 );
71
72 return $templates;
73 }
74
75 /**
76 * Register the stylesheets for the public-facing side of the site.
77 */
78 public function wp_enqueue_scripts() {
79 wp_enqueue_style( 'powerkit-widget-posts', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-widget-posts.css' ), array(), powerkit_get_setting( 'version' ), 'all' );
80
81 // Add RTL support.
82 wp_style_add_data( 'powerkit-widget-posts', 'rtl', 'replace' );
83 }
84 }
85