Skip to content

Theme settings for all the default WordPress themes#831

Merged
lukecarbis merged 7 commits intodevelopfrom
bugfix/issue-828
Mar 16, 2016
Merged

Theme settings for all the default WordPress themes#831
lukecarbis merged 7 commits intodevelopfrom
bugfix/issue-828

Conversation

@marcin-lawrowski
Copy link
Copy Markdown
Contributor

Fixes #828

'page_background_color' => esc_html__( 'Page Background Color', 'stream' ),
),

'twentyeleven_theme_options' => array(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we include a second array of labels here? How are twentyeleven options different?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Twentyeleven theme has "Twenty Eleven Theme Options" page in Appearance menu and settings listed there are saved in "twentyeleven_theme_options" option

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of this - just saving a generic "Twenty Eleven Theme Options" setting - instead of going into detail?

I'm not sure it's worth it for the added code complication.

What do you think?

@lukecarbis
Copy link
Copy Markdown
Contributor

Got these two when updating Media settings (for the first time):
medium_large_size_w
image_default_link_type

What would they be referring to?

@lukecarbis
Copy link
Copy Markdown
Contributor

I also got heaps of these ones, when updating the "Front Page displays" setting for the first time:

"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$" setting was updated

Can we exclude all settings that end with a $?

@lukecarbis
Copy link
Copy Markdown
Contributor

In the Stream settings (also part of the Settings adaptor), I'm getting duplicate entries for the Keep Records For Setting. It appears like this:

screen shot 2016-03-15 at 09 59 52

@marcin-lawrowski
Copy link
Copy Markdown
Contributor Author

Options "medium_large_size_w" and "image_default_link_type" are reset to empty string every time Media settings are saved because there is no input fields to edit them and they are present in $whitelist_options. I assume they are either internal or legacy. I wrote a code that ignores these options.

@marcin-lawrowski
Copy link
Copy Markdown
Contributor Author

As for the duplicated entries - when you select "Keep Records Indefinitely" then "Keep Records for" setting is cleared. When you clear "Keep Records Indefinitely" checkbox then "Keep Records for" setting is set to 30 days (default). So, when you update "Keep Records Indefinitely" setting then "Keep Records for" is updated as well.


$ignored = array(
'image_default_link_type',
'medium_large_size_w',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there such a thing as small_medium_size_w or other size variations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there is not. "medium_large_size_w" and "medium_large_size_w" are the only options in this case.

@lukecarbis
Copy link
Copy Markdown
Contributor

@marcin-lawrowski Re: Duplicated entries:

Perhaps an easy and less confusing solution would be to simply change the label for "Keep Records for" to "Record TTL". The Stream Settings screen would remain the same. Thoughts?

@tylerhcarter
Copy link
Copy Markdown
Contributor

Just to pipe in...

Perhaps an easy and less confusing solution would be to simply change the label for "Keep Records for" to "Record TTL".

@lukecarbis I think that TTL is a technical phrase that I wouldn't expect many people to understand.

When you clear "Keep Records Indefinitely" checkbox then "Keep Records for" setting is set to 30 days (default). So, when you update "Keep Records Indefinitely" setting then "Keep Records for" is updated as well.

@marcin-lawrowski Two alternatives that pop up in my head:

  • Keep the value of "Keep Records for" and simply use JS to hide the option when indefinitely is selected. Internally just have the indefinite checkbox override.
  • Don't store the indefinite value and instead, replace "Keep Records for" with a 0 to indicate an indefinite time period.

@marcin-lawrowski
Copy link
Copy Markdown
Contributor Author

@Chacha I also think that TTL phrase could be too difficult, so I decided to hide "Keep Records for" option if the checkbox is selected. Now there is only one Stream log when an user selects / deselects the checkbox.

lukecarbis pushed a commit that referenced this pull request Mar 16, 2016
Theme settings for all the default WordPress themes
@lukecarbis lukecarbis merged commit 7c9e8a7 into develop Mar 16, 2016
@lukecarbis lukecarbis deleted the bugfix/issue-828 branch March 16, 2016 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants