Make WordPress Core

Opened 23 months ago

Closed 21 months ago

Last modified 21 months ago

#53731 closed defect (bug) (fixed)

About the docs of safecss_filter_attr function

Reported by: tmatsuur's profile tmatsuur Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.9 Priority: normal
Severity: normal Version: 4.4
Component: Formatting Keywords: good-first-bug has-patch
Focuses: docs Cc:

Description

Currently, the docs for the safe_style_css filter contains the following information.

 * @since 5.8.0 Added support for `calc()` and `var()` values.

Shouldn't the above information be in the docs for this function?

Attachments (1)

github-WordPress-wordpress-develop-compare-master-MuhammadFaizanHaidar-master-2021-09-02-15_06_49.png (210.0 KB) - added by muhammadfaizanhaidar 21 months ago.
I have just added a patch shifted details to function doc block from filter doc block. Thanks for this opportunity to contribute.

Download all attachments as: .zip

Change History (9)

#1 @SergeyBiryukov
23 months ago

Hi there, thanks for the ticket!

Looking at the safecss_filter_attr() function, all the updates to allowed CSS attributes since WordPress 4.4 are indeed documented in the safe_style_css filter rather than in the function.

Would it make more sense to move this list to the function DocBlock instead?

#2 @sabernhardt
23 months ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to 5.9
  • Version changed from 5.8 to 4.4

Support for specific properties was added to the safecss_filter_attr function, not the filter, so moving the list from one DocBlock to the other makes sense to me.

I could upload a patch, but I think this would be a good-first-bug.

#3 @tmatsuur
23 months ago

Thanks @SergeyBiryukov , @sabernhardt

As you pointed out, I also think it would be more appropriate to move the list to the function DocBlock.

#4 @muhammadfaizanhaidar
21 months ago

@SergeyBiryukov , @sabernhardt @tmatsuur
I have just added a patch shifted details to function doc block from filter doc block. Thanks for this opportunity to contribute.

Last edited 21 months ago by muhammadfaizanhaidar (previous) (diff)

This ticket was mentioned in PR #1652 on WordPress/wordpress-develop by MuhammadFaizanHaidar.


21 months ago
#5

  • Keywords has-patch added; needs-patch removed

Updated safecss_filter_attr function's doc block.
Shifted the updates for this function from 'safe_style_css' filter doc block to the safecss_filter_attr function's doc block.

Trac ticket: https://core.trac.wordpress.org/ticket/53731

File details
wp-includes/wp-includes/kses.php line 2152.
wp-includes/wp-includes/kses.php line 2183.
https://github.com/MuhammadFaizanHaidar/wordpress-develop/blob/master/src/wp-includes/kses.php

@muhammadfaizanhaidar
21 months ago

I have just added a patch shifted details to function doc block from filter doc block. Thanks for this opportunity to contribute.

#6 @SergeyBiryukov
21 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 51729:

Docs: Move @since notes from the safe_style_css filter to the safecss_filter_attr() function.

The filter allows to modify the list of allowed CSS attributes, however support for specific CSS attributes is added to the function rather than the filter.

Follow-up to [37931], [38121], [42880], [44136], [44531], [45242], [45363], [46235], [46793], [50634], [50923].

Props tmatsuur, muhammadfaizanhaidar, sabernhardt.
Fixes #53731.

MuhammadFaizanHaidar commented on PR #1652:


21 months ago
#8

@SergeyBiryukov I am honored to contribute. Thanks for merging the PR!

Note: See TracTickets for help on using tickets.