Commit Graph

89 Commits

Author SHA1 Message Date
Andrew Nacin 5361a8abca Spell out duplicate hook locations.
props DrewAPicture.
fixes #25658.

Built from https://develop.svn.wordpress.org/trunk@25868


git-svn-id: http://core.svn.wordpress.org/trunk@25868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:59:20 +00:00
Andrew Nacin 8ae8e01b67 Remove the old wp_auto_updates_maybe_update cron event. Schedule the new wp_maybe_auto_update event at 7 a.m. and 7 p.m. in the site's timezone.
see #27704.

Built from https://develop.svn.wordpress.org/trunk@25825


git-svn-id: http://core.svn.wordpress.org/trunk@25825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:53:14 +00:00
Andrew Nacin 74488bdcb0 Spell out duplicate hook locations.
props DrewAPicture.
fixes #25658.

Built from https://develop.svn.wordpress.org/trunk@25868


git-svn-id: http://core.svn.wordpress.org/trunk@25780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-22 17:22:11 +00:00
Andrew Nacin e17beb58f7 Mark the hooks in custom-background.php as duplicates.
* image_size_names_choose should be documented in wp-includes/media.php
 * wp_create_file_in_uploads should be documented in custom-header.php

see #25229.

Built from https://develop.svn.wordpress.org/trunk@25283


git-svn-id: http://core.svn.wordpress.org/trunk@25247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-06 17:05:09 +00:00
Scott Taylor 31f26dc3ce Remove lingering instances of call time pass-by-reference, limited to instances of `callable` - use `$this` instead of `&$this`.
Props jdgrimes.
See #25160.


Built from https://develop.svn.wordpress.org/trunk@25254


git-svn-id: http://core.svn.wordpress.org/trunk@25222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-05 16:34:09 +00:00
Andrew Nacin 043f19b1dc 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: http://core.svn.wordpress.org/trunk@24630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-10 04:42:03 +00:00
Andrew Nacin e6afcb4aa2 Context for 'Attachment' when referring to the background image attachment. props xibe, fixes #23433.
git-svn-id: http://core.svn.wordpress.org/trunk@24621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-10 03:07:53 +00:00
Ryan Boren 43a7e695e9 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: http://core.svn.wordpress.org/trunk@23554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 16:28:40 +00:00
Ryan Boren cc5ed3a485 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: http://core.svn.wordpress.org/trunk@23416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-14 22:51:06 +00:00
Andrew Nacin 9bba27f4e5 Fix various typos and omissions across a number of help tabs. props DrewAPicture, Ipstenu. see #22451.
git-svn-id: http://core.svn.wordpress.org/trunk@22812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-22 08:45:15 +00:00
Andrew Nacin dfb844b64b Remove legacy media uploader bits from custom-header.php and custom-background.php. see #22186, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 17:44:49 +00:00
Andrew Nacin e14ff50cfb Don't allow non-image uploads for custom headers and backgrounds. props kovshenin. fixes #22149.
git-svn-id: http://core.svn.wordpress.org/trunk@22521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-10 05:36:37 +00:00
Daryl Koopersmith bda841315a Custom Background: Remove dead code for thickbox. see #21818, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 11:48:33 +00:00
Daryl Koopersmith 15a749c6fd Integrate media with the custom background page. fixes #21818, see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 11:37:24 +00:00
Ryan Boren b8140cf35e Update help text for color picker in custom header and background screens.
Props DrewAPicture
fixes #22393


git-svn-id: http://core.svn.wordpress.org/trunk@22470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-08 19:32:49 +00:00
Andrew Nacin f466722928 Proper button heights on the custom header and background pages. props johnbillion. fixes #22385.
git-svn-id: http://core.svn.wordpress.org/trunk@22462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-08 01:51:05 +00:00
Andrew Nacin b9b9ebeeae 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: http://core.svn.wordpress.org/trunk@22459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 23:54:03 +00:00
Andrew Nacin 0b6cf76853 New color picker, props mattwiebe. see #21206.
Replaces Farbtastic. May change further in response to user testing.



