BSF_Update_Manager::prepare_plugins_for_update( Array $plugins )

Remove plugins from the updates array which are not installed.


Description


Parameters

$plugins

(Array) (Required) Plugins.


Return

(Array) of plugins.


Source

File: admin/bsf-core/class-bsf-update-manager.php

		public static function prepare_plugins_for_update( $plugins ) {
			foreach ( $plugins as $key => $plugin ) {
				if ( isset( $plugin['template'] ) && ! file_exists( dirname( realpath( WP_PLUGIN_DIR . '/' . $plugin['template'] ) ) ) ) {
					unset( $plugins[ $key ] );
				}
				if ( isset( $plugin['init'] ) && ! file_exists( dirname( realpath( WP_PLUGIN_DIR . '/' . $plugin['init'] ) ) ) ) {
					unset( $plugins[ $key ] );
				}
			}

			return $plugins;
		}


User Contributed Notes

You must log in before being able to contribute a note or feedback.