WordPress.org

Plugin Directory

Changeset 699313


Ignore:
Timestamp:
04/17/13 20:04:53 (12 months ago)
Author:
eskapism
Message:

add plugin name when deactivating

Location:
simple-history/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simple-history/trunk/index.php

    r699258 r699313  
    44Plugin URI: http://eskapism.se/code-playground/simple-history/ 
    55Description: Get a log/history/audit log/version history of the changes made by users in WordPress. 
    6 Version: 1.1 
     6Version: 1.1x 
    77Author: Pär Thernström 
    88Author URI: http://eskapism.se/ 
     
    621621    simple_history_add("action=activated&object_type=plugin&object_name=$plugin_name"); 
    622622} 
     623 
     624/** 
     625 * Plugin is deactivated 
     626 * plugin_name is like admin-menu-tree-page-view/index.php 
     627 */ 
    623628function simple_history_deactivated_plugin($plugin_name) { 
    624     $plugin_name = urlencode($plugin_name); 
     629 
     630    // Fetch info about the plugin 
     631    $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_name ); 
     632     
     633    if ( is_array( $plugin_data ) && ! empty( $plugin_data["Name"] ) ) { 
     634        $plugin_name = urlencode( $plugin_data["Name"] ); 
     635    } else { 
     636        $plugin_name = urlencode($plugin_name); 
     637    } 
     638     
    625639    simple_history_add("action=deactivated&object_type=plugin&object_name=$plugin_name"); 
     640 
    626641} 
    627642 
  • simple-history/trunk/readme.txt

    r699258 r699313  
    134134 
    135135== Changelog == 
     136 
     137= 1.x = 
     138- Fixed: Plugin name is included when plugin is deactivated. Previosuly only folder name and name of php file was included. 
    136139 
    137140= 1.1 = 
     
    293296= 0.1 = 
    294297* First public version. It works! 
     298 
     299 
Note: See TracChangeset for help on using the changeset viewer.