You may need to have this line in your code
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
The plugin.php file is not automatically included.
Related Posts:
- Uninstall, Activate, Deactivate a plugin: typical features & how-to
- How to check if a theme is active?
- Show a confirm message before plug-in activation
- disable active plugins for specific theme
- How to automate wordpress plugin activate and deactivate by php logic?
- Deactivate Plugin on Theme Switch
- Prevent a plugin from being automatically activated
- Is any information available in PHP files in WP about plugin activation history?
- My plugin does not install correctly if a previous version is still installed
- Different plugins activated online and offline
- Activate plugins by a theme’s functions.php?
- Install theme as part of a plugin
- How To Activate Plugins via Code?
- How to maintain W3C standards compliance of a theme
- Difference between a theme and a plugin?
- All shortcodes not working on custom theme
- Disable plugins on cron and ajax page
- Is it good practice to remove redundant plugins and themes?
- Ship plugin with a custom theme
- Declare a function before plugin does on the theme functions.php file
- Activate Plugin which is in subfolder?
- Whats the difference between Page Builder Plugins and Theme Builder Softwares? [closed]
- How to use load_plugin_textdomain from within a theme
- Multisite: Activate plugin for subsites only?
- Theme and Plugins sharing common libraries
- Is there a quick way to inject i18n domain into theme/plugin files?
- How to avoid redefining requirejs in plugin when another plugin also uses requirejs
- Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- add_action in functions.php, do_action in plugin?
- Can a plugin deactivate itself?
- How can I list recent posts excerpts?
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- Do I still need a theme to use page builders?
- Theme and plugin install or update display error in localhost
- Can I make a super plugin that also has a theme?
- Reduce Drop down Menu Width in WordPress
- Prevent WordPress installing plugins and themes via Admin
- Plugin Handle URL With Custom Theme
- How to block plugin activations with no known user or coming from unknown IP address range?
- Check for security updates
- Plugin-generated pages use Not Found or Pages Archive templates?
- Classified ad website : which solutions to use? [closed]
- Advanced Custom Field DatePicker [closed]
- All sites themes functions.php have been changed
- Finding the URL to be used to check if plugin is installed with a theme
- register_activation_hook in oop approach
- “No Add Button” for me to customize my WordPress with themes and pluggins
- How can I list all installed plugins/themes/versions from CLI/API?
- Why does my file_exist check fail?
- How to protect WordPress from security scanner [closed]
- how can I query all wordpress users of a blog
- Making that Admin Bar transparent or a blue color
- how to activate a plugin inside a theme
- There has been a critical error on your website – won’t fix no matter what
- Is it possible not to load theme on a specific page in wordpress?
- Override/ignore CSS from active theme as not to interfere with my custom CSS
- I receive taxonomy id
- How to extract a .wp-env.json or composer.json containing plugin versions from a production website?
- How to include files relative to a file’s directory
- Does Deactivating a Plugin Help Anything?
- Override css rules of a plugin within my own theme
- Blocking Plugin Css to load custom in template directory
- After a manual update, themes and plugins that were installed (and still in the directory) are not being seen
- Per theme plugins?
- Display WordPress comments before the plugins?
- Mobilepress fails to translate short codes
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- In Multisite Setups, how to update mass sections of sub-sites
- How to override any plugin file in the child theme
- Replace old theme that understand old css (vcex_icon_box css_animation)
- Mobile Menu and Mobile Sidebar missing
- custom fields not displaying on wordpress site
- elementor development – custom widget like an inner section widget
- How to run flush_rewrite_rules on activation after i register my custom post type using WordPress Boilerplate Plugin
- How to store a custom theme and update it on other installations
- How to get a post views count using ‘WordPress popular posts’ plugin
- Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
- How to prevent redoing get_posts queries and make results available to other scripts?
- Is it possible to disable a theme programmatically?
- Google trying to index child theme files
- Unable to to self-deactivate plugin using deactivate_plugins()
- In the WordPress API is there a way to set the width of the post/page container
- wp_login_form() ignoring login_form action hook
- What Are the Advantages of Using an mu-plugin
- How to fix On “An unexpected error occurred” message when I click on Add new theme or plugin?
- How to display post by date written (1974) and not date published (today)?
- API calls on plugin activation or init?
- Things that saved lose when logout
- Automatic updates of plugins and themes outside of wordpress.org
- Theme specific plugin, how?
- Run WP inside a other Site without using frames
- why i cannot see some plugins while they are enabled on network admin page?
- Theme causing SSL break on chrome
- Why does theme need woocommerce to show images / content on front page?
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- How to create an Info Box on WordPress [closed]
- How to make content as required in custom post type?
- Any plugin installation and update overwrite current theme
- Problem on a wordpress website with a plugin [closed]