Changeset 2964
- Timestamp:
- 04/15/2016 02:07:39 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php
r2963 r2964 106 106 $path = isset( $url_components['path'] ) ? $url_components['path'] : ''; 107 107 108 $wordcamp = get_post( $wordcamp_id ); 108 109 $wordcamp_meta = get_post_custom( $wordcamp_id ); 109 110 $lead_organizer = $this->get_user_or_current_user( $wordcamp_meta['WordPress.org Username'][0] ); … … 114 115 update_post_meta( $wordcamp_id, '_site_id', $this->new_site_id ); // this is used in other plugins to map the `wordcamp` post to it's corresponding site 115 116 do_action( 'wcor_wordcamp_site_created', $wordcamp_id ); 116 117 // Configure the new site at priority 11, after all the custom fields on the `wordcamp` post have been saved, so that we don't use outdated values118 add_action( 'save_post', array( $this, 'configure_new_site' ), 11, 2 );119 117 120 118 add_post_meta( $wordcamp_id, '_note', array( … … 123 121 'message' => sprintf( 'Created site at <a href="%s">%s</a>', $url, $url ), 124 122 ) ); 123 124 $this->configure_new_site( $wordcamp_id, $wordcamp ); 125 125 } 126 126 } … … 148 148 * @todo Can probably just network-activate plugins instead, but need to test that they work fine in network-activated mode. 149 149 * 150 * @action save_post151 *152 150 * @param int $wordcamp_id 153 151 * @param WP_Post $wordcamp 154 152 */ 155 p ublicfunction configure_new_site( $wordcamp_id, $wordcamp ) {153 protected function configure_new_site( $wordcamp_id, $wordcamp ) { 156 154 if ( ! defined( 'WCPT_POST_TYPE_ID' ) || WCPT_POST_TYPE_ID != $wordcamp->post_type || ! is_numeric( $this->new_site_id ) ) { 157 155 return;
Note: See TracChangeset
for help on using the changeset viewer.