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 to include jQuery and JavaScript files correctly?
- How Do I Use jQuery UI In My Plugin
- How can I run AJAX on a button click event?
- Completely remove WP_Admin_Bar for specific user roles
- Test to see if jQuery or Prototype is queued by another plugin?
- Empty POST data on server on AJAX request using Angular $http
- jQuery in header or footer
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- wp_localize_script $handle
- WP Cron doesn’t save or in post body
- Help adding image upload functionality to widget
- How to post form in ajax mode and handle it in wordpress
- Check if I am in the Admin Panel (wp-admin)?
- How to Use JSON With AJAX?
- How to redirect to action on custom page within admin section
- Add notification bubble notice in navigation using transients
- Where should I put “run once” plugin pages?
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Issue plugin commands in admin settings page
- Programmatically modify an admin page UI of a WordPress site from my WordPress plugin
- Slow WP_query due to nested wp_query. Need Suggestions
- Global State During an Admin Post
- Woocommerce checkout update totals with datepicker
- Including the necessary functions for a custom ajax registration form
- Render content after post title in wp-admin
- Dashboard – get status and position of metaboxes and pass them to ajax method
- Ajax contact form widget plugin data not insert in database
- Is it possible to restrict all admin pages except theme customisation and storefront using plugin?
- javascript datatables in a plugin
- Create tabs in admin options page from custom post type loop
- Issue with contextual help overwriting existing content
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- How do I link to a php file in my plugin directory?
- Remove entire [$key] from array stored in custom field using Ajax – unset($array[$key]); not working
- jQuery instantly executes (a button click and css change) on load
- making a plugin that moves other plugins wp_head actions to wp_footer
- Filter for admin (back end) ‘reply to’ comment
- Setting a JSON web token from a secondary api as a secure cookie on WordPress
- Redirect in WordPress plugin
- How to add custom view links to wp-admin/post.php?
- How to localize data array in plugin’s option page
- AJAX request not routing through proxy
- Ajax request sends url rather than data
- check_admin_referer()
- wc_get_template_part doesnt display the content [duplicate]
- WordPress AJAX Request returns 400
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- How to properly enqueue jQuery knob on WordPress without conflict?
- jQueryUI draggable doesn’t work in WordPress plugin
- Rate limiting ajax requests in WordPress
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- Input field duplicates on form submit by jQuery
- How to handle ajax Request in a complex-structured plugin?
- Stop unauthorised file access
- Is not using admin-ajax to ajax submissions okay?
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- Issue with iframe in TinyMCE
- Script work on non logged in user but not work for logged in user?
- admin page passing $_POST variables to itself
- Fatal error: Call to a member function query() on a non-object in my ajaxpage
- modify buddpress adminbar only in admin pages
- How to change the headline title for an admin page in a plugin?
- How react js and other Javascript Technologies works on WordPress plugin?
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- WordPress Media Uploader not displaying image that has just been uploaded
- Ajax response from Media Selection does not update ALL information more than once