89 lines
2.2 KiB
PHP
89 lines
2.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* The public-facing functionality of the module.
|
|
*
|
|
* @link http://example.com
|
|
*
|
|
* @package OCVM
|
|
* @subpackage OCVM/public
|
|
*/
|
|
|
|
/**
|
|
* The public-facing functionality of the module.
|
|
*
|
|
* Defines the module name, version, and two examples hooks for how to
|
|
* enqueue the public-facing stylesheet and JavaScript.
|
|
*
|
|
* @package OCVM
|
|
* @subpackage OCVM/public
|
|
* @author one.com
|
|
*/
|
|
class OCVM_Public {
|
|
|
|
/**
|
|
* The ID of this module.
|
|
|
|
* @access private
|
|
* @var string $OCVM The ID of this module. */
|
|
private $OCVM;
|
|
|
|
/**
|
|
* The version of this module.
|
|
|
|
* @access private
|
|
* @var string $version The current version of this module. */
|
|
private $version;
|
|
|
|
/**
|
|
* Initialize the class and set its properties.
|
|
|
|
* @param string $OCVM The name of the module.
|
|
* @param string $version The version of this module. */
|
|
public function __construct( $OCVM, $version ) {
|
|
|
|
$this->OCVM = $OCVM;
|
|
$this->version = $version;
|
|
}
|
|
|
|
/**
|
|
* Register the stylesheets for the public-facing side of the site.
|
|
*/
|
|
public function enqueue_styles() {
|
|
|
|
/**
|
|
* This function is provided for demonstration purposes only.
|
|
*
|
|
* An instance of this class should be passed to the run() function
|
|
* defined in OCVMLoader as all of the hooks are defined
|
|
* in that particular class.
|
|
*
|
|
* The OCVMLoader will then create the relationship
|
|
* between the defined hooks and the functions defined in this
|
|
* class.
|
|
*/
|
|
|
|
wp_enqueue_style( $this->OCVM, plugin_dir_url( __FILE__ ) . 'css/plugin-name-public.css', array(), $this->version, 'all' );
|
|
}
|
|
|
|
/**
|
|
* Register the JavaScript for the public-facing side of the site.
|
|
*/
|
|
public function enqueue_scripts() {
|
|
|
|
/**
|
|
* This function is provided for demonstration purposes only.
|
|
*
|
|
* An instance of this class should be passed to the run() function
|
|
* defined in OCVMLoader as all of the hooks are defined
|
|
* in that particular class.
|
|
*
|
|
* The OCVMLoader will then create the relationship
|
|
* between the defined hooks and the functions defined in this
|
|
* class.
|
|
*/
|
|
|
|
wp_enqueue_script( $this->OCVM, plugin_dir_url( __FILE__ ) . 'js/plugin-name-public.js', array( 'jquery' ), $this->version, false );
|
|
}
|
|
}
|