Commit dfff06ee authored by Dave Lane's avatar Dave Lane
Browse files

fix out-of-place enqueuing requests

parent 105ecaf4
......@@ -24,6 +24,17 @@ class BFFForm extends BFFCourse {
$this->create_post(BFF_SLUG);
$this->log('setting up scripts');
// add the ajax handlers
add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
// this enables the feedfinder service for authenticated users...
add_action('wp_ajax_bff_submit', array($this, 'ajax_submit'));
// this allows users who aren't authenticated to use the feedfinder
add_action('wp_ajax_nopriv_bff_submit', array($this, 'ajax_submit'));
// this enables the setblogfeed service for authenticated users...
add_action('wp_ajax_bff_set', array($this, 'ajax_set'));
$this->log('finished setting up scripts');
}
public function enqueue_scripts() {
wp_enqueue_script('bff-script', BFF_URL.'js/bff_script.js', array(
'jquery', 'jquery-form'));
wp_localize_script('bff-script', 'bff_data', array(
......@@ -34,13 +45,6 @@ class BFFForm extends BFFCourse {
// our css
wp_register_style('bff-style', BFF_URL.'css/bff_style.css');
wp_enqueue_style('bff-style');
// this enables the feedfinder service for authenticated users...
add_action('wp_ajax_bff_submit', array($this, 'ajax_submit'));
// this allows users who aren't authenticated to use the feedfinder
add_action('wp_ajax_nopriv_bff_submit', array($this, 'ajax_submit'));
// this enables the setblogfeed service for authenticated users...
add_action('wp_ajax_bff_set', array($this, 'ajax_set'));
$this->log('finished setting up scripts');
}
// the function called after the bff-submit button is clicked in our form
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment