SimpleCalendarUpdatesUpdate_V210

Update to 2.1.0.

Defined (1)

The class is defined in the following location(s).

/includes/updates/update-v210.php  
  1. class Update_V210 { 
  2.  
  3. /** 
  4. * Update feed url meta in feed posts. 
  5. * @param array $posts 
  6. */ 
  7. public function __construct( $posts ) { 
  8.  
  9. if ( ! empty( $posts ) && is_array( $posts ) ) { 
  10.  
  11. foreach ( $posts as $post ) { 
  12.  
  13. $url = get_post_meta( $post->ID, 'gce_feed_url', true ); 
  14.  
  15. if ( $url ) { 
  16.  
  17. $url = str_replace( 'https://www.google.com/calendar/feeds/', '', $url ); 
  18. $url = str_replace( '/public/basic', '', $url ); 
  19. $url = str_replace( '%40', '@', $url ); 
  20.  
  21. update_post_meta( $post->ID, 'gce_feed_url', $url ); 
  22.  
  23.  
  24.