Changeset 11256
- Timestamp:
- 09/24/2021 06:47:29 PM (3 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/expiration-date.asset.php
r11225 r11256 1 <?php return array('dependencies' => array('wp-components', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => ' 70efa9d96d68eabf0d8dce2dbd1b6aba');1 <?php return array('dependencies' => array('wp-components', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '286f434f44827333876db478180890c4'); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/expiration-date.js
r11225 r11256 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=12)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},,function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.date}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var r=n(13),o=n(14),c=n(15),i=n(17);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()}},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t){!function(){e.exports=this.wp.plugins}()},,,function(e,t,n){"use strict";n.r(t);var r=n(6),o=n.n(r),c=n(7),i=n.n(c),u=n(0),a=n(3),l=n(5), s=n(4),f=n(8),p=n(1),b=n(9);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e){var t=e.date,n=Object(s.__experimentalGetSettings)();return t?Object(s.format)("".concat(n.formats.date," ").concat(n.formats.time),t):Object(p.__)("No expiration date","wporg-learn")}var j=function(){var e=Object(l.useSelect)((function(e){return e("core/editor").getEditedPostAttribute("meta")||{}})),t=Object(l.useDispatch)("core/editor").editPost,n=Object(u.useState)(null==e?void 0:e.expiration_date),r=i()(n,2),o=r[0],c=r[1],s=Object(u.useRef)(),b=Object(u.useRef)();return Object(u.createElement)(f.PluginPostStatusInfo,null,Object(u.createElement)(a.PanelRow,{className:"edit-post-post-schedule",ref:s},Object(u.createElement)("span",null,Object(p.__)("Expiration","wporg-learn")),Object(u.createElement)(a.Dropdown,{popoverProps:{anchorRef:s.current},position:"bottom left",contentClassName:"edit-post-post-schedule__dialog",renderToggle:function(e){var t=e.onToggle,n=e.isOpen;return Object(u.createElement)(u.Fragment,null,Object(u.createElement)(a.Button,{className:"edit-post-post-schedule__toggle",onClick:t,"aria-expanded":n,variant:"tertiary"},Object(u.createElement)(O,{date:o})))},renderContent:function(){return Object(u.createElement)(u.Fragment,null,Object(u.createElement)("p",{className:"help-text",style:{padding:"0 16px"}},Object(p.__)("A date when the content in this post might become obsolete.","wporg-learn")),Object(u.createElement)(a.DateTimePicker,{ref:b,currentDate:o,onChange:function(n){c(n),t({meta:m(m({},e),{},{expiration_date:n})}),b.current.ownerDocument.activeElement.blur()}}))}})))};Object(b.registerPlugin)("wporg-learn-expiration-date",{render:function(){return Object(u.createElement)(j,null)}})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,c=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw c}}return n}}},function(e,t,n){var r=n(16);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}}]);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=12)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},,function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.date}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var r=n(13),o=n(14),c=n(15),i=n(17);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()}},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t){!function(){e.exports=this.wp.plugins}()},,,function(e,t,n){"use strict";n.r(t);var r=n(6),o=n.n(r),c=n(7),i=n.n(c),u=n(0),a=n(3),l=n(5),f=n(4),s=n(8),p=n(1),b=n(9);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e){var t=e.date,n=Object(f.__experimentalGetSettings)();return t?Object(f.format)("".concat(n.formats.date," ").concat(n.formats.time),t):Object(p.__)("No expiration date","wporg-learn")}var j=function(){var e=Object(l.useSelect)((function(e){return e("core/editor").getEditedPostAttribute("meta")||{}})),t=Object(l.useDispatch)("core/editor").editPost,n=Object(u.useState)(null==e?void 0:e.expiration_date),r=i()(n,2),o=r[0],c=r[1],f=Object(u.useRef)(),b=Object(u.useRef)();return Object(u.createElement)(s.PluginPostStatusInfo,null,Object(u.createElement)(a.PanelRow,{className:"edit-post-post-schedule",ref:f},Object(u.createElement)("span",null,Object(p.__)("Expiration","wporg-learn")),Object(u.createElement)(a.Dropdown,{popoverProps:{anchorRef:f.current},position:"bottom left",contentClassName:"edit-post-post-schedule__dialog",renderToggle:function(e){var t=e.onToggle,n=e.isOpen;return Object(u.createElement)(u.Fragment,null,Object(u.createElement)(a.Button,{className:"edit-post-post-schedule__toggle",onClick:t,"aria-expanded":n,variant:"tertiary"},Object(u.createElement)(O,{date:o})))},renderContent:function(){return Object(u.createElement)(u.Fragment,null,Object(u.createElement)("p",{style:{padding:"0 16px"}},Object(p.__)("A date when the content in this post might become obsolete.","wporg-learn")),Object(u.createElement)(a.DateTimePicker,{ref:b,currentDate:o,onChange:function(n){c(n),t({meta:m(m({},e),{},{expiration_date:n})}),b.current.ownerDocument.activeElement.blur()}}))}})))};Object(b.registerPlugin)("wporg-learn-expiration-date",{render:function(){return Object(u.createElement)(j,null)}})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,c=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw c}}return n}}},function(e,t,n){var r=n(16);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}}]); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php
r10926 r11256 627 627 628 628 /** 629 * Get the bio of a user, either from profiles.wordpress.org or usermeta. 630 * 631 * This relies on the availability of the `bpmain_bp_xprofile_data` table, so for local environments 632 * it falls back on values in `usermeta`. 633 * 634 * @param WP_User $user 629 * Get the bio of a user, first trying usermeta and then profiles.wordpress.org. 630 * 631 * The `usermeta` bio (description) field will be pulled. If there is no bio, profiles.wordpress.org is tried. 632 * The bio at profiles.wordpress.org relies on the availability of the `bpmain_bp_xprofile_data` table. 633 * For local environments the bio will only pull from `usermeta`. 634 * 635 * @param WP_User $user The user to retrieve a bio for. 635 636 * 636 637 * @return string … … 639 640 global $wpdb; 640 641 641 $bio = ''; 642 643 if ( 'local' !== wp_get_environment_type() ) { 642 // Retrieve bio from user data. 643 $bio = $user->description; 644 645 // If bio is empty, retrieve from .org. 646 if ( ! $bio && 'local' !== wp_get_environment_type() ) { 644 647 $xprofile_field_id = 3; 645 648 … … 656 659 657 660 $bio = $wpdb->get_var( $sql ) ?: ''; // phpcs:ignore WordPress.DB.PreparedSQL -- prepare called above. 658 }659 660 if ( ! $bio ) {661 $bio = $user->description;662 661 } 663 662 … … 854 853 } 855 854 add_filter( 'syntaxhighlighter_htmlresult', 'wporg_learn_fix_code_entity_encoding', 20 ); 855 856 /** 857 * Add fallback image to Jetpack when no featured image exists. 858 * 859 * @param string $default_image The default image URL. 860 * 861 * @return string Image URL. 862 */ 863 function wporg_learn_return_default_image( $default_image ) { 864 return 'https://s.w.org/images/learn-thumbnail-fallback.jpg'; 865 } 866 add_action( 'jetpack_open_graph_image_default', 'wporg_learn_return_default_image', 15, 1 );
Note: See TracChangeset
for help on using the changeset viewer.