Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OERu
blog-feed-finder
Commits
dfff06ee
Commit
dfff06ee
authored
Dec 16, 2019
by
Dave Lane
Browse files
fix out-of-place enqueuing requests
parent
105ecaf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/bff-app.php
View file @
dfff06ee
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment