Making WordPress.org


Ignore:
Timestamp:
02/22/2016 07:37:47 PM (9 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/translate.wordpress.org/includes/gp-plugins/wporg-specifics.php

    r2167 r2543  
    1414        $this->add_filter( 'projects', array( 'args' => 2 ) );
    1515        $this->add_action( 'before_request', array( 'args' => 2 ) );
     16        $this->add_action( 'project_created' );
     17        $this->add_action( 'project_saved' );
     18    }
     19
     20    function project_created() {
     21        $this->update_projects_last_updated();
     22    }
     23
     24    function project_saved() {
     25        $this->update_projects_last_updated();
     26    }
     27
     28    /**
     29     * Stores the timestamp of the last update for projects.
     30     *
     31     * Used by the Rosetta Roles plugin to invalidate local caches.
     32     */
     33    function update_projects_last_updated() {
     34        gp_update_option( 'wporg_projects_last_updated', time() );
    1635    }
    1736
Note: See TracChangeset for help on using the changeset viewer.