-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workshops: Move layout elements from
post_content
to theme.
Having them in `post_content` means that we have to manually update all existing posts every time we change the layout.
- Loading branch information
Showing
7 changed files
with
189 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 24 additions & 56 deletions
80
wp-content/plugins/wporg-learn/views/content-workshop.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,37 @@ | ||
<?php | ||
|
||
/** | ||
* Content for auto-generated workshop posts. | ||
* | ||
* Note that if the template for the workshop post type changes, this will need to be updated as well. | ||
* ⚠️ Note that if the template for the workshop post type changes, this will need to be updated as well. | ||
* | ||
* phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped -- The data from this file is being saved to | ||
* the database rather than output; therefore it should be validated rather than escaped. It's validated by | ||
* `validate_workshop_application_form_submission()`, which strips all HTML tags. | ||
*/ | ||
|
||
/** @var array $blurbs */ | ||
?> | ||
<!-- wp:core-embed/wordpress-tv {"className":"workshop-page_video"} /--> | ||
|
||
<!-- wp:columns {"className":"workshop-page_content"} --> | ||
<div class="wp-block-columns workshop-page_content"> | ||
<!-- wp:column {"width":66.66} --> | ||
<div class="wp-block-column" style="flex-basis:66.66%"> | ||
<?php echo $blurbs['description']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> | ||
|
||
<!-- wp:heading {"level":"2"} --> | ||
<h2><?php esc_html_e( 'Learning outcomes', 'wporg-learn' ); ?></h2> | ||
<!-- /wp:heading --> | ||
|
||
<!-- wp:list {"ordered":true,"className":"workshop-page_list"} --> | ||
<ol class="workshop-page_list"> | ||
<?php echo $blurbs['learning-objectives']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> | ||
</ol> | ||
<!-- /wp:list --> | ||
|
||
<!-- wp:heading {"level":"2"} --> | ||
<h2><?php esc_html_e( 'Comprehension questions', 'wporg-learn' ); ?></h2> | ||
<!-- /wp:heading --> | ||
?> | ||
|
||
<!-- wp:list {"className":"workshop-page_list"} --> | ||
<ul class="workshop-page_list"> | ||
<?php echo $blurbs['comprehension-questions']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> | ||
</ul> | ||
<!-- /wp:list --> | ||
</div> | ||
<!-- /wp:column --> | ||
<?php echo $blurbs['description']; ?> | ||
|
||
<!-- wp:column {"width":33.333,"className":"workshop-page_sidebar"} --> | ||
<div class="wp-block-column workshop-page_sidebar" style="flex-basis:33.333%"> | ||
<!-- wp:wporg-learn/workshop-details /--> | ||
<!-- wp:heading {"level":"2"} --> | ||
<h2><?php esc_html_e( 'Learning outcomes', 'wporg-learn' ); ?></h2> | ||
<!-- /wp:heading --> | ||
|
||
<!-- wp:button {"borderRadius":5,"className":"is-style-secondary-full-width"} --> | ||
<div class="wp-block-button is-style-secondary-full-width"> | ||
<a class="wp-block-button__link" href="https://www.meetup.com/learn-wordpress-discussions/events/" style="border-radius:5px"> | ||
<?php esc_html_e( 'Join a Group Discussion', 'wporg-learn' ); ?> | ||
</a> | ||
</div> | ||
<!-- /wp:button --> | ||
<!-- wp:list {"ordered":true,"className":"workshop-page_list"} --> | ||
<ol class="workshop-page_list"> | ||
<?php echo $blurbs['learning-objectives']; ?> | ||
</ol> | ||
<!-- /wp:list --> | ||
|
||
<!-- wp:paragraph {"className":"terms"} --> | ||
<p class="terms"> | ||
<?php | ||
printf( | ||
wp_kses_post( __( 'You must agree to our <a href="%s">Code of Conduct</a> in order to participate.', 'wporg-learn' ) ), | ||
'https://learn.wordpress.org/code-of-conduct/' | ||
); | ||
?> | ||
</p> | ||
<!-- /wp:paragraph --> | ||
</div> | ||
<!-- /wp:column --> | ||
</div> | ||
<!-- /wp:columns --> | ||
<!-- wp:heading {"level":"2"} --> | ||
<h2><?php esc_html_e( 'Comprehension questions', 'wporg-learn' ); ?></h2> | ||
<!-- /wp:heading --> | ||
|
||
<!-- wp:separator --> | ||
<hr class="wp-block-separator"/> | ||
<!-- /wp:separator --> | ||
<!-- wp:list {"className":"workshop-page_list"} --> | ||
<ul class="workshop-page_list"> | ||
<?php echo $blurbs['comprehension-questions']; ?> | ||
</ul> | ||
<!-- /wp:list --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
wp-content/themes/pub/wporg-learn-2020/template-parts/content-workshop-single-hardcoded.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/* | ||
* This deprecated template is for old posts that have Column/Embed/etc blocks hardcoded into `post_content`. | ||
* See `single-wporg_workshop.php`. | ||
*/ | ||
|
||
?> | ||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | ||
<section> | ||
<div class="row align-middle between section-heading section-heading--with-space"> | ||
<h1 class="section-heading_title h2"><?php the_title(); ?></h1> | ||
</div> | ||
<hr> | ||
<div class="workshop-page"> | ||
<?php the_content(); ?> | ||
<?php if ( is_object_in_term( get_the_ID(), 'wporg_workshop_series' ) ) : ?> | ||
<?php get_template_part( 'template-parts/component', 'series-navigation' ); ?> | ||
<hr class="wp-block-separator" /> | ||
<?php endif; ?> | ||
<?php foreach ( wporg_get_workshop_presenters() as $presenter ) : ?> | ||
<section class="row workshop-page_section""> | ||
<div class="col-4"> | ||
<?php | ||
get_template_part( | ||
'template-parts/component', | ||
'workshop-presenter', | ||
array( | ||
'presenter' => $presenter, | ||
) | ||
); | ||
?> | ||
</div> | ||
<div class="col-8 workshop-page_biography"> | ||
<?php echo wp_kses_data( wpautop( wporg_get_workshop_presenter_bio( $presenter ) ) ); ?> | ||
</div> | ||
</section> | ||
<?php endforeach; ?> | ||
</div> | ||
</section> | ||
</article> |
Oops, something went wrong.