Commit Graph

74 Commits

Author SHA1 Message Date
Helen Hou-Sandí
8eb7f71e6b List tables: A better responsive view.
Instead of truncating columns, the data that's already in the markup can now be toggled into view. Only seems appropriate to celebrate four years of contributing by finally doing the first thing I ever mocked up.

Known issues / concerns:
* Custom list tables that don't define a primary column will show nothing at all. These are not extremely common, as `WP_List_Table` isn't really recommended for plugin consumption, but it happens. We need to come up with some kind of fallback.
* Some visual elements, particularly whitespace, could use refining.
* Needs a11y review.
* Touch performance on iOS feels sluggish - is there anything we can do about that?
* Would this be better accordion-style (only one expanded at a time)?
* Is `wp_strip_all_tags()` good enough for column titles that have HTML in them? It's essentially a workaround for the fact that core's comments column does that for the icon, which maybe it shouldn't. Perhaps worth another ticket, as a markup change would be fairly independent.
* Visual hierarchy is not great when expanded (also worthy of another ticket).
* Quick edit now becomes noticeably more annoying to cancel out of, as you have to scroll all the way down and you lose your position from before it was opened. Again, worthy of another ticket.

props Michael Arestad, helen.
see #32395.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-01 01:31:25 +00:00
Helen Hou-Sandí
c87224eaf6 List tables: Use a class instead of inline styles for hidden columns.
fixes #32608.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-10 19:47:27 +00:00
Helen Hou-Sandí
005d937ce2 List tables:
* Avoid notices in custom list tables that manually set `$_column_headers`. Any plugins using this for a specific purpose should update.
* Restore a special class name in the users list table.

props georgestephanis, stephdau.
see #25408.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-10 01:46:27 +00:00
Konstantin Obenland
c20edc4df5 Remove title attributes in user list tables.
They don't add valuable information and are redundant.
Reduces annoyance for screen reader users.

