Commit Graph

25 Commits

Author SHA1 Message Date
Scott Taylor
97d6901048 Access Modifiers:
* In `WP_Plugin_Install_List_Table`, use `public` instead of `var`
* In `WP_User`, `->data` is accessed directly on an instance if the constructor receives it: make it `public`
* In `WP_Locale`, every property is exported to a global and is already `public` via `var`, half of the properties are accessed directly already, make them all `public`
* In `WP_Rewrite`, several properties are accessed publicly in functions via the `$wp_rewrite` global, make those props `public`.
* In `WP_Rewrite`, the property `->comment_feed_structure` was misspelled as `->comments_feed_structure`

See #30799.


git-svn-id: https://develop.svn.wordpress.org/trunk@31078 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-08 05:43:54 +00:00
Dion Hulse
8cce0f1607 Preinitialize WP_User::$data to an object in the event an empty user object is created. Avoids a "Creating default object from empty value" PHP Warning.
Fixes #28019


git-svn-id: https://develop.svn.wordpress.org/trunk@31049 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-05 01:40:43 +00:00
Scott Taylor
4d69dbadee Fix docs for WP_User::allcaps:
The `allcaps` property of the `WP_User` class represents all of the caps of the user, not the caps of the user's role. Introduced in [26126].

Props dlh.
Fixes #30852.


git-svn-id: https://develop.svn.wordpress.org/trunk@31013 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-31 18:14:07 +00:00
Scott Taylor
f6f12912e2 Improve some docs for @param. Remove an unneeded $wpdb global import.
See #30799.


