芝麻web文件管理V1.00
编辑当前文件:/home/r5772835/public_html/ycreate.jp/wp-content/plugins/optinmonster/OMAPI/WPForms/Save.php
base = OMAPI::get_instance(); } /** * Helper method to handle connecting WPForms to OptinMonster. * * @since 2.9.0 * * @return void */ public function connect() { $this->updateConnection(); } /** * Helper method to handle disconnecting WPForms to OptinMonster. * * @since 2.9.0 * * @return void */ public function disconnect() { $this->updateConnection( false ); } /** * Handles connecting or disconnecting WPForms to OptinMonster. * * @since 2.9.0 * * @return void */ public function updateConnection( $connect = true ) { $creds = $this->base->get_api_credentials(); if ( empty( $creds['apikey'] ) && empty( $creds['user'] ) && empty( $creds['key'] ) ) { return; } // Make a connection request. $action = $connect ? 'connect' : 'disconnect'; $api = new OMAPI_Api( 'wpforms/' . $action, $creds, 'POST', 'v2' ); $response = $api->request( OMAPI_Api::getUrlArgs() ); if ( is_wp_error( $response ) ) { $message = $connect ? esc_html__( 'WPForms could not be connected to OptinMonster. The OptinMonster API returned with the following response: %s', 'optin-monster-api' ) : esc_html__( 'WPForms could not be disconnected from OptinMonster. The OptinMonster API returned with the following response: %s', 'optin-monster-api' ); $this->error = sprintf( $message, $response->get_error_message() ); } } }