PluginProbe
Powerkit – Supercharge your WordPress Site / 2.2.7
Powerkit – Supercharge your WordPress Site v2.2.7
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 / scroll-to-top / public / class-powerkit-scroll-to-top-public.php

class-powerkit-scroll-to-top-public.php in Powerkit – Supercharge your WordPress Site 2.2.7, at modules/scroll-to-top/public/class-powerkit-scroll-to-top-public.php

48 lines 1.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 /**
13 * The public-facing functionality of the module.
14 */
15 class Powerkit_Scroll_To_Top_Public extends Powerkit_Module_Public {
16
17 /**
18 * Initialize
19 */
20 public function initialize() {
21 add_action( 'wp_footer', array( $this, 'wp_footer' ) );
22 }
23
24 /**
25 * Add html markup for the button.
26 */
27 public function wp_footer() {
28 ob_start();
29 ?>
30 <a href="#top" class="pk-scroll-to-top">
31 <i class="pk-icon pk-icon-up"></i>
32 </a>
33 <?php
34 echo apply_filters( 'powerkit_scroll_to_top_template', ob_get_clean() ); // XSS.
35 }
36
37 /**
38 * Register the stylesheets for the public-facing side of the site.
39 */
40 public function wp_enqueue_scripts() {
41 // Styles.
42 wp_enqueue_style( 'powerkit-scroll-to-top', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-scroll-to-top.css' ), array(), powerkit_get_setting( 'version' ), 'all' );
43
44 // Scripts.
45 wp_enqueue_script( 'powerkit-scroll-to-top', plugin_dir_url( __FILE__ ) . 'js/public-powerkit-scroll-to-top.js', array( 'jquery' ), powerkit_get_setting( 'version' ), true );
46 }
47 }
48