#23705 closed defect (bug) (worksforme)
get_terms with ajax_nopriv_ return empty array
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
When using the get_terms() function in an ajax function, get_terms() return an empty array.If the user is logged in, get_terms() actually returns a list of terms.
Attachments (2)
Change History (5)
#1
@
12 years ago
- Keywords reporter-feedback added
Could you share your ajax.js
file too?
Note that wp_enqueue_script()
should be hooked to wp_enqueue_scripts
action rather than called directly in the plugin body: http://codex.wordpress.org/Function_Reference/wp_enqueue_script.
#2
@
12 years ago
- Keywords close added
- Status changed from new to closed
Based on my tests and the found solution (not workaround) I suggest this does *not* qualify as a bug. After investigating, we solved the issue by updating the rights in the
Roles > options > Realm > Post Type Usage
section. By unchecking the checkbox labelled "Realisations" we specified that this Custom Type could not have Restrictions and Roles. Once saved we got a properly working drop-down menu even for non logged-in users.
Rather a settings issue then, quite easy to get lost into given the huge features of WP, even more so once extented to permissions and custom types.
I hope this helps,
Pierre.
code which produce the error