Plugin Directory

Changeset 762427


Ignore:
Timestamp:
08/26/2013 01:08:08 PM (13 years ago)
Author:
bstaruk
Message:

Make plugin "classier"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jquery-enabler/trunk/jQuery-Enabler.php

    r686210 r762427  
    88*/
    99
    10 // Close the door on anyone trying to directly access the plugin
    11 if (!function_exists('add_action')) {
    12     echo 'You shouldn\'nt be here.';
    13     exit;
     10class jQueryEnabler {
     11
     12    public function __construct() {
     13        add_action( 'wp_enqueue_scripts', array(&$this,'jQueryEnablerEnqueue') );
     14    }
     15
     16    public function jQueryEnablerEnqueue() {
     17        wp_enqueue_script( 'jquery' );
     18    }
     19   
    1420}
    1521
    16 //Define wp_enqueue_scripts functionality
    17 function jQueryEnabler() {
    18     wp_enqueue_script( 'jquery' );
    19 }
    20 
    21 add_action( 'wp_enqueue_scripts', 'jQueryEnabler' );
    22 
     22$jQueryEnabler = new jQueryEnabler;
    2323?>
Note: See TracChangeset for help on using the changeset viewer.