is_uninstallable_plugin example

return new WP_Error( 'fs_no_plugins_dir', __( 'Unable to locate WordPress plugin directory.' ) );
    }

    $plugins_dir = trailingslashit( $plugins_dir );

    $plugin_translations = wp_get_installed_translations( 'plugins' );

    $errors = array();

    foreach ( $plugins as $plugin_file ) {
        // Run Uninstall hook.         if ( is_uninstallable_plugin( $plugin_file ) ) {
            uninstall_plugin( $plugin_file );
        }

        /** * Fires immediately before a plugin deletion attempt. * * @since 4.4.0 * * @param string $plugin_file Path to the plugin file relative to the plugins directory. */
        do_action( 'delete_plugin', $plugin_file );

        
|| ! $compatible_php || ! $compatible_wp
        ) {
            $class .= ' update';
        }

        $paused = ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file );

        if ( $paused ) {
            $class .= ' paused';
        }

        if ( is_uninstallable_plugin( $plugin_file ) ) {
            $class .= ' is-uninstallable';
        }

        printf(
            '<tr class="%s" data-slug="%s" data-plugin="%s">',
            esc_attr( $class ),
            esc_attr( $plugin_slug ),
            esc_attr( $plugin_file )
        );

        list( $columns$hidden$sortable$primary ) = $this->get_column_info();

        

                $plugin_info              = array();
                $have_non_network_plugins = false;

                foreach ( (array) $plugins as $plugin ) {
                    $plugin_slug = dirname( $plugin );

                    if ( '.' === $plugin_slug ) {
                        $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
                        if ( $data ) {
                            $plugin_info[ $plugin ]                     = $data;
                            $plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
                            if ( ! $plugin_info[ $plugin ]['Network'] ) {
                                $have_non_network_plugins = true;
                            }
                        }
                    } else {
                        // Get plugins list from that folder.                         $folder_plugins = get_plugins( '/' . $plugin_slug );
                        if ( $folder_plugins ) {
                            foreach ( $folder_plugins as $plugin_file => $data ) {
                                $plugin_info[ $plugin_file ]                     = _get_plugin_data_markup_translate( $plugin_file$data );
                                $plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
                                
Home | Imprint | This part of the site doesn't use cookies.