Changeset 7693
- Timestamp:
- 09/21/2018 10:15:11 PM (7 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-loader.php
r7685 r7693 17 17 add_action( 'plugins_loaded', array( $this, 'includes' ) ); 18 18 add_action( 'init', array( $this, 'register_post_types' ) ); 19 add_action( 'init', array( $this, 'register_post_capabilities' ) );20 19 add_action( 'init', array( $this, 'register_post_statuses' ) ); 21 20 add_filter( 'pre_get_posts', array( $this, 'query_public_statuses_on_archives' ) ); … … 36 35 */ 37 36 abstract protected function register_post_types(); 38 39 /**40 * Add capabilities to roles for post type.41 *42 * @return void43 */44 abstract protected function register_post_capabilities();45 37 46 38 /** -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-meetup/meetup-loader.php
r7690 r7693 165 165 166 166 /** 167 * Allow some site roles to see WordCamp posts.168 */169 public function register_post_capabilities() {170 $roles = array(171 'contributor',172 'author',173 'editor',174 'administrator',175 );176 177 foreach ( $roles as $role ) {178 get_role( $role )->add_cap( 'edit_' . Meetup_Application::POST_TYPE . 's' );179 }180 }181 182 /**183 167 * Get available post statuses 184 168 * -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php
r7607 r7693 30 30 add_filter( 'rest_wordcamp_collection_params', array( $this, 'set_rest_post_status_default' ) ); 31 31 add_action( 'rest_api_init', array( $this, 'register_rest_public_fields' ) ); 32 add_action( 'init', array( $this, 'register_post_capabilities' ) ); 32 33 } 33 34
Note: See TracChangeset
for help on using the changeset viewer.