There is a filter called plugin_action_links
that lets you do this.
function wpse253902_disable_plugin_deactivation ($actions, $plugin_file, $plugin_data, $context) {
if (array_key_exists ('deactivate', $actions)) unset( $actions['deactivate'] );
return $actions;
}
There is even a filter plugin_action_links_{plugin_name}
that lets you control the links on individual plugins. If you dive into it, you will find out that you can also use this to define your own links.
Related Posts:
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How can I edit post data before it is saved?
- How to only hook on Single.php after content?
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- Edit plugin without hooks in functions.php
- Filter Hook on plugin update
- Use external link in the add sub menu
- Pass A Value From Outside To A Plugin Variable
- Failed to invoke other hook from the init hook
- Does the ‘nav_menu_css_class’ filter accept 2 or 3 arguments?
- do_action and hook methods
- How can I filter blog name?
- why does the add_action(‘the_content’) overwrite my page
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- plugin_action_links_{$plugin_file} hook not in the main plugin file
- Woocommerce Shipping module available only for type of products [closed]
- Determine plugin name from within plugin_action_links filter
- merging an array to an existing array using add_filter
- Reposition Woocommerce Message
- Randomize attachment IDs
- Pass info from functions.php to plugin
- Change permalink structure hidden button edit
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Inserting above the comment template
- Modifying the comments section through a plugin regardless of theme
- Get Time Taken By Each Action Hook in WordPress
- Filtering WooCommerce Orders by Category
- Template filter for custom taxonomy terms
- Add sub menu page in your plugin
- What exactly happens to function argument availability when using a filter?
- remove_action not removing add_action from constructor
- How to use the pre_option filter before a plugin loads?
- How to use filter to disable adding a product to wishlist?
- WordPress: Add custom add_filter for custom functions
- Hook for altering the content of all wp mails
- How to hook into action/filter call
- Use a hook or filter, or overwrite this Gamipress function?
- Add hook after content without formatting
- Unpublished Pages Failing To Appear On Custom Path
- Randomize post (and page) IDs on generation
- Plugin function in child theme
- Use action, filter, or hook to append HTML to WordPress plugin function
- Customize plugin templates
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Passing a parameter to filter and action functions
- change output location of plugin function using a custom hook
- add query string to all pages after user logged in
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- How to Add Extra Text In WordPress Title Before Post Publish
- Change social icon in twenty twenty three theme
- Customize WP Filter Hook
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Best place for short bio,image and button [closed]
- How to remove plugin metaboxes from edit.php
- Plugin developer automated documentation
- qTranslate remove default directory from link
- How to disable a plugin for certain page?
- Output content to the_content before a plugin does
- Is there a hook to Intercept al urls from a webpage and redirect to a page
- WordPress user account activation
- do_action() hook into load-(page)
- Howto check version of another plugin and then add a submenu page to it
- External Script Using WP – Hooks / Actions Not Working?
- password_reset hook is not working
- The Hook registration_errors was not called
- URL parameters causing 404 on home page, but nowhere else
- Which filter affects the ‘entry-title’ post class
- How to change the name of the “edit my profile” link in the WordPress admin backend
- Filtering get_permalink in Jetpack / ShareDaddy
- Hook into existing tinyMCE button
- Proper way to replace the_content only for pages created by custom plugin
- add_filter doesn’t work
- How to get post ID with hooks publish_post, new_to_publish, etc
- Redirect to another page using contact form 7? [closed]
- edit_user_profile and show_user_profile are not firing inside a class
- Is there a way to figure out which action/filter invoked a function?
- how to change automatic placing of social plugins below content?
- Using add_action before add_filter on a plugin?
- Check if variable is set in filter
- Combining several CSS files into one for optimization
- the_post hook is not firing for me
- Why do plugins often ask to add in to templates?
- Deactivate JS Script in Plugin Shortcode
- Passing stored variables to add_filter
- Modify page title and subtitle with a plugin
- override filter in a plugin
- Check filter defined or not?
- Create a post builder skin in a plugin
- Plugin Development – Functions or Hooks?
- How to get menu location in wp_update_nav_menu hook
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Can my hooked uninstall class function access a global var declared in main plugin file?
- Flipping Book PHP Code? Any experience?
- How can I apply a WP filter on specific plugin version
- Filter WooCommerce Orders
- Turning on output buffering in a wordpress plugin
- Hook for page Request?
- Display Plugin Panels Outside of Admin Areas