Making WordPress.org

Ticket #1101: 1101.2.patch

File 1101.2.patch, 804 bytes (added by ocean90, 7 years ago)
  • wporg-rosetta-roles.php

     
    4040        public function __construct() {
    4141                parent::__construct();
    4242                $this->add_filter( 'pre_can_user', array( 'args' => 2, 'priority' => 9 ) );
     43                $this->add_action( 'project_created' );
     44                $this->add_action( 'project_saved' );
    4345        }
    4446
    4547        /**
     
    347349        }
    348350
    349351        /**
     352         * Removes all of the project ids from the cache.
     353         *
     354         */
     355        public function clear_project_cache() {
     356                $projects = $this->get_all_projects();
     357
     358                foreach ( $projects as $project ) {
     359                        $cache_key = 'project:' . $project->id . ':childs';
     360                        wp_cache_delete( $cache_key, $this->cache_group );
     361                }
     362        }
     363
     364        /**
    350365         * Extracts project ID and locale slug from object type and ID.
    351366         *
    352367         * @param string $object_type Current object type.