git-svn-id: http://core.svn.wordpress.org/trunk@22030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-27 01:57:38 +00:00
Andrew Nacin c1b0670c2d 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: http://core.svn.wordpress.org/trunk@21944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-21 19:34:23 +00:00
ryan 2f3839da9c Pinking shears
git-svn-id: http://core.svn.wordpress.org/trunk@21070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-12 19:27:41 +00:00
ryan 808ce796ae * 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: http://core.svn.wordpress.org/trunk@21037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-10 00:32:19 +00:00
ryan 23104564f0 Check context before adding media upload filters. Props SergeyBiryukov. fixes #20819
git-svn-id: http://core.svn.wordpress.org/trunk@21009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-06 16:48:53 +00:00
nacin b545454ceb 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: http://core.svn.wordpress.org/trunk@20966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-30 21:58:27 +00:00
nacin afad27974e 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: http://core.svn.wordpress.org/trunk@20901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-25 17:58:57 +00:00
nacin 92423061e4 Move from 'Upload Image' to 'Select Image' as this section now includes choosing an image from the media library. see #20737.
git-svn-id: http://core.svn.wordpress.org/trunk@20885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-24 21:07:39 +00:00
ryan 4cad786961 Improve appearance of "choose from library" link for headers and backgrounds. Props SergeyBiryukov, sabreuse. see #20737
git-svn-id: http://core.svn.wordpress.org/trunk@20884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-24 21:03:38 +00:00
ryan 17f9635a45 Feature pointers for choosing an image from the library on the custom header and background pages. see #20554
git-svn-id: http://core.svn.wordpress.org/trunk@20839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-21 20:34:20 +00:00
ryan 15b9961b52 set_url_scheme() for header and background image srcs. see #20702
git-svn-id: http://core.svn.wordpress.org/trunk@20830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-18 20:22:57 +00:00
ryan 7e3010ef46 Use correct translation function. Props kobenland, SergeyBiryukov. fixes #20646
git-svn-id: http://core.svn.wordpress.org/trunk@20757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-09 21:13:22 +00:00
ryan d3134e2688 Allow selecting custom header and background images from the media library. Props aaroncampbell, sabreuse, greuben. fixes #19840
git-svn-id: http://svn.automattic.com/wordpress/trunk@20358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-05 00:20:28 +00:00
nacin 6593186cb7 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: http://svn.automattic.com/wordpress/trunk@20212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-19 17:12:44 +00:00
ryan e3b46b25d3 Lose EOF ?>. Clean up EOF newlines. fixes #12307
git-svn-id: http://svn.automattic.com/wordpress/trunk@19712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-08 17:01:11 +00:00
nacin 15ceab2647 Standardize some final help strings. We're done, aside from typos. props zeo, jane, duck_, fixes #19020.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-02 04:31:01 +00:00
ryan 32915a8574 Fix indent. see #19020
git-svn-id: http://svn.automattic.com/wordpress/trunk@19515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-01 02:28:47 +00:00
ryan 8ace5a6b4c Use WP_Screen::add_help_tab(). see #19020
git-svn-id: http://svn.automattic.com/wordpress/trunk@19514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-01 02:22:07 +00:00
nacin 65a10cedbb Help tweaks for themes, plugins screens. props jane, see #19020.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-01 01:24:39 +00:00
nacin bfb98c193e 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: http://svn.automattic.com/wordpress/trunk@19119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-02 20:14:10 +00:00
ryan 3ad1f67958 Use add_help_sidebar(). see #19020
git-svn-id: http://svn.automattic.com/wordpress/trunk@19111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-02 03:12:37 +00:00
nacin fab91dd3d0 Fix attribute spacing. props mfields, fixes #18570.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-07 13:53:02 +00:00
ryan 8192d0dae8 Validation fixes. Props ocean90, peaceablewhale. see #17364
git-svn-id: http://svn.automattic.com/wordpress/trunk@18010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-23 23:33:30 +00:00
ryan 2cfb1592f0 Mark import attachments as private. Schedule job to delete old import attachments. Introduce attachment context.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-22 23:25:28 +00:00
nacin e324f8dd88 Add clear to custom background color field. props lancewillett for initial patch. fixes #15755.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-12 03:31:01 +00:00
ryan d55f5b35af Denote images that are headers or backgrounds in the media ui. Props ocean90. fixes #17291
git-svn-id: http://svn.automattic.com/wordpress/trunk@17793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-04 18:28:31 +00:00
ryan 04487fc268 Constructor cleanup. Props ocean90. fixes #16768
git-svn-id: http://svn.automattic.com/wordpress/trunk@17771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-29 20:05:12 +00:00
nacin 9cb6e158fc Switch from Panel/SubPanel to Screen in inline documentation and Codex links. props michaelh, fixes #17265.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-28 15:24:49 +00:00
ryan 3f72e340d6 Update since phpdoc. Props demetris. fixes #15445
git-svn-id: http://svn.automattic.com/wordpress/trunk@16660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-01 19:24:38 +00:00
markjaquith fc6e89da45 Expand submit_button() capabilities. Replace all (or almost all) manual HTML instances in WP. props sbressler. see #15064
git-svn-id: http://svn.automattic.com/wordpress/trunk@16061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-28 21:56:43 +00:00
scribu 799baf139c Use submit_button() in more places. See #15064
git-svn-id: http://svn.automattic.com/wordpress/trunk@15830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-17 18:24:34 +00:00
nacin 15bc341696 phpdoc, @since, whitespace. Also require an argument in wp_insert_post(). props duck_, see #14783.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-05 02:45:39 +00:00
nacin 0a30928ce3 Missing links for custom background, header, and GUU. props zeo.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-11 18:00:29 +00:00