To answer your main question, you are missing one line before calling get_plugins()
. Without it, the list of plugins will come from cache. You can use the following sequence:
delete_plugins( array( 'akismet/akismet.php' ) );
wp_clean_plugins_cache( false );
get_plugins();
WARNING:
it is not recommended using delete_plugins()
in scripts, unless it is a part of complete procedure consisting of deactivation, uninstallation, and then deletion.
Related Posts:
- dbDelta not creating tables
- How to fork a plugin?
- Default table collation on plugin activation?
- How to implement color picker from wordpress in my plugin?
- Nonces can be reused multiple times? Bug / Security issue?
- the_content after all shortcodes are parsed
- How to auto-upgrade my plugin?
- Category listing with thumbnail and description on home page
- How to Add a .js file Only in one specific Page Dynamically to Head
- Displaying search results in the widget itself?
- Missing “category_children” option when dynamically creating categories via a plugin
- Developing a plug-in to charge for
- What is the Difference between directly call a function and call a function using add_action?
- What is better way to use Bootstrap inside admin panel?
- Looking for callback function after Gutenberg is rendered?
- Updating my plugin without releasing a new version
- How to duplicate a curl XML request using HTTP API?
- 404 errors after plugin options update and category base change
- How to determine, from plugin script, if active theme has The Post Title
- Widget Admin – Form Submit Event?
- How to add pages to custom menus on the fly [duplicate]
- add_filter : Passing an array instead of the callback function?
- WordPress security issue to output data from user input from theme option form
- How to add settings subpage from a plugin to a settings page created in theme?
- Using wp_parse_args to set up Plugin Default Settings
- how to add Jquery script to one page?
- how do you prevent showing a particular category on the admin dashboard for specific user roles?
- how query string in wordpress receive the value other than post and page [duplicate]
- get_posts() not working when accessing with a custom user role
- Is there no admin ui guide for 4.x?
- Is there an event or an other method that tells me the preview is loaded?
- Where can i find wordpress auto update code flows?
- Admin Plugin POST to another file within the plugin
- Do I have to worry about useState causing a re-render?
- Plugin sub-menu pages recommended structure and links
- Widget Dropdown doesn’t working
- template_redirect or admin-ajax.php?
- mysql_real_escape_string() vs. esc_sql() in WordPress
- Widget HTML Display Problem
- Display list of uploaded images, filtered by user under a specific user group
- pagination in a custom list created with get_pages function
- Bug: Post needs to be updated twice when adding action for save_post hook
- my own SVN for a plugin/theme
- How to enqueue scripts in right way in a plugin?
- Plugin AJAX Save to Custom Table
- Activate theme via plugin script?
- How can I add function calls to my plugin’s options.php default submit routine?
- How To Update WordPress Custom Plugin For Customer? [closed]
- Secruity Questions on a timer
- configuration of .htaccess for add_rewrite_rule to make sense
- Change author permalink to external URL
- Restrict certain actions to plugin-specific admin menu pages only
- How to get post meta in functions?
- AJAX request not routing through proxy
- Plugin access to average users not only admin
- Custom Settings Plugin Save foreach checkboxes
- Rewrite not working since upgrade to 5.9
- Why won’t this submenu page show? – My First WordPress Plugin
- wordpress full site editing problem when extending core blocks
- How to display plugin with javascript using markup of the theme?
- Can display plugin without shortcode?
- Multiple dynamic Tax Query – pass taxonomy argument from array
- Add default custom taxonomy to plugin activation
- ACF Field value in wordpress login message filter
- ajax stopped working when not logged in wordpress
- Hook for validating and rejecting frontend image upload
- Overriding the template files using a plugin for all themes
- Woocommerce product not appearing in category list page when created programatically [closed]
- Plugin removes itself if mistake made during edit
- Using meta_key & meta_value in add_rewrite_rule
- implementing socket.io with wordpress
- Can’t create a blank template
- Custom Registration Form and Passwords
- Determine if the current page, is being edited
- List Table action argument not cleared
- Looping single post in a theme
- WP Ajax on page load not working on bluehost but was working on Godaddy
- Fullwidth slider using background image Flexslider WordPress
- Return value of $wpdb->update() query in plugin is wrong
- Is there a way to tell if a shorcode’s handler is being run before or after the content formatting filter?
- Plugin files not updated (cache cleared)
- How to limit the number of posts a user can view based on status
- WordPress permalink setting
- How to create an embedded code for wordpress shortcode?
- Error when trying to save custom post type settings (ERROR: options page not found)
- Developing a plugin, ran it through P3 Profiler, shows up slow, but I don’t know why
- Get fields of a widget
- How to add additional field in a table row after creating a table?
- WordPress plugin tables become corrupt
- How to call a new php page inside a plugin page?
- How can i call from custom fields to the category editor?
- Practical Solutions to HTML5 Video on WordPress
- How do you filter get_media_items by mime type in a custom media upload tab?
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]
- Is the only way to add taxonomy terms via an admin panel?
- Find Any Theme’s page.php File
- WP Job Manager – Show recent jobs as cards
- Admin Menu for New Post
- multiple record insert creating many duplicate records