WordPress.org

Making WordPress.org

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#2901 closed enhancement (fixed)

Extend the Coming-Soon page customizer options

Reported by: Kau-Boy Owned by: coreymckrill
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords: has-patch dev-feedback
Cc:

Description

As described in the blog post, I want to add a Customizer option to modify the introduction text: https://make.wordpress.org/community/2017/06/15/extend-the-coming-soon-page-customizer-options/

Attachments (3)

2901.diff (4.3 KB) - added by Kau-Boy 8 months ago.
2901.2.diff (4.3 KB) - added by Kau-Boy 8 months ago.
2901.3.diff (4.3 KB) - added by Kau-Boy 8 months ago.

Download all attachments as: .zip

Change History (12)

@Kau-Boy
8 months ago

#1 @coreymckrill
8 months ago

  • Owner set to coreymckrill
  • Status changed from new to accepted

#2 @coreymckrill
8 months ago

@Kau-Boy this looks pretty good. Right now the sanitize_callback is sanitize_text_field, which strips out all HTML. It seems like we would want to be able to have some basic tags allowed so that organizers could, in the example of WCEU, link to the currently running camp. On the other hand, we don't want people dropping huge blocks of HTML into that space. What do you think?

#3 @Kau-Boy
8 months ago

@coreymckrill Oh yeah, you are right. Haven't seen that. I though allowing the HTML tags allowed by the wp_kses_data functions should be OK. How can this be set in the sanitize_callback argument?

#4 @coreymckrill
8 months ago

Hmm. I'll do some research to try and figure out what kind of sanitization needs to happen within textarea fields. It could be that wp_kses_data will work for there too, just like we have for the front end...

@Kau-Boy
8 months ago

@Kau-Boy
8 months ago

#5 @Kau-Boy
8 months ago

Looks good with the wp_kses_post filter for both input and output.

P.S. The attachment upload just added the file twice in a single request. Strange :/

#6 @Kau-Boy
8 months ago

I checked the current meta code and it seems like they all use wp_kses_post for the sanitize_callback.

#7 @coreymckrill
8 months ago

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

In 5603:

WordCamp Coming Soon: Add Customizer field for custom intro message

This adds a new setting and control to the Coming Soon Page section
in the Customizer. Content added to the Custom Message textarea will
replace the default message shown on the Coming Soon page beneath the
header. This allows organizers a bit more flexibility in what they
communicate to site visitors before the site is officially launched.

Fixes #2901
Props Kau-Boy

#8 @coreymckrill
8 months ago

@Kau-Boy thanks for the patch! I ended up going with a different approach for sanitizing the setting value for storage in the db (sanitize_callback). I looked at how textareas are sanitized in the Customizer in Core, namely menu item descriptions, and went with that. The Meta codebase doesn't always reflect the current best practices on some of these things, and I figured Core might be closer to that.

I also changed the label from "Introduction" to "Custom Message" and added a description because I thought it would make the purpose of the field more clear.

#9 @Kau-Boy
8 months ago

Thanks once again for the quick merge and improving my code ;) Nice sanitization callback. I will keep that for my other improvements to come :)

Now we should get the shortcode enhancements done ;) And then up to the invoicing :)

Note: See TracTickets for help on using tickets.