Commit Graph

49 Commits

Author SHA1 Message Date
Sergey Biryukov ece505b122 Remove redundant echo calls from list tables. Don't mix string concatenation with direct output. see #24210.
git-svn-id: https://develop.svn.wordpress.org/trunk@24123 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-29 01:10:50 +00:00
Ryan Boren 4088ca8723 Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().
see #21767


git-svn-id: https://develop.svn.wordpress.org/trunk@23563 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-01 17:00:25 +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
Helen Hou-Sandi 1303e7377a its <=> it's in documentation, along with a rogue the, The, and looses. props trepmal. fixes #22665.
git-svn-id: https://develop.svn.wordpress.org/trunk@23191 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-20 15:55:32 +00:00
Andrew Nacin 3f57bfeb9d Use correct variable. see #17860.
git-svn-id: https://develop.svn.wordpress.org/trunk@22689 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-19 21:43:47 +00:00
Andrew Nacin 6a9c6e8543 Less insane multiple role handling in the users list table.
If the user has more than one role, opt to show the first role that is
'editable', if present. Otherwise, fall back to the remaining roles.

In the future, we should show a comma-separated list of all roles,
editable or otherwise, and this list should be filterable, either by user,
or by the roles which can appear. Probably both.

In multisite, only hide users that have no capabilities (in case they
possess a leftover, empty wp_xx_capabilities key from the MU days),
not users that have no role, as they may have a cap but no role.

see #22361. fixes #17860.



git-svn-id: https://develop.svn.wordpress.org/trunk@22686 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-19 19:16:31 +00:00
Andrew Nacin e6ca72f48a Fix the 'Change' button in the users list table. props c3mdigital. fixes #22034.
git-svn-id: https://develop.svn.wordpress.org/trunk@22423 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-07 18:34:46 +00:00
Andrew Nacin 4cf1dbe0f8 restrict_manage_users action. props jakemgold, johnjamesjacoby. fixes #19295.
git-svn-id: https://develop.svn.wordpress.org/trunk@22414 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-07 07:59:46 +00:00
Ryan Boren 7c52a19a5a Reduce reliance on global variables in the list tables. Allow passing a screen ID to the list tables so that ajax handlers can set the needed screen.
Props nacin
fixes #21871


git-svn-id: https://develop.svn.wordpress.org/trunk@21914 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-19 12:43:31 +00:00
Andrew Nacin 50daa191c2 Trim incoming searches on the users list table. props tollmanz. fixes #21318.
git-svn-id: https://develop.svn.wordpress.org/trunk@21864 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-16 16:11:01 +00:00
Daryl Koopersmith 7d6e53317c New button styles.
Using the new buttons:

* Button classes are now stackable.
* All buttons should use a base class of "button".
* Buttons default to the gray style (formerly "button-secondary"). Buttons can add a style by adding additional classes. To make a primary button, add the "button-primary" class.
* Buttons can be rendered in various sizes. In addition to the default size, you can add "button-large", "button-small", or "button-tiny".

For backwards compatibility reasons, "button-primary" and "button-secondary" both work as standalone classes.

get_submit_button() has been adjusted to handle shorthand button classes (i.e. button classes can be passed without the "button-" prefix).

props lessbloat, helenyhou, trepmal, nacin. see #21598.



