You appear to be a bot. Output may be restricted
Description
Implement 'pre_current_active_plugins' to perform symlink checkingDisable updates for 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_symlinks();
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 35 of 35
function bw_check_symlinks() { 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 ); 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 . '/' . $plugin_file; bw_trace2( $plugin_path, "plugin_path", false, BW_TRACE_VERBOSE ); $real_path = realpath( $plugin_path ); $real_path = wp_normalize_path( $real_path ); bw_trace2( $real_path, "real_path", false, BW_TRACE_VERBOSE ); if ( $real_path != $plugin_path ) { $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_symlinked_plugin", 10, 2 ); remove_action( "after_plugin_row_$plugin_file", 'wp_plugin_update_row', 10, 2 ); add_action( "after_plugin_row_" . $plugin_file, "bw_symlinked_after_plugin_row", 10, 2 ); bw_trace2( $plugin_data, "plugin_data", false, BW_TRACE_VERBOSE ); } } } bw_trace2( $wp_list_table->items, "Items", false, BW_TRACE_VERBOSE ); bw_trace2( $myplugins, "myplugins", false, BW_TRACE_VERBOSE ); $wp_list_table->items = $myplugins; } }View on GitHub View on Trac