Make WordPress Core

Opened 6 years ago

Closed 6 years 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
Priority: normal Milestone: 5.4.2
Component: Taxonomy Version: 5.4
Severity: normal Keywords: has-patch fixed-major
Cc: Focuses:

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 6 years ago.
Screenshot:
49808.diff (1007 bytes ) - added by joemcgill 6 years ago.

Download all attachments as: .zip

Change History (13)

#1 @SergeyBiryukov
6 years 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
6 years 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 6 years ago by kikito123 (previous) (diff)

#3 @SergeyBiryukov
6 years ago

#49954 was marked as a duplicate.

#4 follow-up: @joemcgill
6 years 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
6 years ago

  • Keywords needs-patch added; 2nd-opinion removed
  • Milestone Awaiting Review5.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
6 years ago

#6 @joemcgill
6 years 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
6 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status assignedclosed

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
6 years ago

  • Keywords fixed-major added
  • Resolution fixed
  • Status closedreopened

Reopening for 5.4.2 consideration.

#9 in reply to: ↑ 8 ; follow-up: @kikito123
6 years 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
6 years 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
6 years ago

  • Resolutionfixed
  • Status reopenedclosed

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.