Commit Graph

45 Commits

Author SHA1 Message Date
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
Ryan Boren b5904b9525 Restrict the media editor to posts with the attachment post type. Props helenyhou. fixes #20625
git-svn-id: https://develop.svn.wordpress.org/trunk@20753 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-09 16:16:03 +00:00
Andrew Ozz e032e94c4f Don't hide links to the upload form and show an error for mobile devices that cannot upload, see #20410
git-svn-id: https://develop.svn.wordpress.org/trunk@20449 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-12 00:16:37 +00:00
Andrew Ozz 69eca59eba Consistently remove links to media-new.php for mobile devices, props SergeyBiryukov, see #20405
git-svn-id: https://develop.svn.wordpress.org/trunk@20422 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-10 03:18:48 +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
Ryan Boren 5e76729992 One newline is enough.
git-svn-id: https://develop.svn.wordpress.org/trunk@19684 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-05 20:10:39 +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 4cb3487019 More help sidebars. see #19020.
git-svn-id: https://develop.svn.wordpress.org/trunk@19121 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-02 20:54:56 +00:00
Andrew Nacin 4ae79da741 Add 'Add New' buttons to edit links, edit media, and edit user screens. props sbressler, fixes #17499.
git-svn-id: https://develop.svn.wordpress.org/trunk@17975 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-19 19:52:11 +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 dc673fbccd Fix media form error display. Props andyblackwell. fixes #13810
git-svn-id: https://develop.svn.wordpress.org/trunk@16812 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-08 19:44:48 +00:00
Ryan Boren 4b33a0e9c4 Pinking shears
git-svn-id: https://develop.svn.wordpress.org/trunk@16438 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-17 18:47:34 +00:00
Ryan Boren 2ac45785a3 Contextual help updates. Props dougwrites. see #15346
git-svn-id: https://develop.svn.wordpress.org/trunk@16326 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-12 15:03:34 +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
Dion Hulse 82443ce769 Use Absolute URL's & API's in header redirects in more locations. See #14062
git-svn-id: https://develop.svn.wordpress.org/trunk@16008 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-27 10:43: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 ec4f5b83bf Use relative paths when including files, avoiding include_path. fixes #12594, props sorich87.
git-svn-id: https://develop.svn.wordpress.org/trunk@14139 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-18 06:14:45 +00:00
Andrew Nacin 6bee083b27 Remove unnecessary action attribute on a form. It should always post to itself. fixes #12165
git-svn-id: https://develop.svn.wordpress.org/trunk@13521 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-01 01:09:29 +00:00
Andrew Ozz 060d9185e6 Remove unused .fade CSS class, props nacin, fixes #11628
git-svn-id: https://develop.svn.wordpress.org/trunk@12546 602fd350-edb4-49c9-b593-d223f7449a82
2009-12-26 09:00:58 +00:00
Matt Mullenweg d94f8b9331 More cleanup of the edit media screen:
* Simplified table to not need rowspan, and other markup where possible.
* Put more elements in a paragraph tag for better spacing.
* Brought edit image buton under the image.
* Everything is now in line with WordPress Coding Standards, particularly with regards to spacing and attribute quotes.
* Minor styling for better alignment.

TODO: We show the file URL here, but for images we should show the URL to each size, with its dimensions.



git-svn-id: https://develop.svn.wordpress.org/trunk@12543 602fd350-edb4-49c9-b593-d223f7449a82
2009-12-25 23:04:48 +00:00
Matt Mullenweg 8fa4b51cb6 Media editing: When you have many custom taxonomies this page can get rather long, or just normally, so adding a "save" button to the top as well, for easy access.
There was no place on this page that actually linked to the item being edited, so I hyperinked the thumbnail.


