Commit Graph

84 Commits

Author SHA1 Message Date
Andrew Nacin a841b68181 When generating a background image thumbnail URL, escape percent signs for the eventual sprintf() call inside get_theme_mod().
props cfinke.
fixes #21241.



git-svn-id: https://develop.svn.wordpress.org/trunk@24630 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-10 04:42:03 +00:00
Andrew Nacin 1b035dc715 Context for 'Attachment' when referring to the background image attachment. props xibe, fixes #23433.
git-svn-id: https://develop.svn.wordpress.org/trunk@24621 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-10 03:07:53 +00:00
Ryan Boren c363aea627 Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767
git-svn-id: https://develop.svn.wordpress.org/trunk@23554 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-01 16:28:40 +00:00
Ryan Boren a6c8efadb9 Change all core API to expect unslashed rather than slashed arguments.
The exceptions to this are update_post_meta() and add_post_meta() which are often used by plugins in POST handlers and will continue accepting slashed data for now.

Introduce wp_upate_post_meta() and wp_add_post_meta() as unslashed alternatives to update_post_meta() and add_post_meta(). These functions could become methods in WP_Post so don't use them too heavily yet.

Remove all escape() calls from wp_xmlrpc_server. Now that core expects unslashed data this is no longer needed.

Remove addslashes(), addslashes_gpc(), add_magic_quotes() calls on data being prepared for handoff to core functions that until now expected slashed data. Adding slashes in no longer necessary.

Introduce wp_unslash() and use to it remove slashes from GPCS data before using it in core API. Almost every instance of stripslashes() in core should now be wp_unslash(). In the future (a release or three) when GPCS is no longer slashed, wp_unslash() will stop stripping slashes and simply return what is passed. At this point wp_unslash() calls can be removed from core.

Introduce wp_slash() for slashing GPCS data. This will also turn into a noop once GPCS is no longer slashed. wp_slash() should almost never be used. It is mainly of use in unit tests.

Plugins should use wp_unslash() on data being passed to core API.

Plugins should no longer slash data being passed to core. So when you get_post() and then wp_insert_post() the post data from get_post() no longer needs addslashes(). Most plugins were not bothering with this. They will magically start doing the right thing. Unfortunately, those few souls who did it properly will now have to avoid calling addslashes() for 3.6 and newer.

Use wp_kses_post() and wp_kses_data(), which expect unslashed data, instead of wp_filter_post_kses() and wp_filter_kses(), which expect slashed data. Filters are no longer passed slashed data.

Remove many no longer necessary calls to $wpdb->escape() and esc_sql().

In wp_get_referer() and wp_get_original_referer(), return unslashed data.

Remove old stripslashes() calls from WP_Widget::update() handlers. These haven't been necessary since WP_Widget.

Switch several queries over to prepare().

Expect something to break.

Props alexkingorg
see #21767


git-svn-id: https://develop.svn.wordpress.org/trunk@23416 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-14 22:51:06 +00:00
Andrew Nacin 40274b7956 Fix various typos and omissions across a number of help tabs. props DrewAPicture, Ipstenu. see #22451.
git-svn-id: https://develop.svn.wordpress.org/trunk@22812 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 08:45:15 +00:00
Andrew Nacin d7590ae602 Remove legacy media uploader bits from custom-header.php and custom-background.php. see #22186, #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22778 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 17:44:49 +00:00
Andrew Nacin ba1682a270 Don't allow non-image uploads for custom headers and backgrounds. props kovshenin. fixes #22149.
git-svn-id: https://develop.svn.wordpress.org/trunk@22521 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-10 05:36:37 +00:00
Daryl Koopersmith db0ad6a120 Custom Background: Remove dead code for thickbox. see #21818, #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22503 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-09 11:48:33 +00:00
Daryl Koopersmith 9c1f2e577a Integrate media with the custom background page. fixes #21818, see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22502 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-09 11:37:24 +00:00
Ryan Boren 26fcee62ea Update help text for color picker in custom header and background screens.
Props DrewAPicture
fixes #22393


