Making WordPress.org

Changeset 2741


Ignore:
Timestamp:
03/11/2016 11:25:16 PM (10 years ago)
Author:
iandunn
Message:

WordCamp Participation Notifier: Log errors instead of triggering them.

Triggering them breaks the POST/Redirect/GET process in development environments, because it prints the error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-participation-notifier/wordcamp-participation-notifier.php

    r1798 r2741  
    368368                                );
    369369                        } elseif ( 200 != $response['response']['code'] || 1 != (int) $response['body'] ) {
    370                                 // trigger_error() has a message limit of 1024 bytes, so we truncate $response['body'] to make sure that $body doesn't get truncated.
     370                                // error_log() has a message limit of 1024 bytes, so we truncate $response['body'] to make sure that $body doesn't get truncated.
    371371                               
    372372                                $error = sprintf(
     
    379379                       
    380380                        if ( $error ) {
    381                                 trigger_error( sprintf( '%s error for %s: %s', __METHOD__, parse_url( site_url(), PHP_URL_HOST ), sanitize_text_field( $error ) ), E_USER_WARNING );
     381                                error_log( sprintf( '%s error for %s: %s', __METHOD__, parse_url( site_url(), PHP_URL_HOST ), sanitize_text_field( $error ) ), E_USER_WARNING );
    382382                               
    383383                                if ( $to = apply_filters( 'wpn_error_email_addresses', array() ) ) {
Note: See TracChangeset for help on using the changeset viewer.