For unlinking, try:
function superDeactivation() {
$myFile = "testFile.txt";
if(is_file("$myFile")) {
unlink("$myFile");
}
}
Or alternatively:
function superDeactivation() {
$myFile = "testFile.txt";
unset($myFile);
unlink("$myFile");
}
Related Posts:
- Should I use wpdb prepare?
- How to call images from your plugins image folder?
- Is there a limit on making calls to WordPress.org API’s?
- Vagrant script to setup all the common PHP / WordPress version combinations
- How-to implement admin Ajax inside an admin WP_List_Table?
- What is the etiquette on extending a plug-in
- Add Dividers or Separators Between Nav Menu Items
- Overide get_template_part( ‘partials/post’, ‘sidebar’ ); with a plugin
- Change Media Uploader default directory
- How to make method from plugin available in theme?
- WP 3.3 Tooltips API?
- Clarity needed on usage of multiple 403 forbidden header() functions at the beginning of the plugin files
- Load visual editor without custom styling
- Can i do plugin commits directly from a plugin folder inside an installation using the Trunk SVN
- Turn Shortcode Gallery into Carousel in WordPress 4.4
- Using a Theme inside a Plugin directory
- register_activation_hook() not activate plugin
- Problem with sorting entries in a plugin’s admin interface table
- Multiple textdomains
- How to prevent specific plugin files or subfolders from appearing under “plugin files” listing
- How to create custom home page via plugin?
- Dynamically Override Fancy Title
- Use a PHP file as action for a form in a WordPress plugin, what’s the correct way?
- Featured Image not showing in admin
- What URL do you pass to wp_remote_get to load the body of the current post’s preview?
- Override pluggable functions in a plugin?
- Set a specific page as 404 – not found via my own plugin
- Adding Automatically To In WordPress Using Filter Referencing?
- Activation hook not creating table
- wpColorPicker is not a function!
- How to display non-page / post content
- Plugin update not reflected in WordPress plugin page
- Mixing Regular Javascript With jQuery in a Plugin
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- Best plugin for most viewed post [closed]
- What could cause my plugin’s options/settings page not to load?
- Plugin Upgrade Strategy
- Which are the hooks run before/after when a category’s deletion?
- Disable The Events Calendar plugin from loading its scripts
- get_the_excerpt() not working in plugin loop
- How to remove images from my plugin page in WP Directory?
- Is there an additional block.json property to set to get an InnerBlocks child to respect the “supports” property?
- Plugin with action ‘save_post’ needs to press publish twice on order to publish
- How to prevent UNDO on guternberg block editor
- WP Editor Issue in Backend
- How can I get the selected string when using a toolbar button in Gutenberg?
- woocommerce_checkout_order_processed hook executing function twice
- How to analyze wordpress plugin performance
- how to use shortinit in wordpress
- On the .org repo, can your plugin name/slug contain “WooCommerce” [closed]
- Wrap text around shortcode
- UWooCommerce – add cart discount programmatically?
- Checked() function on a multidimensional array
- Remove sidebar on single page using plugin API
- When does save_post hook fire on post save/update
- Plugin does not add action
- Enqueuing scripts and styles in custom plugins
- Jquery was not found on this server
- Include file in plugin file
- Plugin language always shows WP site language, not profile language
- How to create a digital product download link that can’t be used twice?
- Adding custom stylesheet into header.php using a plugin
- Developing the save function in Gutenberg blocks
- Creating an installation zip file
- update_callback is not working in register_rest_field
- How to create ShortCode
- Detect change in site_url and home_url
- Reporting errors in a shortcode plugin
- shortcode tags not working in do_shortcode
- Working of foreach loop with array
- Why is the form not updating when I select a new sector from the list?
- How to change a field in database through a submit button or Checkbox? [closed]
- Grandchildtheme (plugin) add header.php (not exist in child theme)
- How do I add a menu item to a Pods admin menu?
- $wpdb->update Issue
- Is there a way to add a link with add_post_meta?
- How to Show Category List With Corresponding Links?
- How to use attributes in competent of Gutenberg
- Error code when migrate
- Add two button to page and post admin to redirect to : add new & list of (posts – pages) just after saving post or page
- How to add .ini file type to the plugin editor to read and edit?
- How to write a custom shortcode name book?
- WordPress: I wanted to use Add rewrite rule multiple times for multiple CPT in my plugin
- get the term_id of current taxonomy page
- WordPress Ajax not returning Response
- Group By in a Metaquery
- Add a Script button in W3 Total Cache plugin not working due to conflicting jQuery version
- Remove from a div by class name from post page if post author role is not administrator
- Getting duplicate page when activating my plugin
- Enqueue script not working
- Modify request query string before plugins
- auto create only 1 wp page in activate custom plugin
- Include add_post_meta in a plugin
- Custom query not working in plugin admin page
- isset($_POST[‘submit’]) ignored on comment submission
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- how to insert content into wp_head after loop_end
- REST API error in block editor for custom templates
- Execute callback after REST API request completes + Response is sent
- High-Performance Order Storage conflict action `manage_shop_order_posts_custom_column`