git-svn-id: https://develop.svn.wordpress.org/trunk@22470 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-08 19:32:49 +00:00
Andrew Nacin e2f0bcf510 Proper button heights on the custom header and background pages. props johnbillion. fixes #22385.
git-svn-id: https://develop.svn.wordpress.org/trunk@22462 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-08 01:51:05 +00:00
Andrew Nacin 85efa182f7 Forms with the class .wp-upload-form will now have their submit button disabled until a file is selected. props kovshenin, helenyhou, lessbloat, SergeyBiryukov, tommcfarlin. fixes #20855.
git-svn-id: https://develop.svn.wordpress.org/trunk@22459 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-07 23:54:03 +00:00
Andrew Nacin 4e9d8d363e New color picker, props mattwiebe. see #21206.
Replaces Farbtastic. May change further in response to user testing.



git-svn-id: https://develop.svn.wordpress.org/trunk@22030 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-27 01:57:38 +00:00
Andrew Nacin 1c58ef9f33 Updates and fixes to the new button styles. By default, buttons are now the same size as they were in 3.4. Then there is a smaller button (designed for minor elements) and a larger button (designed for things like Publish and Save Changes). Better focus styles. props lessbloat. see #21598.
git-svn-id: https://develop.svn.wordpress.org/trunk@21944 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-21 19:34:23 +00:00
Ryan Boren 48a3ec24c5 Pinking shears
git-svn-id: https://develop.svn.wordpress.org/trunk@21070 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-12 19:27:41 +00:00
Ryan Boren a24c284403 * Introduce remove_header_image(), reset_header_image(), set_header_image(), and get_header_image_data() for Custom_Image_Header.
* Handle all set/get of header theme mod through these methods.
* Use these methods in the customizer.

Props kovshenin, nacin, SergeyBiryukov, koopersmith.
fixes #20871


git-svn-id: https://develop.svn.wordpress.org/trunk@21037 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-10 00:32:19 +00:00
Ryan Boren 8f4c41a2dd Check context before adding media upload filters. Props SergeyBiryukov. fixes #20819
git-svn-id: https://develop.svn.wordpress.org/trunk@21009 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-06 16:48:53 +00:00
Andrew Nacin d8c375fd4e When the current image is the default image, don't show buttons to restore to that image, for both custom headers and backgrounds. props mfields, SergeyBiryukov. fixes #20763.
git-svn-id: https://develop.svn.wordpress.org/trunk@20966 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-30 21:58:27 +00:00
Andrew Nacin 85eb57bd89 Preview by default the registered default image for custom backgrounds. props mfields, billerickson.
If there is a default color registered, show a 'Default' action rather than a 'Clear' action, as clearing the value would simply return to the default.

Make current_theme_supports() accept a second argument for 'custom-background' requests, the same as get_theme_support(). Missed in earlier changes, see #20249.

fixes #20734, fixes #18041.



git-svn-id: https://develop.svn.wordpress.org/trunk@20901 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-25 17:58:57 +00:00
Andrew Nacin 635c3a83e9 Move from 'Upload Image' to 'Select Image' as this section now includes choosing an image from the media library. see #20737.
git-svn-id: https://develop.svn.wordpress.org/trunk@20885 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-24 21:07:39 +00:00
Ryan Boren bdad6e911b Improve appearance of "choose from library" link for headers and backgrounds. Props SergeyBiryukov, sabreuse. see #20737
git-svn-id: https://develop.svn.wordpress.org/trunk@20884 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-24 21:03:38 +00:00
Ryan Boren 8e75e8ce49 Feature pointers for choosing an image from the library on the custom header and background pages. see #20554
git-svn-id: https://develop.svn.wordpress.org/trunk@20839 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-21 20:34:20 +00:00
Ryan Boren bb4ab7e842 set_url_scheme() for header and background image srcs. see #20702
git-svn-id: https://develop.svn.wordpress.org/trunk@20830 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-18 20:22:57 +00:00
Ryan Boren fe7d612b97 Use correct translation function. Props kobenland, SergeyBiryukov. fixes #20646
git-svn-id: https://develop.svn.wordpress.org/trunk@20757 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-09 21:13:22 +00:00
Ryan Boren 485e7bc261 Allow selecting custom header and background images from the media library. Props aaroncampbell, sabreuse, greuben. fixes #19840
git-svn-id: https://develop.svn.wordpress.org/trunk@20358 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-05 00:20:28 +00:00
Andrew Nacin 070a9e5c59 Introduce new registration methods for custom headers and custom backgrounds. Backwards compatible, but old methods will be deprecated. see #20249. see #17242.
Custom header: Use add_theme_support('custom-header', $args) instead of add_custom_image_header(). Deprecates all use of constants.
 * HEADER_TEXTCOLOR is now (string) 'default-text-color'.
 * NO_HEADER_TEXT is nowi ! (bool) 'header-text'.
 * HEADER_IMAGE_WIDTH (and _HEIGHT) are now (int) 'width' and 'height'.
 * HEADER_IMAGE is now (string) 'default-image'.
 * The 3.4 arguments 'suggested-width' and 'suggested-height' are now just 'width' and 'height' (they are "suggested" when flex-width and flex-height are set).
 * Callback arguments for add_custom_image_header() can now be passed to add_theme_support().

