Making WordPress.org


Ignore:
Timestamp:
02/22/2016 07:37:47 PM (8 years ago)
Author:
ocean90
Message:

Translate: Store the timestamp of the last update for projects.

See #1590.

File:
1 edited

Legend:

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

    r2275 r2543  
    1515        add_filter( 'gp_projects', array( $this, 'natural_sort_projects' ), 10, 2 );
    1616        add_action( 'gp_before_request', array( $this, 'disable_translation_propagation_on_import' ), 10, 2 );
     17        add_action( 'gp_project_created', array( $this, 'update_projects_last_updated' ) );
     18        add_action( 'gp_project_saved', array( $this, 'update_projects_last_updated' ) );
     19    }
     20
     21    /**
     22     * Stores the timestamp of the last update for projects.
     23     *
     24     * Used by the Rosetta Roles plugin to invalidate local caches.
     25     */
     26    public function update_projects_last_updated() {
     27        update_option( 'wporg_projects_last_updated', time() );
    1728    }
    1829
Note: See TracChangeset for help on using the changeset viewer.