You appear to be a bot. Output may be restricted
Description
Implement 'pre_current_active_plugins' to perform Git repo checkingDisable updates for Git repositories. This should also work for Git repositories in symlinked plugins. There must be at least one plugin in the $wp_list_table if it's set; since we're that plugin. The plugin_data['plugin'] is only set if there is an update available.
Usage
bw_check_gitrepos();
Parameters
Returns
voidTO DO
Trying to change the items in the wp_list_table doesn't appear to work. Remove this logic if that's the case.Source
File name: oik/admin/oik-admin.phpLines:
1 to 41 of 41
function bw_check_gitrepos() { global $wp_list_table; if ( isset( $wp_list_table ) ) { $myplugins = $wp_list_table->items; $normalized = wp_normalize_path( WP_PLUGIN_DIR ); foreach ( $myplugins as $plugin => $plugin_data ) { $new_version = bw_array_get( $plugin_data, "new_version", null ); $slug = bw_array_get( $plugin_data, "slug", null ); //if ( $new_version ) { bw_trace2( $new_version, "new_version", false ); // For some plugins the $plugin key and $plugin_data['plugin'] are different. // so we should be using $plugin here $plugin_file = $plugin; $plugin_path = $normalized . '/' . $slug; bw_trace2( $plugin_path, "plugin_path", false ); $real_path = realpath( $plugin_path ); $real_path = wp_normalize_path( $real_path ); bw_trace2( $real_path, "real_path" ); $gitdir = "$real_path/.git"; $dotgit = file_exists( $gitdir ); if ( $dotgit && is_dir( $gitdir ) ) { //gob(); $myplugins[ $plugin ]['update'] = 0; $myplugins[ $plugin ]['real_path'] = $real_path; unset( $myplugins[ $plugin ]['package'] ); //remove_action( "after_plugin_row_" . $plugin_data['plugin'], " add_action( "in_plugin_update_message-" . $plugin_file, "bw_gitrepo_plugin", 10, 2 ); remove_action( "after_plugin_row_$plugin_file", 'wp_plugin_update_row', 10, 2 ); add_action( "after_plugin_row_" . $plugin_file, "bw_gitrepo_after_plugin_row", 10, 2 ); bw_trace2( $plugin_data, "plugin_data", false, BW_TRACE_VERBOSE ); } //} } bw_trace2( $wp_list_table->items, "Items" ); bw_trace2( $myplugins, "myplugins" ); $wp_list_table->items = $myplugins; } }View on GitHub View on Trac