$data ) { /* check for option then update if necessary */ if ( !get_option( $key ) ) { add_option( $key, $data ); } } } function epl_deactivate() { update_option( 'events_planner_active', 0 ); } function epl_log( $log= '', $message = '' ) { return; $process = array( 'init', 'debug', 'clear' ); if ( !in_array( $log, $process ) ) return; $log_file = WP_PLUGIN_DIR . "/log.txt"; if ( !file_exists( $log_file ) ) return; if ( $log == 'clear' ) file_put_contents( $log_file, '' ); static $flags = FILE_APPEND; //first call clears the file $new_call = "\r\n"; $_bt = ''; /* $trace = debug_backtrace(); if ( isset( $trace[1] ) ) { $_bt = " \t\t called by {$trace[1]['class']} :: {$trace[1]['function']}, line {$trace[1]['line']}, file {$trace[1]['file']}"; } */ //$message = $new_call . date( "m/d/Y H:i:s" ) . ' > ' . $message . $_bt . "\r\n"; $message = $new_call . $message . $_bt . "\r\n"; file_put_contents( $log_file, $new_call . $message, $flags ); }