PluginProbe
Click to top / trunk
Click to top vtrunk
click-to-top / click-to-top.php

click-to-top.php in Click to top trunk, at click-to-top.php

96 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * @link http://wpthemespace.com
4 * @since 1.0.0
5 * @package click to top
6 *
7 * @wordpress-plugin
8 * Plugin Name: Click to top
9 * Plugin URI: http://wpthemespace.com
10 * Description: A Click to top tool kit that helps your visitor go top smoothly. Now with SVG icons, responsive controls, scroll progress indicator, and mobile/tablet visibility options!
11 * Version: 1.3.5
12 * Author: Noor alam
13 * Author URI: http://wpthemespace.com
14 * License: GPL-2.0+
15 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
16 * Text Domain: click-to-top
17 * Domain Path: /languages
18 */
19
20 if (!defined('ABSPATH')) {
21 exit; // Exit if accessed directly.
22 }
23
24 // Define plugin version
25 define('CLICK_TO_TOP_VERSION', '1.3.4');
26
27 /**
28 * The core plugin class that is used to define internationalization,
29 * admin-specific hooks, and public-facing site hooks.
30 */
31 if (is_admin()) {
32 // We are in admin mode
33 require_once(dirname(__FILE__) . '/admin/click_top_options.php');
34 require_once(dirname(__FILE__) . '/admin/nt-class.php');
35 require_once(dirname(__FILE__) . '/libs/aime-notice/aime-notice.php');
36 }
37
38 // Include SVG icons
39 require_once(dirname(__FILE__) . '/includes/svg-icons.php');
40 require_once(dirname(__FILE__) . '/includes/click_top_options_set.php');
41
42 require __DIR__ . '/vendor/autoload.php';
43
44 if (!function_exists('click_to_top_script')) :
45 function click_to_top_script()
46 {
47 // SVG icons CSS (replaces Font Awesome)
48 wp_enqueue_style('click-to-top-icons', plugins_url('/assets/css/click-top-icons.css', __FILE__), array(), CLICK_TO_TOP_VERSION, 'all');
49 wp_enqueue_style('click-to-top-hover', plugins_url('/assets/css/hover.css', __FILE__), array(), '1.0', 'all');
50 wp_enqueue_style('click-to-top-style', plugins_url('/assets/css/click-top-style.css', __FILE__), array(), CLICK_TO_TOP_VERSION, 'all');
51
52 wp_enqueue_script('jquery');
53 wp_enqueue_script('click-to-top-easing', plugins_url('/assets/js/jquery.easing.js', __FILE__), array('jquery'), '1.0', true);
54 wp_enqueue_script('click-to-top-scrollUp', plugins_url('/assets/js/jquery.scrollUp.js', __FILE__), array('jquery', 'click-to-top-easing'), '1.0', true);
55 }
56 add_action('wp_enqueue_scripts', 'click_to_top_script');
57 endif;
58
59 /**
60 * Load the plugin text domain for translation.
61 *
62 * @since 1.0.0
63 */
64 if (!function_exists('click_to_top_textdomain')) :
65 function click_to_top_textdomain()
66 {
67
68 load_plugin_textdomain(
69 'click-to-top',
70 false,
71 dirname(dirname(plugin_basename(__FILE__))) . '/languages'
72 );
73 }
74 add_action('plugins_loaded', 'click_to_top_textdomain');
75 endif;
76
77 function click_top_admin_script()
78 {
79 wp_enqueue_script('click-top-admin-js', plugins_url('/assets/js/admin.js', __FILE__), array('jquery'), CLICK_TO_TOP_VERSION, true);
80 }
81 add_action('admin_enqueue_scripts', 'click_top_admin_script');
82
83 /**
84 * Initialize PluginPulse tracking (config lives inside the SDK).
85 */
86 require_once __DIR__ . '/vendor/wpspace/pulse-sdk/autostart.php';
87
88 /**
89 * Add Settings link on the Plugins page.
90 */
91 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), function ( $links ) {
92 $settings_link = '<a href="' . esc_url( admin_url( 'options-general.php?page=click-to-top.php' ) ) . '">' . esc_html__( 'Settings', 'click-to-top' ) . '</a>';
93 array_unshift( $links, $settings_link );
94 return $links;
95 } );
96