git-svn-id: https://develop.svn.wordpress.org/trunk@21789 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-08 04:58:34 +00:00
Andrew Nacin a5c7405975 Move most instances of new WP_User to get_userdata(). see #21120.
git-svn-id: https://develop.svn.wordpress.org/trunk@21413 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-03 01:06:05 +00:00
Ryan Boren d2774833b2 Introduce get_edit_user_link(). Props scribu, georgestephanis, johnbillion. fixes #14787 see #20307
git-svn-id: https://develop.svn.wordpress.org/trunk@21364 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-30 18:30:03 +00:00
Ryan Boren dd15327790 More screen reader text for list table checkboxes and theme install search. Props MikeLittle, SergeyBiryukov. see #21325
git-svn-id: https://develop.svn.wordpress.org/trunk@21323 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-25 16:18:14 +00:00
Ryan Boren c47eef91e0 Add screen reader text to checkboxes in list tables. Props MikeLittle, nacin. see #21325
git-svn-id: https://develop.svn.wordpress.org/trunk@21317 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-24 18:01:22 +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 676ba7043e Use one space, not two, after trailing punctuation. fixes #19537
git-svn-id: https://develop.svn.wordpress.org/trunk@19593 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-13 23:45:31 +00:00
Andrew Nacin c2cf751035 number_format_i18n for role user counts. props sirzooro, fixes #18305.
git-svn-id: https://develop.svn.wordpress.org/trunk@18735 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-21 05:35:57 +00:00
Ryan Boren 1d3e616495 Introduce metadata_exists(), WP_User::get_data_by(), WP_User::get(), WP_User::has_prop(). Don't fill user objects with meta. Eliminate data duplication in cache and memory. Props scribu. see #15458
git-svn-id: https://develop.svn.wordpress.org/trunk@18597 602fd350-edb4-49c9-b593-d223f7449a82
2011-08-24 19:32:59 +00:00
Ryan Boren 4efc4641ac Don't add search wildcards to an empty string. fixes #17719
git-svn-id: https://develop.svn.wordpress.org/trunk@18179 602fd350-edb4-49c9-b593-d223f7449a82
2011-06-07 16:05:04 +00:00
Ryan Boren 332d95b648 Validation fixes. Props ocean90, xknown. fixes #17364
git-svn-id: https://develop.svn.wordpress.org/trunk@18114 602fd350-edb4-49c9-b593-d223f7449a82
2011-06-02 17:05:55 +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 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
Ryan Boren e431f630a2 Disallow and hide user removal (as opposed to deletion) for single site installs. Removal is a multisite concept. Props nacin. fixes #16501 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@17439 602fd350-edb4-49c9-b593-d223f7449a82
2011-02-10 20:37:26 +00:00
Ryan Boren 7c37c82691 Add additional promote_users checks. Show Add existing button only for multisite. Don't show bulk actions if user can't promote users. Show add new user menu if user has create_users but not promote_users. Props nacin. fixes #16501 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@17431 602fd350-edb4-49c9-b593-d223f7449a82
2011-02-09 17:30:26 +00:00
Mark Jaquith 5a60e327c2 Fix the "Back to Authors and Users" link on Edit Users page. props SergeyBiryukov. fixes #16275
git-svn-id: https://develop.svn.wordpress.org/trunk@17324 602fd350-edb4-49c9-b593-d223f7449a82
2011-01-17 23:36:23 +00:00
Andrew Nacin 2b4674a3b4 Remove AJAX from list tables. first pass. see #16262.
git-svn-id: https://develop.svn.wordpress.org/trunk@17322 602fd350-edb4-49c9-b593-d223f7449a82
2011-01-16 21:47:24 +00:00
Andrew Nacin 8030796b65 Remove assignment that is later overridden. props PeteMall.
git-svn-id: https://develop.svn.wordpress.org/trunk@17319 602fd350-edb4-49c9-b593-d223f7449a82
2011-01-16 05:47:21 +00:00
Ryan Boren a0a77f0380 Default to leading and trailing wildcards for site user searches. Require explicit trailing wildcard asterisk request for network user searches. Disallow leading wildcards for network user searches. Move wildcard policy up the stake, allowing more flexibility in WP_User_Query. Props SergeyBiryukov. fixes #16014
git-svn-id: https://develop.svn.wordpress.org/trunk@17189 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-30 23:38:21 +00:00
Ryan Boren 34ef8c8df9 Translations in title attributes require esc_attr().
git-svn-id: https://develop.svn.wordpress.org/trunk@17102 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-21 17:17:58 +00:00
scribu e58993fe2e Disable sorting by post count for now. See #15861
git-svn-id: https://develop.svn.wordpress.org/trunk@17024 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-17 10:25:27 +00:00
scribu e452616f40 Make WP_User_Query return regular objects by default. Fixes #15854
git-svn-id: https://develop.svn.wordpress.org/trunk@17013 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-17 00:38:15 +00:00
Andrew Nacin 266cd3f5df Replace check_permissions() with ajax_user_can(). New method returns true/false to current_user_can(), which we then handle in admin ajax. see #15326.
git-svn-id: https://develop.svn.wordpress.org/trunk@16992 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-16 09:18:28 +00:00
Andrew Nacin afecafe7ab Remove check_permissions() calls outside of AJAX context. Also only check for switch_themes in check_permissions() for the themes table. see #15326.
git-svn-id: https://develop.svn.wordpress.org/trunk@16990 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-16 08:43:22 +00:00
Ryan Boren 6dc2d07bc4 Pink trailing whites.
git-svn-id: https://develop.svn.wordpress.org/trunk@16900 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-13 21:21:50 +00:00
Andrew Nacin 19677466aa Fix logic inversion. see #15699.
git-svn-id: https://develop.svn.wordpress.org/trunk@16794 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-08 09:28:20 +00:00
Andrew Nacin aa29bef29a Don't check post counts in the network admin. props scribu, fixes #15699.
git-svn-id: https://develop.svn.wordpress.org/trunk@16775 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-07 20:54:04 +00:00
Pete Mall 7f3b087f38 Hide posts column for site-users. Props ocean90, see #15558
git-svn-id: https://develop.svn.wordpress.org/trunk@16573 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-24 19:51:36 +00:00
Pete Mall 0b83b57a70 Add screen option in site-users. Props duck_, see #15558
git-svn-id: https://develop.svn.wordpress.org/trunk@16570 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-24 16:54:53 +00:00
Pete Mall ac67c65fe4 Adapt user-list-table for network admin site-users. See #15558
git-svn-id: https://develop.svn.wordpress.org/trunk@16560 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-24 05:31:25 +00:00
scribu ef9b5fb1ec Document url_shorten() and use in more places. Props latz for initial patch. Fixes #15540
git-svn-id: https://develop.svn.wordpress.org/trunk@16536 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-22 17:17:31 +00:00
Andrew Nacin 862dabded8 s/Login/Username/ to restore 3.0 string. props demetris, fixes #15453.
git-svn-id: https://develop.svn.wordpress.org/trunk@16428 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-17 16:58:15 +00:00
scribu 83cfc820ce Make manage_users_custom_column hook consistent between WP_(MS)?_Users_List_Table. Fixes #14562
git-svn-id: https://develop.svn.wordpress.org/trunk@16354 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-13 20:47:34 +00:00
scribu a1c670189d remove leading <li> from get_views() and add it later. Fixes #15321
git-svn-id: https://develop.svn.wordpress.org/trunk@16205 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-05 14:34:09 +00:00
scribu 7edd2f0090 Default to get_current_screen() in list table classes. See #14579
git-svn-id: https://develop.svn.wordpress.org/trunk@16182 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-04 15:00:55 +00:00
Peter Westwood 817aa1975c Revert [16171] and [16172] - The class names were fine as they were and the MultiSite classes stand out more with the original naming.
git-svn-id: https://develop.svn.wordpress.org/trunk@16175 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-04 08:07:03 +00:00
scribu ed884411fe List-table Class Names: Consistency's Revenge. See #14579
git-svn-id: https://develop.svn.wordpress.org/trunk@16171 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-03 21:09:27 +00:00
Peter Westwood c4633bbd54 The big renaming of the list-table class files.
See #14579

git-svn-id: https://develop.svn.wordpress.org/trunk@16128 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-01 09:19:50 +00:00