Changeset 8934
- Timestamp:
- 08/17/2014 06:11:40 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-classes.php
r8829 r8934 3002 3002 3003 3003 /** 3004 * Redirect location as defined by post-edit save callback. 3005 * 3006 * @since BuddyPress (2.1.0) 3007 * @var string 3008 */ 3009 protected $post_save_redirect; 3010 3011 /** 3004 3012 * Miscellaneous data as set by the __set() magic method. 3005 3013 * … … 3690 3698 3691 3699 $this->check_nonce( 'edit' ); 3700 3701 // Detect whether the screen_save_callback is performing a 3702 // redirect, so that we don't do one of our own 3703 add_filter( 'wp_redirect', array( $this, 'detect_post_save_redirect' ) ); 3704 3705 // Call the extension's save routine 3692 3706 call_user_func( $this->screens['edit']['screen_save_callback'], $this->group_id ); 3707 3708 // Clean up detection filters 3709 remove_filter( 'wp_redirect', array( $this, 'detect_post_save_redirect' ) ); 3710 3711 // Perform a redirect only if one has not already taken place 3712 if ( empty( $this->post_save_redirect ) ) { 3713 $redirect_to = apply_filters( 'bp_group_extension_edit_screen_save_redirect', bp_get_requested_url( ) ); 3714 3715 bp_core_redirect( $redirect_to ); 3716 die(); 3717 } 3693 3718 } 3694 3719 … … 3752 3777 preg_match( $pattern, $screen, $matches ); 3753 3778 return ! empty( $matches[0] ); 3779 } 3780 3781 /** 3782 * Detect redirects hardcoded into edit_screen_save() callbacks. 3783 * 3784 * @since BuddyPress (2.1.0) 3785 * 3786 * @param string $location 3787 * @return string 3788 */ 3789 public function detect_post_save_redirect( $redirect = '' ) { 3790 if ( ! empty( $redirect ) ) { 3791 $this->post_save_redirect = $redirect; 3792 } 3793 3794 return $redirect; 3754 3795 } 3755 3796
Note: See TracChangeset
for help on using the changeset viewer.