Making WordPress.org

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#6160 closed defect (bug) (fixed)

Filter the list of theme tags before attempting to update

Reported by: dd32's profile dd32 Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Theme Directory Keywords:
Cc:

Description

When a theme submits an update, if it has a tag in it's list that's unknown by WordPress.org/themes, it'll fail to update the tags.

For example:

  • Theme v1 has one-column, green (all allowed)
  • Theme v2 changes it to one-column, blue, sillytag (First two allowed, last not)

The theme in the above example will continue to show as being tagged one-column, green despite the following version changed to blue.

It should diff the tags to the expected tags first, in this case, attempting to set it to one-column, blue excluding the sillytag tag.

In this case, the error is something like this:

wp> wp_set_post_tags( 12345, [ 'one-column', 'blue', 'sillytag' ] );

class WP_Error#5234 (3) {
  public $errors =>
  array(1) {
    'not-allowed' =>
    array(1) {
      [0] =>
      string(33) "You are not allowed to add terms."

Change History (3)

#1 @dd32
2 years ago

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

In 11641:

Theme Directory: Filter the theme tags to those the directory knows about.

This prevents the code attempting to add a new term when a theme specifies an 'unknown' tag, causing the tag update to be ignored.

Fixes #6160.

#2 @kafleg
2 years ago

@dd32 Thanks for the fixing. I see it's working now :)

This ticket was mentioned in Slack in #themereview by kafleg. View the logs.


2 years ago

Note: See TracTickets for help on using tickets.