For excluding terms of a taxonomy the better way to do that would be to use the hook that was created for doing term exclusions.. list_terms_exclusions
Get the available categories using get_terms
(get_categories calls get_terms anyway IIRC), and do your exclusions using a hook on list_terms_exclusions
and your code should work as expected..
You can see the hook i’m referring to on line 1040.
http://core.trac.wordpress.org/browser/trunk/wp-includes/taxonomy.php
NOTE: Your plugin does not have a sanitization callback function when it calls register_setting, your options won’t get sanitized properly without one, i’d strongly advise you declare a callback function and sanitize the data as appropriate (especially if you’re passing that saved data into queries).
Related Posts:
- Data not insert and update through ajax and jQuery in admin page?
- ajaxurl not defined on front end
- Hook the Keydown Event in the TinyMCE Post Editor
- Add a jQuery function to admin pages
- Using Ajax call in jQuery doesn’t work in widget
- Admin-ajax.php appending a status code to ajax response
- Ajax in WordPress – path issue
- WP AJAX is not working, always returns 0
- Any problem in using native jquery ajax style instead of using admin-ajax.php?
- how to search users by ajax live search
- template_redirect or admin-ajax.php?
- jquery & ajax sending data to php
- 400 Bad Request, in wordpress theme development, wp_ajax
- Ajax submit result opens in admin-ajax.php
- insert query on a custom table using ajax with jQuery plugin Jeditable
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- WP ajax requests not stacking?
- AJAX button with success callback. (Titan Framework)
- ajax working when function is on child theme but not in plugin page
- jQuery UI tab does not work in the plugin page
- Best practice for plugin: always detect admin-ajax call?
- Ajax +wordpress onClick link redirect to new page and create html content
- Ajax on the Administration Side of plugin – returns 0
- Jquery php request is returning a weird result
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- WordPress Ajax not returning Response
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Filterable posts using categories
- How to get values from Tinymce visual editor popup?
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- WordPress function is not called and ajax return 0
- Ajax call not working with
- Page reload occurs before request finishes
- Loading jQuery library from WordPress admin
- How can I add an image upload field directly to a custom write panel?
- Export data as CSV in back end with proper HTTP headers
- How-to implement admin Ajax inside an admin WP_List_Table?
- How to make ajax call in wordpress in right way?
- How do you create a custom edit.php / edit pages page
- Adding callback function for wp_ajax_ has no effect
- Why is my ajax call refreshing the page?
- wp_enqueue_style built in styles
- How to put placeholder text in the main post input area?
- Admin-ajax.php is dying “0” without processing function
- Problem with WordPress Ajax form
- Mixing Regular Javascript With jQuery in a Plugin
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- add a class when login
- Fetching the value of forms in WordPress AJAX
- Using the default wordpress uploader inside plugin
- Replacing Scripts in Admin Load_Scripts
- Show special field when correct shipping is chosen
- On cliking add new post redirect user to a custom page first
- How to localize admin.php only once
- WordPress ajax doesn’t display object method on jQuery .change() function
- Create a new post using rest api and save featured image using an external image url
- Prevent third party plugin’s admin page access based on user type
- wp.template() returns tags in Ajax response
- How to get Metabox custom field to show checked if value is updated using post meta query?
- Use just a shortcode from another page
- How to load library scripts in admin from plugins in noConflict wrapper?
- Update Data parameter of a wp_localize_script() call
- Bad Request in AJAX
- ajax recursive calls on wordpress returning answers outsite the function scope
- Creating multiple wp_editer() text fields in for loop — the text/visual switch only works for first editor
- Displaying “One Time” Notification in Plugins
- Are there any security risks when submitting data-attribute data through AJAX?
- Jquery was not found on this server
- Insert Into Post Not Working For Audio File Using jQuery
- Is it possible to load the css just on my plugin admin page?
- AJAX call returns ‘testtest0’ instead of ‘test’ – why?
- Disable Auto-Expanding Menu in WordPress Admin Menus
- Why is the form not updating when I select a new sector from the list?
- Loading Images from Javascript on the Front End
- How to deal with different jQuery versions?
- How to make an admin plugin menu page go full screen?
- wp.media gallery collection sometimes undefined
- How to control ajax calls without effecting memory of server?
- “add to cart” links css class “ajax_add_to_cart” doesn’t show in woocommerce in widget sidebar
- Add New Button in Admin Panel
- ajax call return 406 not acceptable for non logged users only
- Does $this context change in an AJAX callback?
- $ is not defined [duplicate]
- Inserted data from database does not showing on front-page without referesh page?
- wp_ajax function return the html page
- Ajax call not working anymore
- Add a Script button in W3 Total Cache plugin not working due to conflicting jQuery version
- How To do Ajax In WordPress Custom Plugin?
- replacing jquery google cdn with a new version dynamically
- How to display properly exception or echo string after posting in plugin?
- Get (eventual) permalink from post within Edit Post in Admin panel
- Ajax not working to insert, query and result data
- How to add conent (text) to Add New pages form of admin in WordPress
- Post data in wp-admin to external database
- Ajax url value to pass ‘variable’ to use in query
- Ajax in Plugins: returns the whole page
- ajax problems on loading page [closed]
- Why my admin-ajax url returns 0 even after adding echo and die() at the end of function?
- How to prepend a header section to all pages related to my WordPress Plugin
- WordPress plugin boilerplate AJAX functionality