Changeset 5735
- Timestamp:
- 08/03/2017 01:11:02 AM (7 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php
r5575 r5735 214 214 wp_enqueue_style( 'wp-datepicker-skins' ); 215 215 } 216 217 // Enqueues scripts and styles for sponsors admin page 218 if ( 'wcb_sponsor' == $post_type ) { 219 wp_enqueue_script( 220 'wcb-spon', // Avoid "sponsor" since that's a trigger word for ad blockers. 221 plugins_url( 'js/wcb-spon.js', __FILE__ ), 222 array( 'jquery', 'backbone', 'media-views' ), 223 1, 224 true 225 ); 226 227 wp_localize_script( 228 'wcb-spon', 229 'wcbSponsors', 230 array( 231 'l10n' => array( 232 'modalTitle' => __( 'Sponsor Agreement', 'wordcamporg' ), 233 ), 234 'modal' => array( 235 'allowedTypes' => array( 'image', 'application/pdf' ) 236 ), 237 ) 238 ); 239 } 216 240 } 217 241 … … 1417 1441 */ 1418 1442 function add_meta_boxes() { 1419 add_meta_box( 'speaker-info', __( 'Speaker Info', 'wordcamporg' ), array( $this, 'metabox_speaker_info' ), 'wcb_speaker', 'side' ); 1420 add_meta_box( 'organizer-info', __( 'Organizer Info', 'wordcamporg' ), array( $this, 'metabox_organizer_info' ), 'wcb_organizer', 'side' ); 1421 add_meta_box( 'speakers-list', __( 'Speakers', 'wordcamporg' ), array( $this, 'metabox_speakers_list' ), 'wcb_session', 'side' ); 1422 add_meta_box( 'session-info', __( 'Session Info', 'wordcamporg' ), array( $this, 'metabox_session_info' ), 'wcb_session', 'normal' ); 1423 add_meta_box( 'sponsor-info', __( 'Sponsor Info', 'wordcamporg' ), array( $this, 'metabox_sponsor_info' ), 'wcb_sponsor', 'normal' ); 1424 add_meta_box( 'invoice-sponsor', __( 'Invoice Sponsor', 'wordcamporg' ), array( $this, 'metabox_invoice_sponsor' ), 'wcb_sponsor', 'side' ); 1443 add_meta_box( 'speaker-info', __( 'Speaker Info', 'wordcamporg' ), array( $this, 'metabox_speaker_info' ), 'wcb_speaker', 'side' ); 1444 add_meta_box( 'organizer-info', __( 'Organizer Info', 'wordcamporg' ), array( $this, 'metabox_organizer_info' ), 'wcb_organizer', 'side' ); 1445 add_meta_box( 'speakers-list', __( 'Speakers', 'wordcamporg' ), array( $this, 'metabox_speakers_list' ), 'wcb_session', 'side' ); 1446 add_meta_box( 'session-info', __( 'Session Info', 'wordcamporg' ), array( $this, 'metabox_session_info' ), 'wcb_session', 'normal' ); 1447 add_meta_box( 'sponsor-info', __( 'Sponsor Info', 'wordcamporg' ), array( $this, 'metabox_sponsor_info' ), 'wcb_sponsor', 'normal' ); 1448 1449 // Enable on 2017.testing only for testing purposes. 1450 if ( ! defined( 'WORDCAMP_ENVIRONMENT' ) || 'development' === WORDCAMP_ENVIRONMENT || 829 === get_current_blog_id() ) { 1451 add_meta_box( 'sponsor-agreement', __( 'Sponsor Agreement', 'wordcamporg' ), array( $this, 'metabox_sponsor_agreement' ), 'wcb_sponsor', 'side' ); 1452 } 1453 1454 add_meta_box( 'invoice-sponsor', __( 'Invoice Sponsor', 'wordcamporg' ), array( $this, 'metabox_invoice_sponsor' ), 'wcb_sponsor', 'side' ); 1425 1455 } 1426 1456 … … 1657 1687 1658 1688 /** 1689 * Render the Sponsor Agreement metabox view. 1690 * 1691 * @param WP_Post $sponsor 1692 */ 1693 function metabox_sponsor_agreement( $sponsor ) { 1694 $agreement_id = get_post_meta( $sponsor->ID, '_wcpt_sponsor_agreement', true ); 1695 $agreement_url = wp_get_attachment_url( $agreement_id ); 1696 1697 require_once( __DIR__ . '/views/sponsors/metabox-sponsor-agreement.php' ); 1698 } 1699 1700 /** 1659 1701 * Render the Invoice Sponsor metabox view 1660 1702 * … … 1859 1901 $values['first_name'] = ucfirst( $values['first_name'] ); 1860 1902 $values['last_name' ] = ucfirst( $values['last_name' ] ); 1903 1904 $values['agreement'] = filter_input( INPUT_POST, '_wcpt_sponsor_agreement', FILTER_SANITIZE_NUMBER_INT ); 1861 1905 1862 1906 foreach( $values as $id => $value ) {
Note: See TracChangeset
for help on using the changeset viewer.