Changeset 2987196
- Timestamp:
- 11/01/2023 05:57:52 AM (9 months ago)
- Location:
- shortnotes
- Files:
-
- 2 added
- 12 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
shortnotes/tags/1.6.2/build/index.asset.php
r2939066 r2987196 1 <?php return array('dependencies' => array(' wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '508f05b7a61d9b3980de');1 <?php return array('dependencies' => array(''); -
shortnotes/tags/1.6.2/build/index.js
r2939066 r2987196 1 (()=>{"use strict";const e=window.wp.element,t=window.wp.i18n,o=window.wp.plugins,n=window.wp.components,l=window.wp.editPost,r=window.wp.data;(0,o.registerPlugin)("note-type-panel",{render:()=>{const o=(0,r.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta"))),{editPost:s}=(0,r.useDispatch)("core/editor"),a=(e,t)=>{s({meta:{[e]:t}})},p=e=>""!==e.shortnotes_reply_to_url?"reply":""===e.shortnotes_note_type?"note":e.shortnotes_note_type;return(0,e.createElement)(l.PluginDocumentSettingPanel,{name:"note-type-panel",title:(0,t.__)("Note data","shortnotes"),icon:!1},(0,e.createElement)(n.SelectControl,{label:(0,t.__)("Note type","shortnotes"),value:p(o),options:[{label:"Note",value:"note"},{label:"Reply",value:"reply"}],onChange:e=>a("shortnotes_note_type",e)}),"reply"===p(o)&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.TextControl,{label:(0,t.__)("Reply to URL","shortnotes"),help:(0,t.__)("Enter the URL to which this note is a reply","shortnotes"),value:o.shortnotes_reply_to_url,onChange:e=>a("shortnotes_reply_to_url",e)}),(0,e.createElement)(n.TextControl,{label:(0,t.__)("Reply to name (optional)","shortnotes"),help:(0,t.__)('Enter a name this reply is directed to. Defaults to "this post".',"shortnotes"),value:o.shortnotes_reply_to_name,onChange:e=>a("shortnotes_reply_to_name",e)})))},icon:""})})();1 (); -
shortnotes/tags/1.6.2/includes/post-type-note.php
r2939066 r2987196 162 162 * function from the `allowed_block_types` filter won't cause any trouble. 163 163 * 164 * @param bool| array$allowed_block_types A list of allowed block types. Boolean true by default.165 * @param \WP_Post $post The current note.166 * @return arrayA modified list of allowed block types.164 * @param bool| $allowed_block_types A list of allowed block types. Boolean true by default. 165 * @param \WP_Post $post The current note. 166 * @return A modified list of allowed block types. 167 167 */ 168 168 function filter_allowed_block_types( $allowed_block_types, \WP_Post $post ) { … … 380 380 } 381 381 382 $current_post = get_post(); 382 $current_post = get_post(); 383 384 // We can only adjust content with context, which WordPress does not 385 // guarantee when filtering `the_content`. 386 if ( ! $current_post ) { 387 return $content; 388 } 389 383 390 $reply_to_markup = get_reply_to_markup( $current_post ); 384 391 … … 409 416 410 417 /** 411 * Parse and move anchors to the end of postcontent.412 * 413 * @param string $html The postcontent.414 * @return array Modified post content.418 * content. 419 * 420 * @param string $html The content. 421 * @return . 415 422 */ 416 423 function extract_links( string $html ): array { … … 419 426 $links = array_filter( 420 427 $matches[2], 421 function ( $link ) {428 function( $link ) { 422 429 return wp_parse_url( $link, PHP_URL_HOST ); 423 430 } -
shortnotes/tags/1.6.2/includes/share-on-mastodon.php
r2876912 r2987196 18 18 * @param array $args The args sent with a new Mastodon post. 19 19 * @param \WP_Post $post The post object. 20 20 21 */ 21 function filter_args( array $args, \WP_Post $post ) 22 function filter_args( array $args, \WP_Post $post ): array { 22 23 if ( Note\get_slug() !== $post->post_type ) { 23 24 return $args; … … 63 64 * @return int The status ID if available. 0 if not. 64 65 */ 65 function get_reply_to_id( string $url ) 66 function get_reply_to_id( string $url ): int { 66 67 $site_host = wp_parse_url( home_url(), PHP_URL_HOST ); 67 68 $url_host = wp_parse_url( $url, PHP_URL_HOST ); -
shortnotes/tags/1.6.2/plugin.php
r2939069 r2987196 8 8 * Text Domain: shortnotes 9 9 * Domain Path: /languages 10 * Version: 1.6. 110 * Version: 1.6. 11 11 * 12 12 * @package shortnotes … … 18 18 } 19 19 20 // This plugin, like WordPress, requires PHP 5.6 and higher.21 if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {22 add_action( 'admin_notices', 'shortnotes_admin_notice' );23 /**24 * Display an admin notice if PHP is not 5.6.25 */26 function shortnotes_admin_notice() {27 echo '<div class=\"error\"><p>';28 echo __( 'The Shortnotes WordPress plugin requires PHP 5.6 to function properly. Please upgrade PHP or deactivate the plugin.', 'shortnotes' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped29 echo '</p></div>';30 }31 32 return;33 }34 35 20 require_once __DIR__ . '/includes/common.php'; 36 21 require_once __DIR__ . '/includes/post-type-note.php'; -
shortnotes/tags/1.6.2/readme.txt
r2939069 r2987196 3 3 Tags: indieweb, notes, replies, short 4 4 Requires at least: 5.6 5 Tested up to: 6. 26 Stable tag: 1.6. 15 Tested up to: 6. 6 Stable tag: 1.6. 7 7 License: GPLv2 or Later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 63 63 64 64 ## Changelog 65 66 67 68 69 70 71 72 65 73 66 74 ### 1.6.1 -
shortnotes/trunk/build/index.asset.php
r2939066 r2987196 1 <?php return array('dependencies' => array(' wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '508f05b7a61d9b3980de');1 <?php return array('dependencies' => array(''); -
shortnotes/trunk/build/index.js
r2939066 r2987196 1 (()=>{"use strict";const e=window.wp.element,t=window.wp.i18n,o=window.wp.plugins,n=window.wp.components,l=window.wp.editPost,r=window.wp.data;(0,o.registerPlugin)("note-type-panel",{render:()=>{const o=(0,r.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta"))),{editPost:s}=(0,r.useDispatch)("core/editor"),a=(e,t)=>{s({meta:{[e]:t}})},p=e=>""!==e.shortnotes_reply_to_url?"reply":""===e.shortnotes_note_type?"note":e.shortnotes_note_type;return(0,e.createElement)(l.PluginDocumentSettingPanel,{name:"note-type-panel",title:(0,t.__)("Note data","shortnotes"),icon:!1},(0,e.createElement)(n.SelectControl,{label:(0,t.__)("Note type","shortnotes"),value:p(o),options:[{label:"Note",value:"note"},{label:"Reply",value:"reply"}],onChange:e=>a("shortnotes_note_type",e)}),"reply"===p(o)&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.TextControl,{label:(0,t.__)("Reply to URL","shortnotes"),help:(0,t.__)("Enter the URL to which this note is a reply","shortnotes"),value:o.shortnotes_reply_to_url,onChange:e=>a("shortnotes_reply_to_url",e)}),(0,e.createElement)(n.TextControl,{label:(0,t.__)("Reply to name (optional)","shortnotes"),help:(0,t.__)('Enter a name this reply is directed to. Defaults to "this post".',"shortnotes"),value:o.shortnotes_reply_to_name,onChange:e=>a("shortnotes_reply_to_name",e)})))},icon:""})})();1 (); -
shortnotes/trunk/includes/post-type-note.php
r2939066 r2987196 162 162 * function from the `allowed_block_types` filter won't cause any trouble. 163 163 * 164 * @param bool| array$allowed_block_types A list of allowed block types. Boolean true by default.165 * @param \WP_Post $post The current note.166 * @return arrayA modified list of allowed block types.164 * @param bool| $allowed_block_types A list of allowed block types. Boolean true by default. 165 * @param \WP_Post $post The current note. 166 * @return A modified list of allowed block types. 167 167 */ 168 168 function filter_allowed_block_types( $allowed_block_types, \WP_Post $post ) { … … 380 380 } 381 381 382 $current_post = get_post(); 382 $current_post = get_post(); 383 384 // We can only adjust content with context, which WordPress does not 385 // guarantee when filtering `the_content`. 386 if ( ! $current_post ) { 387 return $content; 388 } 389 383 390 $reply_to_markup = get_reply_to_markup( $current_post ); 384 391 … … 409 416 410 417 /** 411 * Parse and move anchors to the end of postcontent.412 * 413 * @param string $html The postcontent.414 * @return array Modified post content.418 * content. 419 * 420 * @param string $html The content. 421 * @return . 415 422 */ 416 423 function extract_links( string $html ): array { … … 419 426 $links = array_filter( 420 427 $matches[2], 421 function ( $link ) {428 function( $link ) { 422 429 return wp_parse_url( $link, PHP_URL_HOST ); 423 430 } -
shortnotes/trunk/includes/share-on-mastodon.php
r2876912 r2987196 18 18 * @param array $args The args sent with a new Mastodon post. 19 19 * @param \WP_Post $post The post object. 20 20 21 */ 21 function filter_args( array $args, \WP_Post $post ) 22 function filter_args( array $args, \WP_Post $post ): array { 22 23 if ( Note\get_slug() !== $post->post_type ) { 23 24 return $args; … … 63 64 * @return int The status ID if available. 0 if not. 64 65 */ 65 function get_reply_to_id( string $url ) 66 function get_reply_to_id( string $url ): int { 66 67 $site_host = wp_parse_url( home_url(), PHP_URL_HOST ); 67 68 $url_host = wp_parse_url( $url, PHP_URL_HOST ); -
shortnotes/trunk/plugin.php
r2939069 r2987196 8 8 * Text Domain: shortnotes 9 9 * Domain Path: /languages 10 * Version: 1.6. 110 * Version: 1.6. 11 11 * 12 12 * @package shortnotes … … 18 18 } 19 19 20 // This plugin, like WordPress, requires PHP 5.6 and higher.21 if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {22 add_action( 'admin_notices', 'shortnotes_admin_notice' );23 /**24 * Display an admin notice if PHP is not 5.6.25 */26 function shortnotes_admin_notice() {27 echo '<div class=\"error\"><p>';28 echo __( 'The Shortnotes WordPress plugin requires PHP 5.6 to function properly. Please upgrade PHP or deactivate the plugin.', 'shortnotes' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped29 echo '</p></div>';30 }31 32 return;33 }34 35 20 require_once __DIR__ . '/includes/common.php'; 36 21 require_once __DIR__ . '/includes/post-type-note.php'; -
shortnotes/trunk/readme.txt
r2939069 r2987196 3 3 Tags: indieweb, notes, replies, short 4 4 Requires at least: 5.6 5 Tested up to: 6. 26 Stable tag: 1.6. 15 Tested up to: 6. 6 Stable tag: 1.6. 7 7 License: GPLv2 or Later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 63 63 64 64 ## Changelog 65 66 67 68 69 70 71 72 65 73 66 74 ### 1.6.1
Note: See TracChangeset
for help on using the changeset viewer.