Changeset 2083 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/classes/wordcamp-payments.php
- Timestamp:
- 11/16/2015 01:16:20 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/classes/wordcamp-payments.php
r1939 r2083 11 11 */ 12 12 public function __construct() { 13 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );13 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ), 11 ); 14 14 } 15 15 … … 39 39 ); 40 40 41 // Let's still include our .css file even if these are unavailable. 42 $soft_deps = array( 'jquery-ui', 'wp-datepicker-skins' ); 43 foreach ( $soft_deps as $key => $handle ) 44 if ( ! wp_style_is( $handle, 'registered' ) ) 45 unset( $soft_deps[ $key ] ); 46 41 47 wp_register_style( 42 48 'wordcamp-payments', 43 49 plugins_url( 'css/wordcamp-payments.css', __DIR__ ), 44 array( 'jquery-ui', 'wp-datepicker-skins' ),50 $soft_deps, 45 51 self::VERSION 46 52 ); … … 68 74 } 69 75 } 76 77 /** 78 * Log something with a payment request. 79 * 80 * @param int $post_id The payment requset ID. 81 * @param string $message A log message. 82 * @param array $data Optional data. 83 */ 84 public static function log( $post_id, $message, $data = array() ) { 85 global $wpdb; 86 87 $entry = array( 88 'timestamp' => time(), 89 'message' => $message, 90 'data' => $data, 91 ); 92 93 $log = get_post_meta( $post_id, '_wcp_log', true ); 94 if ( empty( $log ) ) 95 $log = '[]'; 96 97 $log = json_decode( $log, true ); 98 $log[] = $entry; 99 $log = json_encode( $log ); 100 101 update_post_meta( $post_id, '_wcp_log', wp_slash( $log ) ); 102 } 70 103 }
Note: See TracChangeset
for help on using the changeset viewer.