Making WordPress.org

Changeset 10461


Ignore:
Timestamp:
11/23/2020 09:41:51 PM (4 years ago)
Author:
coreymckrill
Message:

WordPress.org Learn: Sync with GitHub

https://github.com/WordPress/learn/compare/2c9bbc5fc4eefb1f1a367f7bb8afcd3da6ef32b0...886286a12b9802be8d34715149f55ddf67832432

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn
Files:
1 added
2 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/form.asset.php

    r10376 r10461  
    1 <?php return array('dependencies' => array('wp-polyfill'), 'version' => '38da75eb1a45e1fba684aeff828c3f40');
     1<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'a91213ce3ddb75c89e6d6c03d7344afc');
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/form.js

    r10376 r10461  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}({8:function(e,t){var r,n,o=window.jQuery||{};r=o,n=document.querySelectorAll(".checkbox-and-text"),Array.from(n).forEach((function(e){var t=e.querySelector('input[type="checkbox"]'),r=e.querySelector('input[type="text"]');r.addEventListener("input",(function(e){return t.checked=!!e.target.value})),t.addEventListener("change",(function(e){e.target.checked?r.focus():r.value=""}))})),r(".do-select2").select2({dropdownParent:r(".wporg-learn-workshop-application-form")})}});
     1!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}({7:function(e,t){var r,n,o=window.jQuery||{};r=o,n=document.querySelectorAll(".checkbox-and-text"),Array.from(n).forEach((function(e){var t=e.querySelector('input[type="checkbox"]'),r=e.querySelector('input[type="text"]');r.addEventListener("input",(function(e){return t.checked=!!e.target.value})),t.addEventListener("change",(function(e){e.target.checked?r.focus():r.value=""}))})),r(".do-select2").select2({dropdownParent:r(".wporg-learn-workshop-application-form")})}});
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/style-block-styles.css

    r10169 r10461  
    1 .is-style-primary .wp-block-button__link,.is-style-primary .wp-block-button__link:visited,.is-style-primary-full-width .wp-block-button__link,.is-style-primary-full-width .wp-block-button__link:visited,.is-style-secondary .wp-block-button__link,.is-style-secondary .wp-block-button__link:visited,.is-style-secondary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link:visited{background:#0085ba;color:#fff;text-align:center;font-size:13px;font-weight:600;padding:0.9rem;margin:32px 0}.is-style-secondary .wp-block-button__link,.is-style-secondary .wp-block-button__link:visited,.is-style-secondary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link:visited{background:#f8f9f9;color:#555;border:1px solid #d9dcdf;box-shadow:0 1px 0 #d9dcdf}.is-style-primary-full-width,.is-style-secondary-full-width{width:100%}.is-style-primary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link{width:100%}
     1.is-style-primary .wp-block-button__link,.is-style-primary .wp-block-button__link:visited,.is-style-primary-full-width .wp-block-button__link,.is-style-primary-full-width .wp-block-button__link:visited,.is-style-secondary .wp-block-button__link,.is-style-secondary .wp-block-button__link:visited,.is-style-secondary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link:visited{text-align:center;font-size:13px;font-weight:600;text-decoration:none;padding:0.9rem;margin:0 0 32px;background:#0085ba;color:#fff;border:1px solid #006799;box-shadow:0 1px 0 #006799}.is-style-primary .wp-block-button__link:hover,.is-style-primary-full-width .wp-block-button__link:hover,.is-style-secondary .wp-block-button__link:hover,.is-style-secondary-full-width .wp-block-button__link:hover{background:#008ec2}.is-style-secondary .wp-block-button__link,.is-style-secondary .wp-block-button__link:visited,.is-style-secondary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link:visited{background:#f7f7f7;color:#555;border:1px solid #ccc;box-shadow:0 1px 0 #ccc}.is-style-secondary .wp-block-button__link:hover,.is-style-secondary-full-width .wp-block-button__link:hover{background:#fafafa;color:#23282d;border:1px solid #999;box-shadow:0 1px 0 #999}.is-style-primary-full-width,.is-style-secondary-full-width{width:100%}.is-style-primary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link{width:100%}
    22
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/style-workshop-details.css

    r10169 r10461  
    1 .wp-block-wporg-learn-workshop-details{list-style:none;margin:0;padding:0;color:#555d66}.wp-block-wporg-learn-workshop-details li{display:flex;justify-content:space-between;padding:8px 0;border-top:1px solid #e2e4e7}.wp-block-wporg-learn-workshop-details li:last-child{border-bottom:1px solid #e2e4e7}.wp-block-wporg-learn-workshop-details li>span{text-align:right;flex-basis:50%;word-break:normal}
     1.wp-block-wporg-learn-workshop-details{margin:0 0 32px}.wp-block-wporg-learn-workshop-details .workshop-details-list{list-style:none;margin:0;padding:0;color:#555d66}.wp-block-wporg-learn-workshop-details .workshop-details-list li{display:flex;justify-content:space-between;padding:8px 0;border-top:1px solid #e2e4e7}.wp-block-wporg-learn-workshop-details .workshop-details-list li:last-child{border-bottom:1px solid #e2e4e7}.wp-block-wporg-learn-workshop-details .workshop-details-list li>span{text-align:right;flex-basis:50%;word-break:normal}.wp-block-wporg-learn-workshop-details .is-style-primary-full-width .wp-block-button__link,.wp-block-wporg-learn-workshop-details .is-style-primary-full-width .wp-block-button__link:visited,.wp-block-wporg-learn-workshop-details .is-style-secondary-full-width .wp-block-button__link,.wp-block-wporg-learn-workshop-details .is-style-secondary-full-width .wp-block-button__link:visited{margin:32px 0 0}
    22
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/workshop-application-form.asset.php

    r10376 r10461  
    1 <?php return array('dependencies' => array('wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '964ac1275181d5d961676253bd2b5e77');
     1<?php return array('dependencies' => array('wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '92e10fd1977401e28400b00c499bc7b6');
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/workshop-application-form.js

    r10376 r10461  
    1 !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.components}()},,,,,,function(e,t,n){"use strict";n.r(t);var r=n(1),o=n(0),i=n(2),c=n(3);Object(r.registerBlockType)("wporg-learn/workshop-application-form",{title:Object(o.__)("Workshop Application Form","wporg-learn"),description:Object(o.__)("Render a form for applying to present a workshop.","wporg-learn"),category:"widgets",icon:"forms",supports:{html:!1},edit:function(){return Object(i.createElement)(c.Placeholder,{label:Object(o.__)("Workshop Application Form","wporg-learn"),instructions:Object(o.__)("This will render a form on the front end.","wporg-learn")})},save:function(){return null}})}]);
     1!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.components}()},,,,,function(e,t,n){"use strict";n.r(t);var r=n(1),o=n(0),i=n(2),c=n(3);Object(r.registerBlockType)("wporg-learn/workshop-application-form",{title:Object(o.__)("Workshop Application Form","wporg-learn"),description:Object(o.__)("Render a form for applying to present a workshop.","wporg-learn"),category:"widgets",icon:"forms",supports:{html:!1},edit:function(){return Object(i.createElement)(c.Placeholder,{label:Object(o.__)("Workshop Application Form","wporg-learn"),instructions:Object(o.__)("This will render a form on the front end.","wporg-learn")})},save:function(){return null}})}]);
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/workshop-details.asset.php

    r10376 r10461  
    1 <?php return array('dependencies' => array('wp-blocks', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '176b71733a002b7dac08abaf7c214ae1');
     1<?php return array('dependencies' => array('wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'df4925d2bca7070e99b014934f02be79');
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/workshop-details.js

    r10376 r10461  
    1 (window.wporgLearnPlugin=window.wporgLearnPlugin||[]).push([[3],{6:function(e,t,n){}}]),function(e){function t(t){for(var r,i,u=t[0],a=t[1],c=t[2],s=0,f=[];s<u.length;s++)i=u[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&f.push(o[i][0]),o[i]=0;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);for(p&&p(t);f.length;)f.shift()();return l.push.apply(l,c||[]),n()}function n(){for(var e,t=0;t<l.length;t++){for(var n=l[t],r=!0,u=1;u<n.length;u++){var a=n[u];0!==o[a]&&(r=!1)}r&&(l.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},o={5:0},l=[];function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var u=window.wporgLearnPlugin=window.wporgLearnPlugin||[],a=u.push.bind(u);u.push=t,u=u.slice();for(var c=0;c<u.length;c++)t(u[c]);var p=a;l.push([10,3]),n()}([function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.element}()},,,,,function(e,t,n){},,,function(e,t,n){"use strict";n.r(t);var r=n(1),o=n(0),l=(n(6),n(2));n(7);Object(r.registerBlockType)("wporg-learn/workshop-details",{title:Object(o.__)("Workshop Details","wporg-learn"),description:Object(o.__)("Show details about the workshop, pulled from post meta.","wporg-learn"),category:"widgets",icon:"smiley",supports:{html:!1},edit:function(e){var t=e.className;return Object(l.createElement)("div",{className:t},Object(l.createElement)("p",null,Object(o.__)("Workshop Details","wporg-learn")),Object(l.createElement)("p",null,Object(o.__)("This will be dynamically populated based on custom fields.","wporg-learn")))},save:function(){return null}})}]);
     1(window.wporgLearnPlugin=window.wporgLearnPlugin||[]).push([[3],{6:function(e,t,n){}}]),function(e){function t(t){for(var r,l,u=t[0],p=t[1],a=t[2],s=0,f=[];s<u.length;s++)l=u[s],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&f.push(o[l][0]),o[l]=0;for(r in p)Object.prototype.hasOwnProperty.call(p,r)&&(e[r]=p[r]);for(c&&c(t);f.length;)f.shift()();return i.push.apply(i,a||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,u=1;u<n.length;u++){var p=n[u];0!==o[p]&&(r=!1)}r&&(i.splice(t--,1),e=l(l.s=n[0]))}return e}var r={},o={5:0},i=[];function l(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,l),n.l=!0,n.exports}l.m=e,l.c=r,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(l.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)l.d(n,r,function(t){return e[t]}.bind(null,r));return n},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var u=window.wporgLearnPlugin=window.wporgLearnPlugin||[],p=u.push.bind(u);u.push=t,u=u.slice();for(var a=0;a<u.length;a++)t(u[a]);var c=p;i.push([9,3]),n()}([function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.components}()},,,,,,function(e,t,n){"use strict";n.r(t);var r=n(1),o=n(0),i=(n(6),n(2)),l=n(3);Object(r.registerBlockType)("wporg-learn/workshop-details",{title:Object(o.__)("Workshop Details","wporg-learn"),description:Object(o.__)("Show details about the workshop, pulled from post meta.","wporg-learn"),category:"widgets",icon:"smiley",supports:{html:!1},edit:function(){return Object(i.createElement)(l.Placeholder,{label:Object(o.__)("Workshop Details","wporg-learn")},Object(i.createElement)("p",null,Object(o.__)("This will be dynamically populated based on settings in the Workshop Details meta box.","wporg-learn")))},save:function(){return null}})}]);
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/blocks.php

    r10376 r10461  
    44
    55use Error;
     6use Sensei_Lesson;
    67use function WordPressdotorg\Locales\get_locale_name_from_code;
    7 use function WPOrg_Learn\{ get_build_path, get_build_url };
     8use function WPOrg_Learn\{get_build_path, get_build_url, get_views_path};
    89use function WPOrg_Learn\Form\render_workshop_application_form;
    910use function WPOrg_Learn\Post_Meta\get_workshop_duration;
     
    5051
    5152    wp_register_style(
    52         'workshop-details-editor-style',
    53         get_build_url() . 'workshop-details.css',
    54         array(),
    55         filemtime( get_build_path() . 'workshop-details.css' )
    56     );
    57 
    58     wp_register_style(
    5953        'workshop-details-style',
    6054        get_build_url() . 'style-workshop-details.css',
     
    6559    register_block_type( 'wporg-learn/workshop-details', array(
    6660        'editor_script'   => 'workshop-details-editor-script',
    67         'editor_style'    => 'workshop-details-editor-style',
    6861        'style'           => 'workshop-details-style',
    6962        'render_callback' => __NAMESPACE__ . '\workshop_details_render_callback',
    7063    ) );
    71 }
    72 
    73 /**
    74  * Build the html output based on input fields
    75  *
    76  * @param array $fields
    77  * @return string HTML output.
    78  */
    79 function get_workshop_details_html_output( $fields ) {
    80     $output = '<ul class="wp-block-wporg-learn-workshop-details">';
    81 
    82     foreach ( $fields as $key => $value ) {
    83         $output .= sprintf(
    84             '<li><b>%1$s</b><span>%2$s</span></li>',
    85             $key,
    86             $value
    87         );
    88     }
    89 
    90     $output .= '</ul>';
    91 
    92     return $output;
    9364}
    9465
     
    12394
    12495    // Remove empty fields.
    125     $fields_to_output = array_filter( $fields );
     96    $fields = array_filter( $fields );
    12697
    127     return get_workshop_details_html_output( $fields_to_output );
     98    $lesson_id = get_post_meta( $post->ID, 'linked_lesson_id', true );
     99    $quiz_url = '';
     100    if ( $lesson_id && Sensei_Lesson::lesson_quiz_has_questions( $lesson_id ) ) {
     101        $quiz_id = Sensei()->lesson->lesson_quizzes( $lesson_id );
     102        if ( $quiz_id ) {
     103            $quiz_url = get_permalink( $quiz_id );
     104        }
     105    }
     106
     107    ob_start();
     108    require get_views_path() . 'block-workshop-details.php';
     109
     110    return ob_get_clean();
    128111}
    129112
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-meta.php

    r10458 r10461  
    112112            'single'            => false,
    113113            'sanitize_callback' => __NAMESPACE__ . '\sanitize_locale',
     114            'show_in_rest'      => true,
     115        )
     116    );
     117
     118    register_post_meta(
     119        $post_type,
     120        'linked_lesson_id',
     121        array(
     122            'description'       => __( 'The post ID of a lesson that covers this workshop.', 'wporg_learn' ),
     123            'type'              => 'integer',
     124            'single'            => true,
     125            'sanitize_callback' => 'absint',
    114126            'show_in_rest'      => true,
    115127        )
     
    312324    $locales           = get_locales_with_english_names();
    313325    $captions          = get_post_meta( $post->ID, 'video_caption_language' ) ?: array();
     326    $all_lessons       = get_posts( array(
     327        'post_type'      => 'lesson',
     328        'post_status'    => 'publish',
     329        'posts_per_page' => 999,
     330        'orderby'        => 'title',
     331        'order'          => 'asc',
     332    ) );
    314333
    315334    require get_views_path() . 'metabox-workshop-details.php';
     
    374393        }
    375394    }
     395
     396    $lesson_id = filter_input( INPUT_POST, 'linked-lesson-id', FILTER_SANITIZE_NUMBER_INT );
     397    update_post_meta( $post_id, 'linked_lesson_id', $lesson_id );
    376398
    377399    $presenter_wporg_username = filter_input( INPUT_POST, 'presenter-wporg-username' );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/block-styles/style.scss

    r10169 r10461  
    55    .wp-block-button__link,
    66    .wp-block-button__link:visited {
    7         background: #0085ba;
    8         color: #fff;
    97        text-align: center;
    108        font-size: 13px;
    119        font-weight: 600;
     10        text-decoration: none;
    1211        padding: 0.9rem;
    13         margin: 32px 0;
     12        margin: 0 0 32px;
     13        background: #0085ba;
     14        color: #fff;
     15        border: 1px solid #006799;
     16        box-shadow: 0 1px 0 #006799;
     17    }
     18
     19    .wp-block-button__link:hover {
     20        background: #008ec2;
    1421    }
    1522}
     
    1926    .wp-block-button__link,
    2027    .wp-block-button__link:visited {
    21         background: #f8f9f9;
     28        background: #f7f7f7;
    2229        color: #555;
    23         border: 1px solid #d9dcdf;
    24         box-shadow: 0 1px 0 #d9dcdf;
     30        border: 1px solid #ccc;
     31        box-shadow: 0 1px 0 #ccc;
     32    }
     33
     34    .wp-block-button__link:hover {
     35        background: #fafafa;
     36        color: #23282d;
     37        border: 1px solid #999;
     38        box-shadow: 0 1px 0 #999;
    2539    }
    2640}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/edit.js

    r10169 r10461  
    11/**
    2  * Retrieves the translation of text.
    3  *
    4  * @see https://developer.wordpress.org/block-editor/packages/packages-i18n/
     2 * WordPress dependencies
    53 */
    64import { __ } from '@wordpress/i18n';
     5import { Placeholder } from '@wordpress/components';
    76
    8 /**
    9  * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.
    10  * Those files can contain any CSS code that gets applied to the editor.
    11  *
    12  * @see https://www.npmjs.com/package/@wordpress/scripts#using-css
    13  */
    14 import './editor.scss';
    15 
    16 /**
    17  * The edit function describes the structure of your block in the context of the
    18  * editor. This represents what the editor will render when the block is used.
    19  *
    20  * @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#edit
    21  *
    22  * @param {Object} [props]           Properties passed from the editor.
    23  * @param {string} [props.className] Class name generated for the block.
    24  *
    25  * @return {WPElement} Element to render.
    26  */
    27 export default function Edit( { className } ) {
     7export default function Edit() {
    288    return (
    29         <div className={ className }>
    30             <p>{ __( 'Workshop Details', 'wporg-learn' ) }</p>
     9        <Placeholder label={ __( 'Workshop Details', 'wporg-learn' ) }>
    3110            <p>
    3211                { __(
    33                     'This will be dynamically populated based on custom fields.',
     12                    'This will be dynamically populated based on settings in the Workshop Details meta box.',
    3413                    'wporg-learn'
    3514                ) }
    3615            </p>
    37         </div>
     16        </Placeholder>
    3817    );
    3918}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/style.scss

    r10169 r10461  
    77
    88.wp-block-wporg-learn-workshop-details {
    9     list-style: none;
    10     margin: 0;
    11     padding: 0;
    12     color: #555d66;
     9    margin: 0 0 32px;
    1310
    14     li {
    15         display: flex;
    16         justify-content: space-between;
    17         padding: 8px 0;
    18         border-top: 1px solid #e2e4e7;
     11    .workshop-details-list {
     12        list-style: none;
     13        margin: 0;
     14        padding: 0;
     15        color: #555d66;
    1916
    20         &:last-child {
    21             border-bottom: 1px solid #e2e4e7;
     17        li {
     18            display: flex;
     19            justify-content: space-between;
     20            padding: 8px 0;
     21            border-top: 1px solid #e2e4e7;
     22
     23            &:last-child {
     24                border-bottom: 1px solid #e2e4e7;
     25            }
     26
     27            > span {
     28                text-align: right;
     29                flex-basis: 50%;
     30                word-break: normal;
     31            }
    2232        }
     33    }
    2334
    24         > span {
    25             text-align: right;
    26             flex-basis: 50%;
    27             word-break: normal;
     35    .is-style-primary-full-width,
     36    .is-style-secondary-full-width {
     37        .wp-block-button__link,
     38        .wp-block-button__link:visited {
     39            margin: 32px 0 0;
    2840        }
    2941    }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/metabox-workshop-details.php

    r10376 r10461  
    88/** @var array $locales */
    99/** @var array $captions */
     10/** @var array $all_lessons */
     11/** @var array $selected_lessons */
    1012?>
    1113
     
    7173</p>
    7274
     75<p>
     76    <label for="workshop-linked-lesson-id"><?php esc_html_e( 'Linked Quiz', 'wporg_learn' ); ?></label>
     77    <select id="workshop-linked-lesson-id" name="linked-lesson-id" style="width: 100%;">
     78        <option value="" disabled hidden <?php selected( ! $post->linked_lesson_id ); ?>></option>
     79        <?php foreach ( $all_lessons as $lesson ) : ?>
     80            <option value="<?php echo esc_attr( $lesson->ID ); ?>" <?php selected( $lesson->ID, $post->linked_lesson_id ); ?>>
     81                <?php echo esc_html( get_the_title( $lesson->ID ) ); ?>
     82            </option>
     83        <?php endforeach; ?>
     84    </select>
     85</p>
     86
    7387<script>
    7488    ( function( $ ) {
    75         $( '#workshop-video-language, #workshop-video-caption-language' ).select2();
     89        $( '#workshop-video-language, #workshop-video-caption-language, #workshop-linked-lesson-id' ).select2();
    7690    } )( jQuery );
    7791</script>
Note: See TracChangeset for help on using the changeset viewer.