Changeset 2277 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/payment-request.php
- Timestamp:
- 01/12/2016 04:36:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/payment-request.php
r2274 r2277 12 12 add_action( 'init', array( __CLASS__, 'register_post_statuses' ) ); 13 13 add_action( 'add_meta_boxes', array( $this, 'init_meta_boxes' ) ); 14 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ), 11 ); 14 15 15 16 // Miscellaneous … … 169 170 add_meta_box( 'wcp_log', __( 'Log', 'wordcamporg' ), array( $this, 'render_log_metabox' ), 170 171 self::POST_TYPE, 'normal', 'high' ); 172 } 173 174 /** 175 * Enqueue scripts and stylesheets 176 */ 177 public function enqueue_assets() { 178 global $post; 179 180 // Register our assets 181 wp_register_script( 182 'payment-requests', 183 plugins_url( 'javascript/payment-requests.js', __DIR__ ), 184 array( 'jquery', 'jquery-ui-datepicker', 'media-upload', 'media-views' ), 185 WordCamp_Budgets::VERSION, 186 true 187 ); 188 189 wp_register_script( 190 'wcp-attached-files', 191 plugins_url( 'javascript/attached-files.js', __DIR__ ), 192 array( 'payment-requests', 'backbone', 'wp-util' ), 193 WordCamp_Budgets::VERSION, 194 true 195 ); 196 197 // Enqueue our assets if they're needed on the current screen 198 $current_screen = get_current_screen(); 199 200 if ( 'wcp_payment_request' !== $current_screen->id ) { 201 return; 202 } 203 204 wp_enqueue_script( 'payment-requests' ); 205 wp_enqueue_style( 'wordcamp-budgets' ); 206 207 if ( isset( $post->ID ) ) { 208 wp_enqueue_media( array( 'post' => $post->ID ) ); 209 wp_enqueue_script( 'wcp-attached-files' ); 210 } 211 212 wp_localize_script( 213 'payment-requests', 214 'wcpLocalizedStrings', // todo merge into paymentRequests var 215 array( 216 'uploadModalTitle' => __( 'Attach Supporting Documentation', 'wordcamporg' ), 217 'uploadModalButton' => __( 'Attach Files', 'wordcamporg' ), 218 ) 219 ); 171 220 } 172 221
Note: See TracChangeset
for help on using the changeset viewer.