PluginProbe
Powerkit – Supercharge your WordPress Site / 3.1.1
Powerkit – Supercharge your WordPress Site v3.1.1
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 3.1.1, at modules/posts/public/class-powerkit-posts-public.php

90 lines 2.2 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 // Exit if accessed directly.
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 /**
18 * The public-facing functionality of the module.
19 */
20 class Powerkit_Posts_Public extends Powerkit_Module_Public {
21 /**
22 * Initialize
23 */
24 public function initialize() {
25 add_filter( 'powerkit_pinit_exclude_selectors', array( $this, 'pinit_disable' ) );
26 add_action( 'init', array( $this, 'register_templates' ) );
27 add_filter( 'powerkit_featured_posts_templates', array( $this, 'list_templates' ) );
28 }
29
30 /**
31 * PinIt disable
32 *
33 * @param string $selectors List selectors.
34 */
35 public function pinit_disable( $selectors ) {
36 $selectors[] = '.pk-block-posts';
37
38 return $selectors;
39 }
40
41 /**
42 * Register Templates
43 *
44 * @since 1.0.0
45 * @access private
46 *
47 * @param array $templates List of Templates.
48 */
49 public function register_templates( $templates = array() ) {
50 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/posts-template.php';
51 }
52
53 /**
54 * Filter Register Templates
55 *
56 * @since 1.0.0
57 * @access private
58 *
59 * @param array $templates List of Templates.
60 */
61 public function list_templates( $templates = array() ) {
62 $templates = array(
63 'list' => array(
64 'name' => esc_html__( 'Simple List', 'powerkit' ),
65 'func' => 'powerkit_featured_posts_default_template',
66 ),
67 'numbered' => array(
68 'name' => esc_html__( 'Numbered List', 'powerkit' ),
69 'func' => 'powerkit_featured_posts_default_template',
70 ),
71 'large' => array(
72 'name' => esc_html__( 'Large Thumbnails', 'powerkit' ),
73 'func' => 'powerkit_featured_posts_default_template',
74 ),
75 );
76
77 return $templates;
78 }
79
80 /**
81 * Register the stylesheets for the public-facing side of the site.
82 */
83 public function wp_enqueue_scripts() {
84 wp_enqueue_style( 'powerkit-widget-posts', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-widget-posts.css' ), array(), powerkit_get_setting( 'version' ), 'all' );
85
86 // Add RTL support.
87 wp_style_add_data( 'powerkit-widget-posts', 'rtl', 'replace' );
88 }
89 }
90