Skip to content

Commit

Permalink
Enforce @SInCE tags in block-library/src/*/*.php files (#59700)
Browse files Browse the repository at this point in the history
* Enforce @SInCE tags in block-library/src/*/*.php files

Co-authored-by: anton-vlasenko <[email protected]>
Co-authored-by: gziolo <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: getdave <[email protected]>
  • Loading branch information
5 people authored Mar 13, 2024
1 parent fe3f484 commit 86b166c
Show file tree
Hide file tree
Showing 67 changed files with 652 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/block-library/src/archives/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/archives` block on server.
*
* @since 5.0.0
*
* @see WP_Widget_Archives
*
* @param array $attributes The block attributes.
Expand Down Expand Up @@ -106,6 +108,8 @@ function render_block_core_archives( $attributes ) {

/**
* Register archives block.
*
* @since 5.0.0
*/
function register_block_core_archives() {
register_block_type_from_metadata(
Expand Down
6 changes: 6 additions & 0 deletions packages/block-library/src/avatar/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/avatar` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
Expand Down Expand Up @@ -99,6 +101,8 @@ function render_block_core_avatar( $attributes, $content, $block ) {
* Generates class names and styles to apply the border support styles for
* the Avatar block.
*
* @since 6.3.0
*
* @param array $attributes The block attributes.
* @return array The border-related classnames and styles for the block.
*/
Expand Down Expand Up @@ -149,6 +153,8 @@ function get_block_core_avatar_border_attributes( $attributes ) {

/**
* Registers the `core/avatar` block on the server.
*
* @since 6.0.0
*/
function register_block_core_avatar() {
register_block_type_from_metadata(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/block/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/block` block on server.
*
* @since 5.0.0
*
* @global WP_Embed $wp_embed
*
* @param array $attributes The block attributes.
Expand Down Expand Up @@ -97,6 +99,8 @@ function render_block_core_block( $attributes ) {

/**
* Registers the `core/block` block.
*
* @since 5.3.0
*/
function register_block_core_block() {
register_block_type_from_metadata(
Expand Down
12 changes: 12 additions & 0 deletions packages/block-library/src/calendar/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/calendar` block on server.
*
* @since 5.2.0
*
* @global int $monthnum.
* @global int $year.
*
Expand Down Expand Up @@ -79,6 +81,8 @@ function render_block_core_calendar( $attributes ) {

/**
* Registers the `core/calendar` block on server.
*
* @since 5.2.0
*/
function register_block_core_calendar() {
register_block_type_from_metadata(
Expand All @@ -97,6 +101,8 @@ function register_block_core_calendar() {
* Used to hide the calendar block when there are no published posts.
* This compensates for a known Core bug: https://core.trac.wordpress.org/ticket/12016
*
* @since 5.9.0
*
* @return bool Has any published posts or not.
*/
function block_core_calendar_has_published_posts() {
Expand All @@ -120,6 +126,8 @@ function block_core_calendar_has_published_posts() {
* Queries the database for any published post and saves
* a flag whether any published post exists or not.
*
* @since 5.9.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @return bool Has any published posts or not.
Expand All @@ -137,6 +145,8 @@ function block_core_calendar_update_has_published_posts() {
/**
* Handler for updating the has published posts flag when a post is deleted.
*
* @since 5.9.0
*
* @param int $post_id Deleted post ID.
*/
function block_core_calendar_update_has_published_post_on_delete( $post_id ) {
Expand All @@ -152,6 +162,8 @@ function block_core_calendar_update_has_published_post_on_delete( $post_id ) {
/**
* Handler for updating the has published posts flag when a post status changes.
*
* @since 5.9.0
*
* @param string $new_status The status the post is changing to.
* @param string $old_status The status the post is changing from.
* @param WP_Post $post Post object.
Expand Down
6 changes: 6 additions & 0 deletions packages/block-library/src/categories/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/categories` block on server.
*
* @since 5.0.0
*
* @param array $attributes The block attributes.
*
* @return string Returns the categories list/dropdown markup.
Expand Down Expand Up @@ -63,6 +65,8 @@ function render_block_core_categories( $attributes ) {
/**
* Generates the inline script for a categories dropdown field.
*
* @since 5.0.0
*
* @param string $dropdown_id ID of the dropdown field.
*
* @return string Returns the dropdown onChange redirection script.
Expand All @@ -87,6 +91,8 @@ function onCatChange() {

/**
* Registers the `core/categories` block on server.
*
* @since 5.0.0
*/
function register_block_core_categories() {
register_block_type_from_metadata(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/comment-author-name/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/comment-author-name` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
Expand Down Expand Up @@ -53,6 +55,8 @@ function render_block_core_comment_author_name( $attributes, $content, $block )

/**
* Registers the `core/comment-author-name` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comment_author_name() {
register_block_type_from_metadata(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/comment-content/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/comment-content` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
Expand Down Expand Up @@ -69,6 +71,8 @@ function render_block_core_comment_content( $attributes, $content, $block ) {

/**
* Registers the `core/comment-content` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comment_content() {
register_block_type_from_metadata(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/comment-date/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/comment-date` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
Expand Down Expand Up @@ -46,6 +48,8 @@ function render_block_core_comment_date( $attributes, $content, $block ) {

/**
* Registers the `core/comment-date` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comment_date() {
register_block_type_from_metadata(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/comment-edit-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/comment-edit-link` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
Expand Down Expand Up @@ -48,6 +50,8 @@ function render_block_core_comment_edit_link( $attributes, $content, $block ) {

/**
* Registers the `core/comment-edit-link` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comment_edit_link() {
register_block_type_from_metadata(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/comment-reply-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/comment-reply-link` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
Expand Down Expand Up @@ -70,6 +72,8 @@ function render_block_core_comment_reply_link( $attributes, $content, $block ) {

/**
* Registers the `core/comment-reply-link` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comment_reply_link() {
register_block_type_from_metadata(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/comment-template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ function block_core_comment_template_render_comments( $comments, $block ) {
/**
* Renders the `core/comment-template` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
Expand Down Expand Up @@ -136,6 +138,8 @@ function render_block_core_comment_template( $attributes, $content, $block ) {

/**
* Registers the `core/comment-template` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comment_template() {
register_block_type_from_metadata(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/comments-pagination-next/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/comments-pagination-next` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
Expand Down Expand Up @@ -48,6 +50,8 @@ function render_block_core_comments_pagination_next( $attributes, $content, $blo

/**
* Registers the `core/comments-pagination-next` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comments_pagination_next() {
register_block_type_from_metadata(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/comments-pagination-numbers` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
Expand Down Expand Up @@ -50,6 +52,8 @@ function render_block_core_comments_pagination_numbers( $attributes, $content, $

/**
* Registers the `core/comments-pagination-numbers` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comments_pagination_numbers() {
register_block_type_from_metadata(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/comments-pagination-previous` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
Expand Down Expand Up @@ -40,6 +42,8 @@ function render_block_core_comments_pagination_previous( $attributes, $content,

/**
* Registers the `core/comments-pagination-previous` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comments_pagination_previous() {
register_block_type_from_metadata(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/comments-pagination/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/comments-pagination` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
*
Expand All @@ -34,6 +36,8 @@ function render_block_core_comments_pagination( $attributes, $content ) {

/**
* Registers the `core/comments-pagination` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comments_pagination() {
register_block_type_from_metadata(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/comments-title/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/comments-title` block on the server.
*
* @since 6.0.0
*
* @param array $attributes Block attributes.
*
* @return string Return the post comments title.
Expand Down Expand Up @@ -84,6 +86,8 @@ function render_block_core_comments_title( $attributes ) {

/**
* Registers the `core/comments-title` block on the server.
*
* @since 6.0.0
*/
function register_block_core_comments_title() {
register_block_type_from_metadata(
Expand Down
10 changes: 10 additions & 0 deletions packages/block-library/src/comments/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* the block is in legacy mode. If not, the HTML generated in the editor is
* returned instead.
*
* @since 6.1.0
*
* @global WP_Post $post Global post object.
*
* @param array $attributes Block attributes.
Expand Down Expand Up @@ -85,6 +87,8 @@ function render_block_core_comments( $attributes, $content, $block ) {

/**
* Registers the `core/comments` block on the server.
*
* @since 6.1.0
*/
function register_block_core_comments() {
register_block_type_from_metadata(
Expand All @@ -100,6 +104,8 @@ function register_block_core_comments() {
/**
* Use the button block classes for the form-submit button.
*
* @since 6.1.0
*
* @param array $fields The default comment form arguments.
*
* @return array Returns the modified fields.
Expand All @@ -118,6 +124,8 @@ function comments_block_form_defaults( $fields ) {
* Enqueues styles from the legacy `core/post-comments` block. These styles are
* required only by the block's fallback.
*
* @since 6.1.0
*
* @param string $block_name Name of the new block type.
*/
function enqueue_legacy_post_comments_block_styles( $block_name ) {
Expand All @@ -143,6 +151,8 @@ function enqueue_legacy_post_comments_block_styles( $block_name ) {
* The same approach was followed when core/query-loop was renamed to
* core/post-template.
*
* @since 6.1.0
*
* @see https://github.com/WordPress/gutenberg/pull/41807
* @see https://github.com/WordPress/gutenberg/pull/32514
*/
Expand Down
Loading

0 comments on commit 86b166c

Please sign in to comment.