Changeset 2120 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-custom-stats/stats/discarded-warning.php
- Timestamp:
- 11/23/2015 09:28:30 PM (9 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-custom-stats/stats/discarded-warning.php
r2115 r2120 1 1 <?php 2 2 3 /** 3 4 * This plugin logs discared warnings into a database table. … … 5 6 * @author Dominik Schilling (ocean90) 6 7 */ 7 class GP_WPorg_Log_Discarded_Warnings extends GP_Plugin { 8 var $id = 'wporg-log-discarded-warnings'; 8 class WPorg_GP_Discarded_Warning_Stats { 9 9 10 10 /** … … 13 13 * @var string 14 14 */ 15 var$table_name = 'translate_dotorg_warnings';15 private $table_name = 'translate_dotorg_warnings'; 16 16 17 function __construct() { 18 parent::__construct(); 19 $this->add_action( 'warning_discarded', array( 'args' => 5 ) ); 17 public function __construct() { 18 add_action( 'warning_discarded', array( $this, 'log_discarded_warning' ), 10, 5 ); 20 19 } 21 20 … … 29 28 * @param int $user ID of the user. 30 29 */ 31 function warning_discarded( $project_id, $translation_set, $translation, $warning, $user ) {32 global $ gpdb;30 public function log_discarded_warning( $project_id, $translation_set, $translation, $warning, $user ) { 31 global $wpdb; 33 32 34 33 $warning = array( … … 41 40 ); 42 41 $format = array( '%d', '%d', '%d', '%s', '%d', '%s' ); 43 $ gpdb->insert(42 $wpdb->insert( 44 43 $this->table_name, 45 44 $warning, … … 48 47 } 49 48 } 50 GP::$plugins->wporg_log_discared_warnings = new GP_WPorg_Log_Discarded_Warnings;51 49 52 50 /*
Note: See TracChangeset
for help on using the changeset viewer.