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
- wp_filesystem put_contents issue with owner/group
- javascript datatables in a plugin
- Password field is empty when using wp_signon();
- How can I replace content in the WP Admin area before an admin page is rendered?
- admin-ajax.php returns “No Script Kiddies!” sometimes
- Is not using admin-ajax to ajax submissions okay?
- Ajax functionality not being called under wordpress plugin
- How to display properly exception or echo string after posting in plugin?
- Array/List Edit in Backend
- WP Ajax on page load not working on bluehost but was working on Godaddy
- How can I add the Post ID to Class Name in Jquery?
- Same header/footer in Admin, across all network sites in multisite
- Get (eventual) permalink from post within Edit Post in Admin panel
- Ajax not working to insert, query and result data
- WP Cron as Fast as WordPress AJAX?
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- Template file structure , wordpress hook for altering the template
- How to add conent (text) to Add New pages form of admin in WordPress
- WordPress ajax not working in registration
- Issue with iframe in TinyMCE
- Forcing ALL plugin Admin menus into a separate menu
- Script work on non logged in user but not work for logged in user?
- WordPress plugin: admin-ajax.php not passing data to custom function
- Ajax, jQuery and WordPress
- How do I call the dashboard’s sortable javascript in a plugin page?
- Can’t get query string in ajax call
- How to get site homepage from plugin?
- Post data in wp-admin to external database
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- admin page passing $_POST variables to itself
- Ajax url value to pass ‘variable’ to use in query
- Ajax functions – no access to wp-admin.php only online
- WordPress multiple user roles accessing on their information on one site?
- An adiitional function fires on my AJAX submit
- Fatal error: Call to a member function query() on a non-object in my ajaxpage
- modify buddpress adminbar only in admin pages
- Ajax in Plugins: returns the whole page
- Load css classes after using ajax calls
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- Jquery post responses 500 error after some time and lastly an 503 error
- How to change the headline title for an admin page in a plugin?
- PHPUnit Ajax Serialization of ‘Closure’ is not allowed
- How to get the value entered in the input field in wordpres
- How react js and other Javascript Technologies works on WordPress plugin?
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Return custom product in ajax call loop
- getJSON response to PHP
- 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 do I display and edit other posts within the ‘Edit Post’ area of Wp-Admin Dashboard
- How to prepend a header section to all pages related to my WordPress Plugin
- WordPress plugin boilerplate AJAX functionality
- How to access Elementor-navigation-elements via jQuery
- Insert meta-description into Yoast-SEO input-field via JavaScript
- Issue in Creating Dynamic URL in custom wordpress plugin
- Update Cache on Save Instead of Clearing It?
- Does a wordpress custom plugin is fired by default on php theme ajax request?
- Can’t delete reported post
- WordPress Media Uploader not displaying image that has just been uploaded
- Create child of child custom page in wp-admin
- Ajax response from Media Selection does not update ALL information more than once
- Load specific CSS file
- How to use native wordpress translation domain inside a custom plugin?
- Select a Text for CSS
- WordPress – Filter users list count
- Customize Message