Custom background: Use add_theme_support('custom-background, $args) instead of add_custom_background(). Deprecates all use of constants.
 * BACKGROUND_COLOR is now (string) 'default-color'.
 * BACKGROUND_IMAGE is now (string) 'default-image'.
 * Callback arguments for add_custom_background() can now be passed to add_theme_support().

Inheritance: add_theme_support() arguments for custom headers and custom backgrounds is a first-one-wins situation. This is not an unusual paradigm for theming as a child theme (which is included first) overrides a parent theme.
 * Once an argument is explicitly set, it cannot be overridden. You must hook in earlier and set it first.
 * Any argument that is not explicitly set before WP is loaded will inherit the default value for that argument.
 * It is therefore possible for a child theme to pass minimal arguments as long as the parent theme specifies others that may be necessary.
 * Allows for a child theme to alter callbacks for <head> and preview (previously, calling add_custom_image_header more than once broke things).
 * The just-in-time bits ensure that arguments fall back to default values, that the values of all constants are considered (such as one defined after an old add_custom_image_header call), and that all constants are defined (so as to be backwards compatible).

get_theme_support(): Introduce new second argument, which headers and backgrounds leverage to return an argument. current_theme_supports() already supported checking the truthiness of the argument.
 * For example, get_theme_support( 'custom-header', 'width' ) will return the width specified during registration.
 * If you had wanted the default image, use get_theme_support( 'custom-header', 'default-image' ) instead of HEADER_IMAGE. 

Deprecate remove_custom_image_header(), remove_custom_background(). Use remove_theme_support('custom-header'), 'custom-background'.

Deprecate short-lived custom-header-uploads internal support; this is now (bool) 'uploads' for add_theme_support().

New 3.4 functions renamed or removed: Rename get_current_header_data() to get_custom_header(). Remove get_header_image_width() and _height() in favor of get_custom_header()->width and height.



git-svn-id: https://develop.svn.wordpress.org/trunk@20212 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-19 17:12:44 +00:00
Ryan Boren 2b186b0c45 Lose EOF ?>. Clean up EOF newlines. fixes #12307
git-svn-id: https://develop.svn.wordpress.org/trunk@19712 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-08 17:01:11 +00:00
Andrew Nacin 030e0764b5 Standardize some final help strings. We're done, aside from typos. props zeo, jane, duck_, fixes #19020.
git-svn-id: https://develop.svn.wordpress.org/trunk@19538 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-02 04:31:01 +00:00
Ryan Boren 0cd6ddb43d Fix indent. see #19020
git-svn-id: https://develop.svn.wordpress.org/trunk@19515 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-01 02:28:47 +00:00
Ryan Boren 9f8cbd8efc Use WP_Screen::add_help_tab(). see #19020
git-svn-id: https://develop.svn.wordpress.org/trunk@19514 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-01 02:22:07 +00:00
Andrew Nacin 29bacb72f0 Help tweaks for themes, plugins screens. props jane, see #19020.
git-svn-id: https://develop.svn.wordpress.org/trunk@19510 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-01 01:24:39 +00:00
Andrew Nacin 33ee9a7d04 s/add_help_sidebar/set_help_sidebar/g and introduce screen->remove_help_tab($id) and screen->remove_help_tabs(). see #19020, #18785.
git-svn-id: https://develop.svn.wordpress.org/trunk@19119 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-02 20:14:10 +00:00
Ryan Boren db63861af8 Use add_help_sidebar(). see #19020
git-svn-id: https://develop.svn.wordpress.org/trunk@19111 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-02 03:12:37 +00:00
Andrew Nacin 182fa5fc58 Fix attribute spacing. props mfields, fixes #18570.
git-svn-id: https://develop.svn.wordpress.org/trunk@18648 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-07 13:53:02 +00:00
Ryan Boren ccba8dfbf3 Validation fixes. Props ocean90, peaceablewhale. see #17364
git-svn-id: https://develop.svn.wordpress.org/trunk@18010 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-23 23:33:30 +00:00
Ryan Boren da02537bb0 Mark import attachments as private. Schedule job to delete old import attachments. Introduce attachment context.
git-svn-id: https://develop.svn.wordpress.org/trunk@17999 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-22 23:25:28 +00:00
Andrew Nacin 368cb001de Add clear to custom background color field. props lancewillett for initial patch. fixes #15755.
git-svn-id: https://develop.svn.wordpress.org/trunk@17886 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-12 03:31:01 +00:00
Ryan Boren a5572fa5ef Denote images that are headers or backgrounds in the media ui. Props ocean90. fixes #17291
git-svn-id: https://develop.svn.wordpress.org/trunk@17793 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-04 18:28:31 +00:00
Ryan Boren 9730cb8d15 Constructor cleanup. Props ocean90. fixes #16768
git-svn-id: https://develop.svn.wordpress.org/trunk@17771 602fd350-edb4-49c9-b593-d223f7449a82
2011-04-29 20:05:12 +00:00
Andrew Nacin f504e221e1 Switch from Panel/SubPanel to Screen in inline documentation and Codex links. props michaelh, fixes #17265.
git-svn-id: https://develop.svn.wordpress.org/trunk@17748 602fd350-edb4-49c9-b593-d223f7449a82
2011-04-28 15:24:49 +00:00
Ryan Boren 36a4508140 Update since phpdoc. Props demetris. fixes #15445
git-svn-id: https://develop.svn.wordpress.org/trunk@16660 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-01 19:24:38 +00:00
Mark Jaquith d65cdf4ba8 Expand submit_button() capabilities. Replace all (or almost all) manual HTML instances in WP. props sbressler. see #15064
git-svn-id: https://develop.svn.wordpress.org/trunk@16061 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-28 21:56:43 +00:00
scribu 0911aa3e1a Use submit_button() in more places. See #15064
git-svn-id: https://develop.svn.wordpress.org/trunk@15830 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-17 18:24:34 +00:00
Andrew Nacin af29b5d5cf phpdoc, @since, whitespace. Also require an argument in wp_insert_post(). props duck_, see #14783.
git-svn-id: https://develop.svn.wordpress.org/trunk@15564 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-05 02:45:39 +00:00
Andrew Nacin 616e2e1185 Missing links for custom background, header, and GUU. props zeo.
git-svn-id: https://develop.svn.wordpress.org/trunk@15231 602fd350-edb4-49c9-b593-d223f7449a82
2010-06-11 18:00:29 +00:00
Andrew Nacin 2621ba04fe Improve the custom background front-end callback. Also, background-attachment should default to scroll, not fixed. fixes #13751.
git-svn-id: https://develop.svn.wordpress.org/trunk@15196 602fd350-edb4-49c9-b593-d223f7449a82
2010-06-10 18:28:25 +00:00
Andrew Nacin e89212637d Help whitespace/punctuation cleanup. props zeo, see #13467.
git-svn-id: https://develop.svn.wordpress.org/trunk@15054 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-29 16:16:40 +00:00
Andrew Nacin 17a9a2bcdc The 'Help' tab on the custom background page should have, you know, custom background help. Oops. see #13467
git-svn-id: https://develop.svn.wordpress.org/trunk@15020 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-28 00:31:16 +00:00
Andrew Nacin e9f6f2d13b Custom header and background help. props jane, see #13467.
git-svn-id: https://develop.svn.wordpress.org/trunk@15019 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-28 00:27:53 +00:00
Andrew Nacin 28c54a5e20 Custom background UI tweaks. Make 'Select Color' a link instead of a button, move color below the background image options, standardize screen reader text.
git-svn-id: https://develop.svn.wordpress.org/trunk@15016 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-28 00:01:59 +00:00