WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 2 months ago

#49808 closed defect (bug) (fixed)

WordPress 5.4: Deprecated: tag_row_actions is deprecated since version 3.0.0

Reported by: delowardev Owned by: SergeyBiryukov
Milestone: 5.4.2 Priority: normal
Severity: normal Version: 5.4
Component: Taxonomy Keywords: has-patch fixed-major
Focuses: Cc:

Description

I'm getting a warning on the Category page after installing WordPress 5.4

Deprecated: tag_row_actions is deprecated since version 3.0.0! Use {$taxonomy}_row_actions instead. in /PATH/wp-includes/functions.php on line 5088

Attachments (2)

Screen Shot on 2020-04-04 at 22-10-19.png (13.2 KB) - added by delowardev 3 months ago.
Screenshot:
49808.diff (1007 bytes) - added by joemcgill 2 months ago.

Download all attachments as: .zip

Change History (13)

#1 @SergeyBiryukov
3 months ago

  • Keywords close added

Hi there, welcome to WordPress Trac! Thanks for the report.

The deprecated hook message is only displayed if you have any functions in your plugins or theme specifically hooked to the deprecated tag_row_actions filter. As noted in the message, those instances should be updated to use {$taxonomy}_row_actions instead (e.g. post_tag_row_actions or category_row_actions), where $taxonomy refers to the taxonomy slug.

#2 @kikito123
3 months ago

Buenas tardes tengo el mismo problema y quisiera saber paso a paso como resolverlo. La contestación al compañero no me quedo clara. Cuales son los .php que habría que modificar y como se ecribiría la linea para no afectar el php.

El problema lo tengo con entradas de plugins y del theme. Mismo mensaje.

Deprecated: tag_row_actions ha quedado obsoleto desde la versión 3.0.0. Utiliza {$taxonomy}_row_actions en su lugar. in C:\xampp\htdocs\p_uno\wp-includes\functions.php on line 5088

Gracias.

Last edited 3 months ago by kikito123 (previous) (diff)

#3 @SergeyBiryukov
3 months ago

#49954 was marked as a duplicate.

#4 follow-up: @joemcgill
2 months ago

  • Keywords 2nd-opinion added; close removed

Officially deprecating this filter shows that there isn't a simple way for plugin authors to add actions generically for all taxonomy list tables without looping through each taxonomy individually. I think we should either reinstate this action or add a new generic action, like taxonomy_row_actions that can be used instead.

For comparison, there are generic actions for post list tables that can be used for hierarchical (and non-hierarchical posts. See: https://core.trac.wordpress.org/browser/tags/5.4/src/wp-admin/includes/class-wp-posts-list-table.php#L1417.

#5 in reply to: ↑ 4 @SergeyBiryukov
2 months ago

  • Keywords needs-patch added; 2nd-opinion removed
  • Milestone changed from Awaiting Review to 5.4.2

Replying to joemcgill:

Officially deprecating this filter shows that there isn't a simple way for plugin authors to add actions generically for all taxonomy list tables without looping through each taxonomy individually. I think we should either reinstate this action or add a new generic action, like taxonomy_row_actions that can be used instead.

Thanks for bringing this up!

For some context, category_link and tag_link filters were accidentally deprecated in [27827] / #27505 and reinstated for WordPress 5.4.1 in #49759.

This looks like another instance of accidental deprecation in [27089] / #26209.

Let's reinstate the tag_row_actions filter.

@joemcgill
2 months ago

#6 @joemcgill
2 months ago

  • Keywords has-patch added; needs-patch removed

Thanks @SergeyBiryukov. I've uploaded 49808.diff that should reinstate the former behavior and remove the deprecation comment. Does that look right to you?

#7 @SergeyBiryukov
2 months ago

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

In 47734:

Taxonomy: Restore (un-deprecate) the tag_row_actions filter.

The filter provides a simple way for plugin authors to add actions generically for all taxonomy list tables without looping through each taxonomy individually.

Props joemcgill, delowardev.
Fixes #49808.

#8 follow-up: @SergeyBiryukov
2 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 5.4.2 consideration.

#9 in reply to: ↑ 8 ; follow-up: @kikito123
2 months ago

Replying to SergeyBiryukov:

Reopening for 5.4.2 consideration.

Entonces en que situación quedan estos mensajes de error, ya que se siguen visualizando, que debemos hacer exactamente. Gracias por cualquier ayuda. Saludos!

#10 in reply to: ↑ 9 @joemcgill
2 months ago

Replying to kikito123:

Entonces en que situación quedan estos mensajes de error, ya que se siguen visualizando, que debemos hacer exactamente. Gracias por cualquier ayuda. Saludos!

Hola @kikito123

Perdón por mi traducción. Para solucionar este error por ahora, debe encontrar el código que se ve así:

add_filter( 'tag_row_actions', 'some_function_name' );

Y reemplácelo con un código que se vea así:

foreach ( get_taxonomies() as $taxonomy ) {
    add_filter( "${taxonomy}_row_actions", 'some_function_name' );
}

#11 @SergeyBiryukov
2 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 47767:

Taxonomy: Restore (un-deprecate) the tag_row_actions filter.

The filter provides a simple way for plugin authors to add actions generically for all taxonomy list tables without looping through each taxonomy individually.

Props joemcgill, delowardev.
Merges [47734] to the 5.4 branch.
Fixes #49808.

Note: See TracTickets for help on using tickets.