Changeset 10866
- Timestamp:
- 04/01/2021 09:01:06 PM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn
- Files:
-
- 4 edited
-
inc/post-meta.php (modified) (2 diffs)
-
inc/post-type.php (modified) (3 diffs)
-
views/content-workshop.php (modified) (1 diff)
-
views/metabox-workshop-details.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-meta.php
r10461 r10866 66 66 function register_workshop_meta() { 67 67 $post_type = 'wporg_workshop'; 68 69 register_post_meta( 70 $post_type, 71 'video_url', 72 array( 73 'description' => __( "The URL of the Workshop's video.", 'wporg_learn' ), 74 'type' => 'string', 75 'single' => true, 76 'sanitize_callback' => 'esc_url_raw', 77 'show_in_rest' => true, 78 ) 79 ); 68 80 69 81 register_post_meta( … … 377 389 } 378 390 391 $video_url = filter_input( INPUT_POST, 'video-url', FILTER_SANITIZE_URL ); 392 update_post_meta( $post_id, 'video_url', $video_url ); 393 379 394 $duration = filter_input( INPUT_POST, 'duration', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY ); 380 395 if ( isset( $duration['h'], $duration['m'], $duration['s'] ) ) { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-type.php
r10422 r10866 138 138 'capability_type' => 'page', 139 139 'show_in_rest' => true, 140 'template_lock' => 'all',141 140 'rewrite' => array( 'slug' => 'workshop' ), 142 141 'template' => generate_workshop_template_structure(), … … 149 148 * Create an array representation of a workshop's content template. 150 149 * 151 * Note that if this template structure changes, the content in views/content-workshop.php150 * ⚠️ Note that if this template structure changes, the content in views/content-workshop.php 152 151 * will also need to be updated. 153 152 * … … 157 156 $template = array( 158 157 array( 159 'core/embed', 160 array( 161 'className' => 'workshop-page_video', 162 'providerNameSlug' => 'wordpress-tv', 163 ), 164 ), 165 array( 166 'core/columns', 167 array( 'className' => 'workshop-page_content' ), 168 array( 169 array( 170 'core/column', 171 array( 'width' => '66.66%' ), 172 array( 173 array( 174 'core/paragraph', 175 array( 176 'placeholder' => __( 'Describe what the workshop is about.', 'wporg-learn' ), 177 ), 178 ), 179 array( 180 'core/heading', 181 array( 182 'level' => '2', 183 'content' => __( 'Learning outcomes', 'wporg-learn' ), 184 ), 185 ), 186 array( 187 'core/list', 188 array( 189 'className' => 'workshop-page_list', 190 'ordered' => true, 191 ), 192 ), 193 array( 194 'core/heading', 195 array( 196 'level' => '2', 197 'content' => __( 'Comprehension questions', 'wporg-learn' ), 198 ), 199 ), 200 array( 201 'core/list', 202 array( 203 'className' => 'workshop-page_list', 204 ), 205 ), 206 ), 207 ), // End column block. 208 array( 209 'core/column', 210 array( 211 'className' => 'workshop-page_sidebar', 212 'width' => '33.333%', 213 ), 214 array( 215 array( 'wporg-learn/workshop-details' ), 216 array( 217 'core/button', 218 array( 219 'className' => 'is-style-secondary-full-width', 220 'text' => __( 'Join a Group Discussion', 'wporg-learn' ), 221 'url' => 'https://www.meetup.com/learn-wordpress-discussions/events/', 222 'borderRadius' => 5, 223 ), 224 ), 225 array( 226 'core/paragraph', 227 array( 228 'className' => 'terms', 229 'content' => sprintf( 230 __( 'You must agree to our <a href="%s">Code of Conduct</a> in order to participate.', 'wporg-learn' ), 231 'https://learn.wordpress.org/code-of-conduct/' 232 ), 233 ), 234 ), 235 ), 236 ), // End column block. 237 ), 238 ), // End columns block. 239 array( 'core/separator' ), 158 'core/paragraph', 159 array( 160 'placeholder' => __( 'Describe what the workshop is about.', 'wporg-learn' ), 161 ), 162 ), 163 164 // Learning outcomes 165 array( 166 'core/heading', 167 array( 168 'level' => '2', 169 'content' => __( 'Learning outcomes', 'wporg-learn' ), 170 ), 171 ), 172 array( 173 'core/list', 174 array( 175 'className' => 'workshop-page_list', 176 'ordered' => true, 177 ), 178 ), 179 180 // Comprehension questions 181 array( 182 'core/heading', 183 array( 184 'level' => '2', 185 'content' => __( 'Comprehension questions', 'wporg-learn' ), 186 ), 187 ), 188 array( 189 'core/list', 190 array( 191 'className' => 'workshop-page_list', 192 ), 193 ), 240 194 ); 241 195 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/content-workshop.php
r10376 r10866 1 1 <?php 2 2 3 /** 3 4 * Content for auto-generated workshop posts. 4 5 * 5 * Note that if the template for the workshop post type changes, this will need to be updated as well. 6 * ⚠️ Note that if the template for the workshop post type changes, this will need to be updated as well. 7 * 8 * phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped -- The data from this file is being saved to 9 * the database rather than output; therefore it should be validated rather than escaped. It's validated by 10 * `validate_workshop_application_form_submission()`, which strips all HTML tags. 6 11 */ 7 12 8 13 /** @var array $blurbs */ 14 9 15 ?> 10 <!-- wp:core-embed/wordpress-tv {"className":"workshop-page_video"} /-->11 16 12 <!-- wp:columns {"className":"workshop-page_content"} --> 13 <div class="wp-block-columns workshop-page_content"> 14 <!-- wp:column {"width":66.66} --> 15 <div class="wp-block-column" style="flex-basis:66.66%"> 16 <?php echo $blurbs['description']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> 17 <?php echo $blurbs['description']; ?> 17 18 18 <!-- wp:heading {"level":"2"} -->19 <h2><?php esc_html_e( 'Learning outcomes', 'wporg-learn' ); ?></h2>20 <!-- /wp:heading -->19 <!-- wp:heading {"level":"2"} --> 20 <h2><?php esc_html_e( 'Learning outcomes', 'wporg-learn' ); ?></h2> 21 <!-- /wp:heading --> 21 22 22 <!-- wp:list {"ordered":true,"className":"workshop-page_list"} -->23 <ol class="workshop-page_list">24 <?php echo $blurbs['learning-objectives']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>25 </ol>26 <!-- /wp:list -->23 <!-- wp:list {"ordered":true,"className":"workshop-page_list"} --> 24 <ol class="workshop-page_list"> 25 <?php echo $blurbs['learning-objectives']; ?> 26 </ol> 27 <!-- /wp:list --> 27 28 28 <!-- wp:heading {"level":"2"} -->29 <h2><?php esc_html_e( 'Comprehension questions', 'wporg-learn' ); ?></h2>30 <!-- /wp:heading -->29 <!-- wp:heading {"level":"2"} --> 30 <h2><?php esc_html_e( 'Comprehension questions', 'wporg-learn' ); ?></h2> 31 <!-- /wp:heading --> 31 32 32 <!-- wp:list {"className":"workshop-page_list"} --> 33 <ul class="workshop-page_list"> 34 <?php echo $blurbs['comprehension-questions']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> 35 </ul> 36 <!-- /wp:list --> 37 </div> 38 <!-- /wp:column --> 39 40 <!-- wp:column {"width":33.333,"className":"workshop-page_sidebar"} --> 41 <div class="wp-block-column workshop-page_sidebar" style="flex-basis:33.333%"> 42 <!-- wp:wporg-learn/workshop-details /--> 43 44 <!-- wp:button {"borderRadius":5,"className":"is-style-secondary-full-width"} --> 45 <div class="wp-block-button is-style-secondary-full-width"> 46 <a class="wp-block-button__link" href="https://www.meetup.com/learn-wordpress-discussions/events/" style="border-radius:5px"> 47 <?php esc_html_e( 'Join a Group Discussion', 'wporg-learn' ); ?> 48 </a> 49 </div> 50 <!-- /wp:button --> 51 52 <!-- wp:paragraph {"className":"terms"} --> 53 <p class="terms"> 54 <?php 55 printf( 56 wp_kses_post( __( 'You must agree to our <a href="%s">Code of Conduct</a> in order to participate.', 'wporg-learn' ) ), 57 'https://learn.wordpress.org/code-of-conduct/' 58 ); 59 ?> 60 </p> 61 <!-- /wp:paragraph --> 62 </div> 63 <!-- /wp:column --> 64 </div> 65 <!-- /wp:columns --> 66 67 <!-- wp:separator --> 68 <hr class="wp-block-separator"/> 69 <!-- /wp:separator --> 33 <!-- wp:list {"className":"workshop-page_list"} --> 34 <ul class="workshop-page_list"> 35 <?php echo $blurbs['comprehension-questions']; ?> 36 </ul> 37 <!-- /wp:list --> -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/metabox-workshop-details.php
r10461 r10866 13 13 14 14 <p> 15 <label><?php esc_html_e( 'WordPress.tv URL', 'wporg_learn' ); ?></label><br /> 16 <label for="workshop-video-url"> 17 <textarea 18 id="workshop-video-url" 19 name="video-url" 20 class="large-text" 21 rows="4" 22 ><?php echo esc_url( $post->video_url ); ?></textarea> 23 </label> 24 </p> 25 26 <p> 15 27 <label><?php esc_html_e( 'Duration', 'wporg_learn' ); ?></label><br /> 16 28 <label for="workshop-duration-hours"> … … 21 33 type="number" 22 34 value="<?php echo absint( $duration_interval->h ); ?>" 35 min="0" 23 36 max="23" 24 37 /> … … 32 45 type="number" 33 46 value="<?php echo absint( $duration_interval->i ); ?>" 47 min="0" 34 48 max="59" 35 49 /> … … 43 57 type="number" 44 58 value="<?php echo absint( $duration_interval->s ); ?>" 59 min="0" 45 60 max="59" 46 61 />
Note: See TracChangeset
for help on using the changeset viewer.