# powerkit/2.4.4/modules/posts/public/class-powerkit-posts-public.php

Powerkit – Supercharge your WordPress Site, version 2.4.4. 85 lines.

- Page: https://pluginprobe.com/plugins/powerkit/2.4.4/code/modules/posts/public/class-powerkit-posts-public.php
- Raw: https://pluginprobe.com/plugins/powerkit/2.4.4/raw/modules/posts/public/class-powerkit-posts-public.php
- Modified: 2020-12-30T06:28:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/powerkit/2.4.4/code/modules/posts/public/class-powerkit-posts-public.php#L10-L20`.

```php
<?php
/**
 * The public-facing functionality of the module.
 *
 * @link       https://codesupply.co
 * @since      1.0.0
 *
 * @package    Powerkit
 * @subpackage Modules/public
 */

/**
 * The public-facing functionality of the module.
 */
class Powerkit_Posts_Public extends Powerkit_Module_Public {
	/**
	 * Initialize
	 */
	public function initialize() {
		add_filter( 'powerkit_pinit_exclude_selectors', array( $this, 'pinit_disable' ) );
		add_action( 'init', array( $this, 'register_templates' ) );
		add_filter( 'powerkit_featured_posts_templates', array( $this, 'list_templates' ) );
	}

	/**
	 * PinIt disable
	 *
	 * @param string $selectors List selectors.
	 */
	public function pinit_disable( $selectors ) {
		$selectors[] = '.pk-block-posts';

		return $selectors;
	}

	/**
	 * Register Templates
	 *
	 * @since    1.0.0
	 * @access   private
	 *
	 * @param array $templates List of Templates.
	 */
	public function register_templates( $templates = array() ) {
		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/posts-template.php';
	}

	/**
	 * Filter Register Templates
	 *
	 * @since    1.0.0
	 * @access   private
	 *
	 * @param array $templates List of Templates.
	 */
	public function list_templates( $templates = array() ) {
		$templates = array(
			'list'     => array(
				'name' => esc_html__( 'Simple List', 'powerkit' ),
				'func' => 'powerkit_featured_posts_default_template',
			),
			'numbered' => array(
				'name' => esc_html__( 'Numbered List', 'powerkit' ),
				'func' => 'powerkit_featured_posts_default_template',
			),
			'large'    => array(
				'name' => esc_html__( 'Large Thumbnails', 'powerkit' ),
				'func' => 'powerkit_featured_posts_default_template',
			),
		);

		return $templates;
	}

	/**
	 * Register the stylesheets for the public-facing side of the site.
	 */
	public function wp_enqueue_scripts() {
		wp_enqueue_style( 'powerkit-widget-posts', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-widget-posts.css' ), array(), powerkit_get_setting( 'version' ), 'all' );

		// Add RTL support.
		wp_style_add_data( 'powerkit-widget-posts', 'rtl', 'replace' );
	}
}

```
