BP_BuddyBoss_Platform_Updater::update_plugin( $transient )
Description
Source
File: bp-core/classes/class-bp-buddyboss-platform-updater.php
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | function update_plugin( $transient ) { if ( empty ( $transient ->checked ) || empty ( $transient ->checked[ $this ->plugin_path ] ) ) { return $transient ; } $request_data = array ( 'id' => $this ->plugin_id, 'slug' => $this ->plugin_slug, 'version' => $transient ->checked[ $this ->plugin_path ] ); if ( ! empty ( $this ->license ) ) { $request_data [ 'license' ] = $this ->license; } $request_string = $this ->request_call( 'update_check' , $request_data ); $raw_response = wp_remote_post( $this ->api_url, $request_string ); $response = null; if ( ! is_wp_error( $raw_response ) && ( $raw_response [ 'response' ][ 'code' ] == 200 ) ) { $response = unserialize( $raw_response [ 'body' ] ); } //Feed the candy if ( is_object ( $response ) && ! empty ( $response ) ) { $transient ->response[ $this ->plugin_path ] = $response ; return $transient ; } // If there is any same plugin from wordpress.org repository then unset it. if ( isset( $transient ->response[ $this ->plugin_path ] ) ) { if ( strpos ( $transient ->response[ $this ->plugin_path ]->package, 'wordpress.org' ) !== false ) { unset( $transient ->response[ $this ->plugin_path ] ); } } return $transient ; } |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.