Making WordPress.org

Changeset 11767


Ignore:
Timestamp:
04/12/2022 06:40:15 PM (4 years ago)
Author:
ocean90
Message:

Translate: Keep project stats in sync when translations are deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-custom-stats/stats/project.php

    r10000 r11767  
    2222                global $wpdb, $gp_table_prefix;
    2323
    24                 add_action( 'gp_translation_created', array( $this, 'translation_created' ) );
    25                 add_action( 'gp_translation_saved', array( $this, 'translation_saved' ) );
     24                add_action( 'gp_translation_created', array( $this, 'translation_edited' ) );
     25                add_action( 'gp_translation_saved', array( $this, 'translation_edited' ) );
     26                add_action( 'gp_translation_deleted', array( $this, 'translation_edited' ) );
    2627                add_action( 'gp_originals_imported', array( $this, 'originals_imported' ), 10, 5 );
    2728
     
    3839        }
    3940
    40         function translation_created( $translation ) {
    41                 $set = GP::$translation_set->get( $translation->translation_set_id );
    42                 $this->projects_to_update[ $set->project_id ][ $set->locale . '/' . $set->slug ] = true;
    43         }
    44 
    45         function translation_saved( $translation ) {
     41        function translation_edited( $translation ) {
    4642                $set = GP::$translation_set->get( $translation->translation_set_id );
    4743                $this->projects_to_update[ $set->project_id ][ $set->locale . '/' . $set->slug ] = true;
Note: See TracChangeset for help on using the changeset viewer.