Ticket #4048: get_plugin_data.pre_activate-hooks.patch
File get_plugin_data.pre_activate-hooks.patch, 1.3 KB (added by , 17 years ago) |
---|
-
plugin.php
28 28 $author = '<a href="' . trim( $author_uri[1] ) . '" title="'.__( 'Visit author homepage' ).'">' . trim( $author_name[1] ) . '</a>'; 29 29 } 30 30 31 return array('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version); 31 $plugin_data = apply_filters( 'get_plugin_data', array('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version) ); 32 33 return $plugin_data; 32 34 } 33 35 34 36 function get_plugins() { … … 99 101 wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), 'plugins.php?error=true&plugin=' . $plugin)); // we'll override this later if the plugin can be included without fatal error 100 102 ob_start(); 101 103 @include(ABSPATH . PLUGINDIR . '/' . $plugin); 102 $current[] = $plugin; 103 sort($current); 104 update_option('active_plugins', $current); 105 do_action('activate_' . $plugin); 104 $can_activate = apply_filters( 'before_activate_' . $plugin, true ); 105 if( $can_activate ) { 106 $current[] = $plugin; 107 sort($current); 108 update_option('active_plugins', $current); 109 do_action('activate_' . $plugin); 110 } 106 111 ob_end_clean(); 107 112 } 108 113