Filter option_active_plugins
. You can change the result of get_option()
here without actually changing the database.
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
add_filter( 'option_active_plugins', 'disable_plugins_temporary' );
function disable_plugins_temporary( $plugins )
{
// unset plugins you don't need, then
return $plugins;
}
Background
wp_get_active_and_valid_plugins()
calls get_option( 'active_plugins', array() )
to get the active plugins. In get_option( $option, $default = false )
we find this filter:
return apply_filters( 'option_' . $option, maybe_unserialize( $value ) );
So the resulting name for our filter is option_active_plugins
.
Related Posts:
- How to sync with plugins update after I have done manual optimizations?
- Sample — test — data for large WordPress install
- Is using WP Transients to save external data for a plugin the best/right way?
- I’m designing a plugin to create database indexes. Suggestions?
- How to analyze wordpress plugin performance
- how to use shortinit in wordpress
- What’s the impact on WordPress’ performance regarding the amount of classes/files in a plugin?
- Create Widget or Enable Shortcodes in Sidebar
- Does is_admin() really provide a plugin performance improvement?
- Developing a plugin, ran it through P3 Profiler, shows up slow, but I don’t know why
- Using tag or inline style attribute?
- How to boost WP custom post REST API GET queries by custom taxonomies
- What’s the difference between term_id and term_taxonomy_id
- How are bulk actions handled in custom list table classes?
- How do I programatically insert a new menu item?
- What is the difference between esc_html and wp_filter_nohtml_kses?
- Customizing the 3.5 “Add Media” popup (Backbone.js)
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- Add a jQuery function to admin pages
- How to change post status in hook?
- Including file or library from other plugin
- Why isn’t the Settings API designed to work for plugins using custom admin menus? [duplicate]
- Is there any reason only 1 (my) IP would be added to this table using $wpdn->insert?
- Plugin activation error due to unexpected output
- How to store data for posts/pages built with drag-n-drop builder?
- WP rest api v2 posts filter by ‘search’ & ‘category_name’ not working
- WordPress Admin Post Type Table Class Filter Hook
- Order of Operation for these three hooks
- save_post hook not triggered in WP v3.6.1
- How to get the ID of the currently logged in user?
- Extend a class plugin
- Using a Shortcode to Replace Themes Stylesheet?
- Where should I put “run once” plugin pages?
- Slow WP_query due to nested wp_query. Need Suggestions
- Plugin Development Output
- How to modify product page for Jigoshop
- Adding Second Plugin Author
- Is @wordpress/env locked to node v14 or can I also use node v16?
- Securing/Escaping Output of file content – reading via fread() in PHP
- Run code once when block is created
- Intermittent database errors when accessing WordPress database
- How to create a “View” page for entry in add_menu_page wordpress admin area (CRUD operation)
- what is the standard ulr for wordpress plugin development?
- Customize WooCommerce my account dashboard through plugin
- Precaching WordPress posts with a ServiceWorker
- Shortcode returning localized HTML part
- Create a custom capability to allow an ‘Editor’ to edit only ‘Subscriber’ users
- global $current_user not current user
- What is the proper way to get logged in user id in a plugin?
- Custom WordPress Plugin will install new and not update
- get_option() will not work without access to wp-config.php
- register_activation_hook on multisite
- Use ‘get’ form action within a WordPress plugin admin page
- How can I add a simple custom field to my plugin?
- Ajax is not working in a loop
- Bind a function with its own argument to show something dynamically after every content
- Inserted double quote when prepending to the_content
- unable to wp_enqueue_script(‘suggest’);
- Plugin development – loading Javascript and Flash
- Drawing the line between theme & plugin on large scale bespoke projects
- Update variable value via add_filter
- Do I need to create an endpoint?
- Plugin custom post template; without overriding all posts
- Run uninstall.php if a checkbox is checked from settings page
- How to check whether checkbox is checked in WordPress customizer
- Gravity Forms Anchor only on Front Page?
- Multiple page plugin settings
- sanitizing/escaping plugin options
- how to get the top 10 popular blogs
- How to output CSS to the beginning of the stylesheet in a WordPress Plugin
- Set page to draft on plugin deactivation
- Can one plugin activate another plugin via script?
- script seem not load with use wp_enqueue_script
- Insert and read media from the WordPress library and call in the plugin
- Do I lose translations when I change my Text domain for my plugin on wp.org?
- Override woocommerce loop-start.php from theme using plugin?
- Get value of custom checkbox from Gutenberg sidebar in plugin
- Enable a role named ‘backend_user’ to access my plugin pages
- jQuery dependent script ignores $in_footer bool and doesn’t work in header
- Hiding class namespace from plugin’s extensions
- Relational / Associate tables using native WordPress functionality
- Stop unauthorised file access
- Changed media upload path for plugin, but generates error & shows wrong url
- Pull commentdata for pre_comment_on_post from comment_post_ID
- Woo-commerce: Adding additional page sections using a child theme
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- How to get html tag ids from template?
- Page reload occurs before request finishes
- PHP Fatal error when using plugin_basename
- How to Rewrite WordPress URL for a Plugin
- How to Prove Ownership of plugin [closed]
- Declaration of mandoe_menu_walker::start_el(&$output, $item, $depth, $args) must be compatible with Walker::start_el(…)
- Reading the inside of
- WordPress, GIT, Renamed Plugin Dir + files – Working Code now Broken [closed]
- get_term_by() returning null on plugin
- How to display .ptm file in my WP site without JAVA
- Getting similar posts by custom field value
- Does WP REST API cache internally executed (rest_do_request) requests?
- Trouble Importing whatsapp-web.js in a WordPress Plugin Development
- ‘useSate’ error when using React on the frontend in custom block plugin