WordPress.org

Make WordPress Core

Opened 2 months ago

Closed 4 weeks ago

Last modified 4 weeks ago

#53731 closed defect (bug) (fixed)

About the docs of safecss_filter_attr function

Reported by: tmatsuur Owned by: 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 4 weeks 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
2 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
2 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
2 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
4 weeks 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 4 weeks ago by muhammadfaizanhaidar (previous) (diff)

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


4 weeks ago

  • 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
4 weeks 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
4 weeks 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.

#8 @prbot
4 weeks ago

MuhammadFaizanHaidar commented on PR #1652:

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

Note: See TracTickets for help on using tickets.