Tan-007 /
myslideshow
| 1 | <?php |
||||||||
| 2 | |||||||||
| 3 | /** |
||||||||
| 4 | * The public-facing functionality of the plugin. |
||||||||
| 5 | * |
||||||||
| 6 | * @link rahicodes.wordpress.com |
||||||||
| 7 | * @since 1.0.0 |
||||||||
| 8 | * |
||||||||
| 9 | * @package Myslideshow |
||||||||
| 10 | * @subpackage Myslideshow/public |
||||||||
| 11 | */ |
||||||||
| 12 | |||||||||
| 13 | /** |
||||||||
| 14 | * The public-facing functionality of the plugin. |
||||||||
| 15 | * |
||||||||
| 16 | * Defines the plugin name, version, and two examples hooks for how to |
||||||||
| 17 | * enqueue the public-facing stylesheet and JavaScript. |
||||||||
| 18 | * |
||||||||
| 19 | * @package Myslideshow |
||||||||
| 20 | * @subpackage Myslideshow/public |
||||||||
| 21 | * @author Rahi Prajapati <[email protected]> |
||||||||
| 22 | */ |
||||||||
| 23 | class Myslideshow_Public { |
||||||||
| 24 | |||||||||
| 25 | /** |
||||||||
| 26 | * The ID of this plugin. |
||||||||
| 27 | * |
||||||||
| 28 | * @since 1.0.0 |
||||||||
| 29 | * @access private |
||||||||
| 30 | * @var string $plugin_name The ID of this plugin. |
||||||||
| 31 | */ |
||||||||
| 32 | private $plugin_name; |
||||||||
| 33 | |||||||||
| 34 | /** |
||||||||
| 35 | * The version of this plugin. |
||||||||
| 36 | * |
||||||||
| 37 | * @since 1.0.0 |
||||||||
| 38 | * @access private |
||||||||
| 39 | * @var string $version The current version of this plugin. |
||||||||
| 40 | */ |
||||||||
| 41 | private $version; |
||||||||
| 42 | |||||||||
| 43 | /** |
||||||||
| 44 | * Initialize the class and set its properties. |
||||||||
| 45 | * |
||||||||
| 46 | * @since 1.0.0 |
||||||||
| 47 | * @param string $plugin_name The name of the plugin. |
||||||||
| 48 | * @param string $version The version of this plugin. |
||||||||
| 49 | */ |
||||||||
| 50 | public function __construct( $plugin_name, $version ) { |
||||||||
| 51 | |||||||||
| 52 | $this->plugin_name = $plugin_name; |
||||||||
| 53 | $this->version = $version; |
||||||||
| 54 | |||||||||
| 55 | } |
||||||||
| 56 | |||||||||
| 57 | /** |
||||||||
| 58 | * Register the stylesheets for the public-facing side of the site. |
||||||||
| 59 | * |
||||||||
| 60 | * @since 1.0.0 |
||||||||
| 61 | */ |
||||||||
| 62 | public function enqueue_styles() { |
||||||||
| 63 | |||||||||
| 64 | /** |
||||||||
| 65 | * This function is provided for demonstration purposes only. |
||||||||
| 66 | * |
||||||||
| 67 | * An instance of this class should be passed to the run() function |
||||||||
| 68 | * defined in Myslideshow_Loader as all of the hooks are defined |
||||||||
| 69 | * in that particular class. |
||||||||
| 70 | * |
||||||||
| 71 | * The Myslideshow_Loader will then create the relationship |
||||||||
| 72 | * between the defined hooks and the functions defined in this |
||||||||
| 73 | * class. |
||||||||
| 74 | */ |
||||||||
| 75 | |||||||||
| 76 | wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/myslideshow-public.css', array(), $this->version, 'all' ); |
||||||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
The function
plugin_dir_url was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 77 | |||||||||
| 78 | } |
||||||||
| 79 | |||||||||
| 80 | /** |
||||||||
| 81 | * Register the JavaScript for the public-facing side of the site. |
||||||||
| 82 | * |
||||||||
| 83 | * @since 1.0.0 |
||||||||
| 84 | */ |
||||||||
| 85 | public function enqueue_scripts() { |
||||||||
| 86 | |||||||||
| 87 | /** |
||||||||
| 88 | * This function is provided for demonstration purposes only. |
||||||||
| 89 | * |
||||||||
| 90 | * An instance of this class should be passed to the run() function |
||||||||
| 91 | * defined in Myslideshow_Loader as all of the hooks are defined |
||||||||
| 92 | * in that particular class. |
||||||||
| 93 | * |
||||||||
| 94 | * The Myslideshow_Loader will then create the relationship |
||||||||
| 95 | * between the defined hooks and the functions defined in this |
||||||||
| 96 | * class. |
||||||||
| 97 | */ |
||||||||
| 98 | |||||||||
| 99 | wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/myslideshow-public.js', array( 'jquery' ), $this->version, false ); |
||||||||
|
0 ignored issues
–
show
The function
plugin_dir_url was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
The function
wp_enqueue_script was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 100 | |||||||||
| 101 | } |
||||||||
| 102 | |||||||||
| 103 | } |
||||||||
| 104 |