Opened 14 months ago

Last modified 12 months ago

#20228 new defect (bug)

Image options can't be changed

Reported by: koke Owned by:
Priority: normal Milestone: Awaiting Review
Component: Media Version:
Severity: normal Keywords: mobile reporter-feedback close
Cc:

Description

While testing #19126 I noticed the following options can never change:

  • image_default_link_type
  • image_default_size
  • image_default_align

The "Add media" dialog remembers the last setting for size/align by using cookies. Link type always defaults to file.

Change History (6)

Sure that it's the right ticket you linked above?

It wasn't :)
#18126

As far as I remember there was a UX discussion whether these options should be in Settings -> Media or the last used one should be "remembered". At the end the second one was added but the options were left so plugins can use/change them.

Not sure what would be best for XML-RPC. Maybe the "screen states" can be loaded and used there? Have a look in set_user_setting(), get_user_setting() and wp_user_settings(). Thinking that get_user_option( 'user-settings', $user->ID ); can be parsed and sent to the client app.

comment:4 follow-up: ↓ 5   koke14 months ago

I guess it'd be better to have that settings per user, but anything works for me as long as it behaves the same way as the web UI.

comment:5 in reply to: ↑ 4   azaozz14 months ago

Replying to koke:

It is per user. The way that API works is by setting a cookie from JS when the user changes something. On the next page load that cookie is stored in the DB as "user option". Then the same data is accessible both from PHP and JS even if the user switches to another browser. In that case the cookie is also synced from the DB to the new browser.

That makes it possible to always use the right "UI states" when generating the page from PHP regardless of whether the user is in the same browser, has disabled JS, etc.

  • Keywords reporter-feedback close added
  • Version 3.4 deleted
Note: See TracTickets for help on using tickets.