Changeset 60 for trunk/WordPress/plugin/transposh/transposh.php
- Timestamp:
- 03/07/2009 08:14:19 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/WordPress/plugin/transposh/transposh.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WordPress/plugin/transposh/transposh.php
r59 r60 278 278 function insert_javascript_includes() 279 279 { 280 global $plugin_url, $ is_edit_mode, $wp_query;280 global $plugin_url, $wp_query; 281 281 282 282 if (!($wp_query->query_vars[EDIT_PARAM] == "1" || … … 752 752 } 753 753 754 /* 755 * Gets the plugin name to be used in activation/decativation hooks. 756 * Keep only the file name and its containing directory. Don't use the full 757 * path as it will break when using symbollic links. 758 */ 759 function get_plugin_name() 760 { 761 $file = __FILE__; 762 $file = str_replace('\\','/',$file); // sanitize for Win32 installs 763 $file = preg_replace('|/+|','/', $file); // remove any duplicate slash 764 765 //keep only the file name and its parent directory 766 $file = preg_replace('/.*(\/[^\/]+\/[^\/]+)$/', '$1', $file); 767 logger("Plugin path $file", 3); 768 return $file; 769 } 770 754 771 //Register callbacks 755 772 add_action('wp_head', 'add_custom_css'); … … 760 777 761 778 add_action( 'plugins_loaded', 'plugin_loaded'); 762 add_action('activate_'.str_replace('\\','/',plugin_basename(__FILE__)),'plugin_activate');763 add_action('deactivate_'.str_replace('\\','/',plugin_basename(__FILE__)),'plugin_deactivate');779 register_activation_hook(get_plugin_name(), 'plugin_activate'); 780 register_deactivation_hook(get_plugin_name(),'plugin_deactivate'); 764 781 ?>
Note: See TracChangeset
for help on using the changeset viewer.