git-svn-id: https://develop.svn.wordpress.org/trunk@30979 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-20 20:55:21 +00:00
Scott Taylor
4d46475b3d Improve various @param docs for src/wp-includes/*.
See #30224.


git-svn-id: https://develop.svn.wordpress.org/trunk@30681 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-01 01:33:34 +00:00
Drew Jaynes (DrewAPicture)
e587324180 Docs Formatting: Backtick-escape inline code for all remaining dynamic hook docs in wp-includes/*.
Affects DocBlocks for the following hooks:
* `auth_post_meta_{$meta_key}`
* `term_links-$taxonomy`
* `customize_render_control_ . $this->id`
* `customize_render_panel_{$this->id}`
* `customize_render_section_{$this->id}`
* `customize_preview_{$this->id}`
* `customize_save_ . $this->id_data[ 'base' ]`
* `customize_update_ . $this->type`
* `customize_value_ . $this->id_data[ 'base' ]`
* `customize_sanitize_js_{$this->id}`
* `comment_form_field_{$name}`
* `comment_{$old_status}_to_{$new_status}`
* `comment_{$new_status}_{$comment->comment_type}`
* `extra_{$context}_headers`
* `get_template_part_{$slug}`
* `get_the_generator_{$type}`
* `get_{$adjacent}_post_join`
* `get_{$adjacent}_post_where`
* `get_{$adjacent}_post_sort`
* `{$adjacent}_post_rel_link`
* `{$adjacent}_post_link`
* `{$adjacent}_image_link`
* `blog_option_{$option}`
* `$permastructname . _rewrite_rules`
* `{$type}_template`
* `theme_mod_{$name}`
* `pre_set_theme_mod_$name`
* `current_theme_supports-{$feature}`
* `get_user_option_{$option}`
* `edit_user_{$field}`
* `pre_user_{$field}`
* `user_{$field}`

See #30552.


git-svn-id: https://develop.svn.wordpress.org/trunk@30656 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-30 12:09:56 +00:00
Drew Jaynes (DrewAPicture)
f843741d33 Ensure inline code is markdown-escaped as such, and that code snippets in descriptions are properly indented.
Affects DocBlocks for the following core elements:
* Two arguments in `_walk_bookmarks()`
* A code snippet in the class header for `WP_Roles`
* A code snippet in the class header for `WP_HTTP_Proxy`
* Inline code fixes in the summary and a parameter description for `WP_oEmbed::discover()`
* An argument description in `_WP_Editors::parse_settings()`
* Inline code fixes in the summary and a parameter description the `embed_oembed_discover` hook.

Props rarst.
See #30473.


git-svn-id: https://develop.svn.wordpress.org/trunk@30536 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-24 04:41:15 +00:00
Drew Jaynes (DrewAPicture)
7cd15026bd Correct references of @uses $wpdb in core documentation to use @global.
See #30191, [30105].
Fixes #30217.


git-svn-id: https://develop.svn.wordpress.org/trunk@30122 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-31 17:55:39 +00:00
Andrew Nacin
322991024f Plugin/Theme Uploads: New capabilities; unify UIs; ensure compatibility with old filters.
Introduce upload_plugins and upload_themes capabilities to allow blocking of plugin and theme uploads, versus the old hacky (and not secure) ways of just hiding UI tabs. These are simply meta capabilities that map to install_plugins and install_themes.
 
Also:
 * Use the same nice design for the plugin upload screen as the theme upload screen.
 * Better compatibility for the old install_themes_tabs filter added in [29002]. see #28578.
 * Ensure using the install_plugins_tabs filter to remove the upload tab removes the new button.
 * Use 'Add Plugins' instead of 'Install Plugins' to match 'Add Themes'.

fixes #29236.


git-svn-id: https://develop.svn.wordpress.org/trunk@29634 602fd350-edb4-49c9-b593-d223f7449a82
2014-08-27 01:31:05 +00:00
Dominik Schilling (ocean90)
60b1befd8e Customizer: Add meta capability customize which is mapped to edit_theme_options.
You can now allow users to access the Customizer, say for any user who can `edit_posts`, via `map_meta_cap` or `user_has_cap` filter. See ticket for examples.

props westonruter, nacin.
fixes #28605.

git-svn-id: https://develop.svn.wordpress.org/trunk@29170 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-14 19:00:24 +00:00
Drew Jaynes (DrewAPicture)
34edad1645 Fill out inline documentation for the __call() magic method added to the WP_Roles class in [28503].
See #22234 and #28885.


git-svn-id: https://develop.svn.wordpress.org/trunk@29153 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-14 00:11:39 +00:00
Scott Taylor
312ef7b264 These functions import $wpdb but do not use it.
See #27882.


git-svn-id: https://develop.svn.wordpress.org/trunk@28539 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 17:36:42 +00:00
Scott Taylor
dc1ada20c7 Upgrade _WP_List_Table_Compat to PHP5-style constructor.
Add `public` to methods/members of `WP_Role`.
Add `public` to methods/members of `WP_User` where appropriate. Don't set `private` where indicated until more study has occurred and tests have been written for compatibiliy with existing magic methods.

See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28531 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 17:19:09 +00:00
Scott Taylor
599dff5c3d Add access modifiers to methods/members in WP_Roles. Add a magic __call() method for BC.
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28503 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 05:19:36 +00:00
Andrew Nacin
5edec1d792 Don't default to current user for capability checks when dealing with a post without an author (post_author = 0).
Undoes [12053]. While it risks breakage, this is a far safer and saner default for these situations.

props danielbachhuber.
fixes #27020.


git-svn-id: https://develop.svn.wordpress.org/trunk@27390 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-04 03:08:54 +00:00
Sergey Biryukov
323524abef Inline documentation for hooks in wp-includes/capabilities.php.
props ptahdunbar, kpdesign.
fixes #25531.

git-svn-id: https://develop.svn.wordpress.org/trunk@26126 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-13 04:38:13 +00:00
Sergey Biryukov
a2aed7b119 Fix docblock formatting. fixes #25893.
git-svn-id: https://develop.svn.wordpress.org/trunk@26081 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-11 13:31:19 +00:00
Andrew Nacin
352ff49768 Reverse the order of roles in wp_dropdown_roles(). Reset to 'subscriber' when the default role is removed and when a save is invalid.
props garyc40, wonderboymusic.
fixes #14578.


git-svn-id: https://develop.svn.wordpress.org/trunk@25695 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-06 10:55:42 +00:00
Scott Taylor
c03af6bbd7 WP_User::get_role_caps() now returns the caps it was already setting. The method was previously just setting $allprops and requiring that property to be read.
Props nofearinc.
Fixes #24962.




git-svn-id: https://develop.svn.wordpress.org/trunk@25673 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-02 21:35:20 +00:00
Sergey Biryukov
7e18d18db5 Remove inaccurate @return value from remove_role(). props tivnet. fixes #25450.
git-svn-id: https://develop.svn.wordpress.org/trunk@25653 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-01 02:52:30 +00:00
Andrew Nacin
f7050daeba Use the wpdb method instead of $wpdb->prefix.
props hakre.
fixes #16756.


git-svn-id: https://develop.svn.wordpress.org/trunk@25615 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-24 23:40:41 +00:00
Scott Taylor
535ae26afd Fix several esoteric errors related to AJAX unit tests for comments:
* `wp_ajax_get_comments()` relies on the `$post_id` global - even though `$_POST['p']` is passed to every action in the test methods. If `$post_id` is still lingering in between tests and doesn't match `p` in the request, the cap check might pass while the queries for comments will blow up. I added `unset( $GLOBALS['post_id'] )` to `Tests_Ajax_GetComments::setUp()`.
* If the global `$post_id` is empty, but `$_REQUEST['p']` is not, `$post_id` is now set to `absint( $_REQUEST['p'] )` and sanity-checked in `wp_ajax_get_comments()`.
* `map_meta_cap()` always assumes that `get_comment()` succeeds when checking for the `edit_comment` cap. It doesn't. I added sanity checks in a few places where it will break early if `get_post()` or `get_comment()` are empty.
* `wp_update_comment()` always assumes `get_comment()` succeeds. It doesn't. I added a check for empty.

All AJAX unit tests run and pass in debug mode. All general unit tests pass against these changes.

Fixes #25282.



git-svn-id: https://develop.svn.wordpress.org/trunk@25438 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-14 18:35:43 +00:00
Scott Taylor
c71a0422c0 Add an additional available param (the WP_User instance) to the user_has_cap filter.
Props Viper007Bond.
Fixes #24490.



git-svn-id: https://develop.svn.wordpress.org/trunk@25329 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-10 22:22:34 +00:00
Andrew Nacin
3749745c3d Don't set up $post_author_data in map_meta_cap() as we don't need it.
props duck_.
fixes #25177.


git-svn-id: https://develop.svn.wordpress.org/trunk@25177 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-30 04:00:06 +00:00
Andrew Nacin
b43712e0f7 New develop.svn.wordpress.org repository based on the old core.svn repository.
* All WordPress files move to a src/ directory.
 * New task runner (Grunt), configured to copy a built WordPress to build/.
 * svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js.
 * Remove Akismet external from develop.svn. Still exists in core.svn.
 * Drop minified files from src/. The build process will now generate these.

props koop.
see #24976.

and see http://wp.me/p2AvED-1AI.



git-svn-id: https://develop.svn.wordpress.org/trunk@25001 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-07 05:25:25 +00:00