WordPress.org

Plugin Directory

Changeset 655287


Ignore:
Timestamp:
01/19/13 13:17:31 (15 months ago)
Author:
liedekef
Message:

fix a WP php notice for wp_enqueue_script:

Location:
events-made-easy/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • events-made-easy/trunk/events-manager.php

    r653200 r655287  
    3737   // If needed, add high priority action to enable session variables. 
    3838   if (!session_id()) add_action('init', 'session_start', 1); 
    39    // Embed client-clock.js in webpage header. 
    40    wp_enqueue_script('client_clock_submit', plugin_dir_url( __FILE__ ) . 'js/client-clock.js', array('jquery'));   
     39   add_action('wp_enqueue_scripts', 'eme_client_clock_enqueue_scripts'); 
    4140   // Declare URL to the file that receives AJAXed client clock data (wp-admin/admin-ajax.php). 
    4241   wp_localize_script('client_clock_submit', 'eme_ajax', array('ajaxurl' => admin_url('admin-ajax.php'))); 
     
    4746   // Add high priority action to receive clock data from logged-in users. 
    4847   add_action('wp_ajax_client_clock_submit', 'eme_client_clock_callback', 1); 
     48} 
     49 
     50function eme_client_clock_enqueue_scripts() { 
     51   // Embed client-clock.js in webpage header. 
     52   wp_enqueue_script('client_clock_submit', plugin_dir_url( __FILE__ ) . 'js/client-clock.js', array('jquery'));   
    4953} 
    5054 
  • events-made-easy/trunk/readme.txt

    r654509 r655287  
    244244= 1.0.8 = 
    245245* Bugfix: custom (per event) event_registration_pending_email_body was not working 
     246* Bugfix: fix a WP php notice for wp_enqueue_script: it should be called from within other wp_* calls, not directly. So I added it to the callback for add_action('wp_enqueue_scripts') 
Note: See TracChangeset for help on using the changeset viewer.