Props afercia.
Fixes #32535.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-05 08:40:26 +00:00
Drew Jaynes
0df0e0bf36 Fix syntax and add a missing return description for inline documentation introduced in [32644] for WP_Users_List_Table.
See #25408. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-31 01:45:27 +00:00
Scott Taylor
c6a4512b1b Add missing doc blocks to wp-admin/includes/*.
Fix some egregious uses of tabbing.
Some functions can simply return `apply_filters(...)` instead of setting a variable that is immediately returned.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 20:17:26 +00:00
Helen Hou-Sandí
4c0c7fd7ba List tables: introduce the concept of a "primary" column.
This becomes the column that contains the row actions, and allows for a more flexibility, particularly with custom post types and list tables. To (re)define the primary column, use the `list_table_primary_column` filter, which receives the column name and the screen ID as arguments.

props stephdau, DaveAl, jesin.
see #25408.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 02:41:25 +00:00
Scott Taylor
b56b9b3e5c Add @global annotations for wp-admin/*.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-28 21:41:30 +00:00
Drew Jaynes
654ee78c93 Clarify 4.2.0 changelog entry, add global description to the DocBlock for WP_Users_List_Table->single_row().
See #31888.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-04 21:09:27 +00:00
Dominik Schilling
50c2cee32d Merge three similar strings.
props pavelevap.
see #31013.
Built from https://develop.svn.wordpress.org/trunk@31717


git-svn-id: http://core.svn.wordpress.org/trunk@31698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-11 15:25:28 +00:00
Jeremy Felt
7644e68119 Provide proper label associations and descriptions throughout the network admin
* Add labels previously missing for many inputs throughout the network admin screen.
* Add proper `aria-describedby` attributes to provide better descriptions.
* Wrap grouped inputs with `fieldset` elements.
* Remove now unneeded `title` attributes when appropriate.

Props cfoellmann, afercia, rianrietveld.

Fixes #38406.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-23 02:29:26 +00:00
Scott Taylor
fe6b5983df In PHP 5.0.0, is_a() became deprecated in favour of the instanceof operator. Calling is_a() would result in an E_STRICT warning.
In PHP 5.3.0, `is_a()` is no longer deprecated, and will therefore no longer throw `E_STRICT` warnings.

To avoid warnings in PHP < 5.3.0, convert all `is_a()` calls to `$var instanceof WP_Class` calls.

`instanceof` does not throw any error if the variable being tested is not an object, it simply returns `false`.

Props markoheijnen, wonderboymusic.
Fixes #25672.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 01:06:24 +00:00
Helen Hou-Sandí
62a197d6bf List tables: Use CSS :nth-child() selectors for zebra striping.
Note that this does not fix issues related to comment quick edit. Internal linking also continues to use the `.alternate` class for now. IE8 and below gracefully degrade by not having zebra striping.

There is some hoop jumping with adding an extra table row to maintain zebra striping during quick edit. Documenting that here for future reference; it is also in the inline documentation.

fixes #30981 and #26060. see #25060.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-14 22:14:22 +00:00
Drew Jaynes
273396fe1e Ensure inline code is markdown-escaped as such, and that code snippets in descriptions are properly indented.
Affects DocBlocks for the following core elements:
* Backtick-escapes a `<link>` tag in a parameter description for the `embed_oembed_discover` hook
* Inline code fixes in the summary and return description for `WP_List_Table::get_table_classes()`
* Removes HTML markup from the summary for `WP_List_Table::display_rows_or_placeholder()`
* Backtick-escapes a `<tr>` tag in a parameter description for `WP_Users_List_Table::single_row()`
* Converts non-DocBlocks into multi-line comments in `WP_Dependencies::do_items()`
* Removes HTML markup from the summary for the `comment_form_top` hook.
* Inline code and snippet fixes in the description for `wp_get_schedules()`

Props rarst for the initial patch.
See #30473.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-24 04:58:22 +00:00
Andrew Nacin
f7392ef917 Pinking shears.
Built from https://develop.svn.wordpress.org/trunk@29707


git-svn-id: http://core.svn.wordpress.org/trunk@29481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-04 15:23:16 +00:00
Drew Jaynes
d60a081137 Add @access tags to constructor docblocks in list table classes.
See #28679. See [29459].

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


git-svn-id: http://core.svn.wordpress.org/trunk@29238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-10 02:22:16 +00:00
Drew Jaynes
8e86454467 Document default arguments for the WP_List_Table class. Also add referenced docblocks to extending class constructors.
Props mikejolley for the initial patch.
Fixes #28679. See #28298.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-10 02:18:17 +00:00
Scott Taylor
176b9b2301 Fix mismatches in access modifiers for WP_List_Table + subclasses.
Fixes #28843, #28879.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-13 22:09:16 +00:00
Scott Taylor
130771a383 hackificator doesn't like mixed quote styles in some generated HTML. The switch from single to double allows these files to be parsed.
See #27881.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-19 01:59:15 +00:00
Scott Taylor
f090ff507d Add access modifiers to methods and members of WP_Users_List_Table.
See #27881, #22234.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-19 01:19:14 +00:00
Scott Taylor
3054b924a3 In WP_Users_List_Table::get_views(), $current_role is set and never used.
See #27882.


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


git-svn-id: http://core.svn.wordpress.org/trunk@28124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-06 15:33:15 +00:00
Drew Jaynes
16941beac1 Tweak inline documentation for hooks in wp-admin/includes/class-wp-users-list-table.php.
Props kpdesign.
Fixes #26203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-02 20:32:15 +00:00
Drew Jaynes
15068e1cd4 Inline documentation for hooks in wp-admin/includes/class-wp-users-list-table.php.
Props leewillis77.
Fixes #26203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-01 15:00:15 +00:00
Drew Jaynes
8dc5888cfa Improve inline documentation for WP_Users_List_Table.
Props leewillis77 for the initial patch.
Fixes #26564.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-26 22:20:17 +00:00
Andrew Nacin
39e32ed1eb Consistently trim and unslash search queries for the users list tables.
props aubreypwd.
fixes #26115.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-02 22:10:12 +00:00
Sergey Biryukov
dace3f0b6d Remove redundant echo calls from list tables. Don't mix string concatenation with direct output. see #24210.
git-svn-id: http://core.svn.wordpress.org/trunk@24123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-29 01:10:50 +00:00
Ryan Boren
5f809d1d22 Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().
see #21767


git-svn-id: http://core.svn.wordpress.org/trunk@23563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 17:00:25 +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
Helen Hou-Sandí
b1f1579604 its <=> it's in documentation, along with a rogue the, The, and looses. props trepmal. fixes #22665.
git-svn-id: http://core.svn.wordpress.org/trunk@23191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-20 15:55:32 +00:00
Andrew Nacin
c185f0c9bd Use correct variable. see #17860.
git-svn-id: http://core.svn.wordpress.org/trunk@22689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 21:43:47 +00:00
Andrew Nacin
d88922565e 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: http://core.svn.wordpress.org/trunk@22686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 19:16:31 +00:00
Andrew Nacin
69d63c243d Fix the 'Change' button in the users list table. props c3mdigital. fixes #22034.
git-svn-id: http://core.svn.wordpress.org/trunk@22423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 18:34:46 +00:00
Andrew Nacin
dd50d7d0e0 restrict_manage_users action. props jakemgold, johnjamesjacoby. fixes #19295.
git-svn-id: http://core.svn.wordpress.org/trunk@22414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 07:59:46 +00:00
Ryan Boren
a3cfe28527 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: http://core.svn.wordpress.org/trunk@21914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-19 12:43:31 +00:00
Andrew Nacin
e914a04335 Trim incoming searches on the users list table. props tollmanz. fixes #21318.
git-svn-id: http://core.svn.wordpress.org/trunk@21864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-16 16:11:01 +00:00
Daryl Koopersmith
67894a3407 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: http://core.svn.wordpress.org/trunk@21789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-08 04:58:34 +00:00
nacin
7127ed1197 Move most instances of new WP_User to get_userdata(). see #21120.
git-svn-id: http://core.svn.wordpress.org/trunk@21413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-03 01:06:05 +00:00
ryan
7b49ad8493 Introduce get_edit_user_link(). Props scribu, georgestephanis, johnbillion. fixes #14787 see #20307
git-svn-id: http://core.svn.wordpress.org/trunk@21364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-30 18:30:03 +00:00
ryan
73addbbd24 More screen reader text for list table checkboxes and theme install search. Props MikeLittle, SergeyBiryukov. see #21325
git-svn-id: http://core.svn.wordpress.org/trunk@21323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-25 16:18:14 +00:00
ryan
c36145c9aa Add screen reader text to checkboxes in list tables. Props MikeLittle, nacin. see #21325
git-svn-id: http://core.svn.wordpress.org/trunk@21317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-24 18:01:22 +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
ryan
07ff8b216b Use one space, not two, after trailing punctuation. fixes #19537
git-svn-id: http://svn.automattic.com/wordpress/trunk@19593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-13 23:45:31 +00:00
nacin
0fd3915e9f number_format_i18n for role user counts. props sirzooro, fixes #18305.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-21 05:35:57 +00:00
ryan
0f06334e11 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: http://svn.automattic.com/wordpress/trunk@18597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-24 19:32:59 +00:00
ryan
6c6db6a54e Don't add search wildcards to an empty string. fixes #17719
git-svn-id: http://svn.automattic.com/wordpress/trunk@18179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-07 16:05:04 +00:00
ryan
15a6a89eb0 Validation fixes. Props ocean90, xknown. fixes #17364
git-svn-id: http://svn.automattic.com/wordpress/trunk@18114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-02 17:05:55 +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
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
ryan
19afce5e23 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: http://svn.automattic.com/wordpress/trunk@17439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-02-10 20:37:26 +00:00