git-svn-id: https://develop.svn.wordpress.org/trunk@12542 602fd350-edb4-49c9-b593-d223f7449a82
2009-12-25 22:22:21 +00:00
Ryan Boren 43c201d458 Remove trailing whitespace
git-svn-id: https://develop.svn.wordpress.org/trunk@11930 602fd350-edb4-49c9-b593-d223f7449a82
2009-09-14 14:03:32 +00:00
Andrew Ozz 4f22e99cf5 Image editing (first run). Includes code by stephanreiter, see #10528
git-svn-id: https://develop.svn.wordpress.org/trunk@11911 602fd350-edb4-49c9-b593-d223f7449a82
2009-09-10 22:07:33 +00:00
Andrew Ozz d9f8c67f2f Trash status updates for posts, pages, comments and attachments, props caesarsgrunt, see #4529
git-svn-id: https://develop.svn.wordpress.org/trunk@11749 602fd350-edb4-49c9-b593-d223f7449a82
2009-07-30 13:39:34 +00:00
Mark Jaquith ba1c3bdd5b Deprecate sanitize_url() and clean_url() in favor of esc_url_raw() and esc_url()
git-svn-id: https://develop.svn.wordpress.org/trunk@11383 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-18 16:00:33 +00:00
Andrew Ozz 60fe439618 Add .help css class for the media library, fixes #9790
git-svn-id: https://develop.svn.wordpress.org/trunk@11294 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-12 05:47:46 +00:00
Mark Jaquith c638e8d8de _a(), _ea(), _xa(), attr() are now esc_attr__(), esc_attr_e(), esc_attr_x(), esc_attr() -- still short, but less cryptic. see #9650
git-svn-id: https://develop.svn.wordpress.org/trunk@11204 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-05 19:43:53 +00:00
Ryan Boren 3b7130bbae attr escaping. see #9650
git-svn-id: https://develop.svn.wordpress.org/trunk@11110 602fd350-edb4-49c9-b593-d223f7449a82
2009-04-28 06:37:51 +00:00
Andrew Ozz 6358bca7d2 Notice fixes, props sivel, see #9393
git-svn-id: https://develop.svn.wordpress.org/trunk@11052 602fd350-edb4-49c9-b593-d223f7449a82
2009-04-22 12:24:45 +00:00
Mark Jaquith 00152d6124 Move from generic "Save" to better "Update X", more consistent use of button-primary for major actions. fixes #8374. props azaozz, FFEMTcJ
git-svn-id: https://develop.svn.wordpress.org/trunk@10137 602fd350-edb4-49c9-b593-d223f7449a82
2008-12-09 09:07:36 +00:00
Ryan Boren fd01d86cf8 Reset parent_file after admin_header include to fix screen icon
git-svn-id: https://develop.svn.wordpress.org/trunk@9926 602fd350-edb4-49c9-b593-d223f7449a82
2008-11-27 20:36:01 +00:00
Ryan Boren e17a3ee209 Fix parent
git-svn-id: https://develop.svn.wordpress.org/trunk@9925 602fd350-edb4-49c9-b593-d223f7449a82
2008-11-27 20:28:33 +00:00
Andrew Ozz 0b85e05cda More screen icons and fixes, includes patch by johnconners, fixes #8380
git-svn-id: https://develop.svn.wordpress.org/trunk@9912 602fd350-edb4-49c9-b593-d223f7449a82
2008-11-26 23:35:23 +00:00
Andrew Ozz d8c2d1347a Upload media from the Media Library page.
git-svn-id: https://develop.svn.wordpress.org/trunk@8998 602fd350-edb4-49c9-b593-d223f7449a82
2008-09-27 08:17:55 +00:00
Andrew Ozz ebe59173cd Reattaching of orphan attachments and choose post/page ajaxed search box
git-svn-id: https://develop.svn.wordpress.org/trunk@8901 602fd350-edb4-49c9-b593-d223f7449a82
2008-09-16 04:24:28 +00:00
Peter Westwood ab17f7283c phpdoc for wp-admin. See #7496 props santosj.
git-svn-id: https://develop.svn.wordpress.org/trunk@8645 602fd350-edb4-49c9-b593-d223f7449a82
2008-08-14 06:30:38 +00:00
Ryan Boren 0198c04b6d wp_admin_css() improvements. Props mdawaffe. see #7011
git-svn-id: https://develop.svn.wordpress.org/trunk@7979 602fd350-edb4-49c9-b593-d223f7449a82
2008-05-22 00:06:41 +00:00
Peter Westwood 5c009833e4 Add missing form end tag.
git-svn-id: https://develop.svn.wordpress.org/trunk@7889 602fd350-edb4-49c9-b593-d223f7449a82
2008-05-04 21:31:29 +00:00
Ryan Boren d779fb182e Move cap check up. Props mdawaffe. fixes #6838 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@7829 602fd350-edb4-49c9-b593-d223f7449a82
2008-04-25 15:23:11 +00:00
Ryan Boren 05a2f61a1f Add cap checks. see #6838
git-svn-id: https://develop.svn.wordpress.org/trunk@7827 602fd350-edb4-49c9-b593-d223f7449a82
2008-04-25 15:01:02 +00:00
Ryan Boren 6bda12dfad Redirect back to attachment permalink page after editing attachment via 'Edit This' link.
git-svn-id: https://develop.svn.wordpress.org/trunk@7554 602fd350-edb4-49c9-b593-d223f7449a82
2008-03-27 22:05:51 +00:00
Ryan Boren 0afce7ab24 Media edit and delete redirect fixes. WIP.
git-svn-id: https://develop.svn.wordpress.org/trunk@7542 602fd350-edb4-49c9-b593-d223f7449a82
2008-03-27 01:48:22 +00:00
Ryan Boren 837bf2bd84 Fix warning in media.php. Show sidemenu. Props andy. fixes #6206
git-svn-id: https://develop.svn.wordpress.org/trunk@7346 602fd350-edb4-49c9-b593-d223f7449a82
2008-03-17 18:28:43 +00:00
Ryan Boren df8228fa6c Attachment editing from mdawaffe. fixes #6181
git-svn-id: https://develop.svn.wordpress.org/trunk@7262 602fd350-edb4-49c9-b593-d223f7449a82
2008-03-12 05:50:07 +00:00