Commit Graph

63 Commits

Author SHA1 Message Date
Jeremy Felt 2979167ba7 Multisite: Use `get_network()` and `get_current_network_id()` for current network data.
`get_network()` falls back to the current network when called without any arguments. Between this and `get_current_network_id()`, we can replace almost all instances of the global `$current_site` and all instances of `get_current_site()`.

This effectively deprecates `get_current_site()`, something that we'll do in a future ticket.

Props flixos90.
Fixes #37414.


git-svn-id: https://develop.svn.wordpress.org/trunk@38814 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-19 04:46:14 +00:00
Weston Ruter 83b059aa19 Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.

See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/

Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.


git-svn-id: https://develop.svn.wordpress.org/trunk@38810 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-18 20:04:36 +00:00
Pascal Birchler bcf50fedcd Toolbar: Be more strict about adding a 'View Posts' link to the toolbar.
After [38634], this adjusts the behaviour to remove redundancy by not displaying the link if the latest posts are shown on the front page. In that scenario, the 'Visit Site' link already points to the latest posts.

Fixes #34113.

git-svn-id: https://develop.svn.wordpress.org/trunk@38708 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-03 08:37:27 +00:00
John Blackbourn 17ef6d8cfa Taxonomy: Introduce more fine grained capabilities for managing taxonomy terms.
This introduces the singular `edit_term`, `delete_term`, and `assign_term` meta capabilities for terms, and switches the base capability name for tags from `manage_categories` to `manage_post_tags` and the corresponding `edit_post_tags`, `delete_post_tags`, and `assign_post_tags`.

All of these capabilities ultimately map to `manage_categories` so by default there is no change in the behaviour of the capabilities for categories, tags, or custom taxonomies. The `map_meta_cap` filter and the `capabilities` argument when registering a taxonomy now allow for control over editing, deleting, and assigning individual terms, as well as a separation of capabilities for tags from those of categories.

Fixes #35614
Props johnjamesjacoby for feedback


git-svn-id: https://develop.svn.wordpress.org/trunk@38698 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 22:39:32 +00:00
Jeremy Felt 2a3ffbf498 Admin Bar: Remove unused ID `ab-awaiting-mod` from comment count.
This selector has been unused since [19516]. The (now) more appropriate `.awaiting-mod` is used instead.

Props Presskopp.
Fixes #37901.


git-svn-id: https://develop.svn.wordpress.org/trunk@38683 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-30 05:01:02 +00:00
Dominik Schilling (ocean90) 0bab64c370 Toolbar: Update links to the about page if current user can't access the dashboard of the current site.
Add missing focus styling for menu items with an icon.

Fixes #37949.

git-svn-id: https://develop.svn.wordpress.org/trunk@38660 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 19:00:35 +00:00
Pascal Birchler acb43ecc0b Toolbar: Add a 'View Posts' link to the toolbar when on the post listing screen.
This adds a new link to visit the post type archive if the post type supports it. Also introduces a new `view_items` label to `get_post_type_labels()`.

Props paulwilde, akibjorklund, swissspidy.
Fixes #34113.

git-svn-id: https://develop.svn.wordpress.org/trunk@38634 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-20 20:01:55 +00:00
Scott Taylor cba0e2c8f7 Bootstrap: do not go gentle into that good night r38411, r38412, and parts of r38389.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38470 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-31 16:30:48 +00:00
Scott Taylor 4225e71a6b Bootstrap: after r38409 and r38410, revert r38402 which reverted r38399.
This fixes the paths in `wp-vendor/` that were including `src`. I want to drop this in so we can find out what else will break.

See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38411 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 22:31:11 +00:00
Dion Hulse e353179ce5 Bootstrap: Revert [38399] as it's broken `/build/` and subsequently core.svn.wordpress.org.
The generated classmaps reference `/src/` files and operates in the assumption that the base directory is one level above `wp-settings.php`, which it isn't after our build processes are run.

See #36335


git-svn-id: https://develop.svn.wordpress.org/trunk@38402 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 14:36:42 +00:00
Scott Taylor 388690382c Bootstrap: Autoload classes using a Composer-generated PHP 5.2-compatible Autoloader.
* `wp-admin` and `wp-includes` are scanned for classes to autoload
* Several 3rd-party and Ryan McCue-shaped libraries are excluded when the classmap is generated, see `composer.json`: `autoload.exclude-from-classmap`
* `wp-vendor/autoload_52.php` is included at the top of `wp-settings.php` - no changes need to be made to unit tests to include the autoloader
* An avalanche of `require()` and `require_once()` calls that loaded class files have been removed from the codebase.

The following files have been added to `svn:ignore` - they are not 5.2-compatible and fail during pre-commit:
* src/wp-vendor/autoload.php
* src/wp-vendor/composer/autoload_real.php
* src/wp-vendor/composer/autoload_static.php
* src/wp-vendor/composer/ClassLoader.php

We favor these files instead:
* src/wp-vendor/autoload_52.php
* src/wp-vendor/composer/autoload_real_52.php
* src/wp-vendor/composer/ClassLoader52.php

When new PHP classes are added to the codebase, simply run `composer install` or `composer update` from the project root to update the autoloader.

The future is now.

See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38399 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 09:15:01 +00:00
Sergey Biryukov bcc0fc20b3 I18N: Add translator comments for strings in `wp-includes/admin-bar.php`.
Props ramiy.
Fixes #37794.

git-svn-id: https://develop.svn.wordpress.org/trunk@38340 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-23 23:04:33 +00:00
Drew Jaynes bd1d3f0a8c Docs: Apply inline `@see` tags to hooks referenced in DocBlocks in a variety of wp-includes/* files.
Applying these specially-crafted `@see` tags allows the Code Reference parser to recognize and link these elements as actions and filters.

See #36921.


git-svn-id: https://develop.svn.wordpress.org/trunk@37542 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-23 18:58:48 +00:00
Drew Jaynes d11f7ed391 Docs: Standardize filter docs in remaining wp-includes/* files to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.


git-svn-id: https://develop.svn.wordpress.org/trunk@37518 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-22 18:49:05 +00:00
Jeremy Felt 91513893c2 Posts: Call `set_url_scheme()` consistently on URLs passed through `preview_post_link`
After [34170], some preview URLs that passed through `set_url_scheme()` no longer do so. We can restore that behavior by applying `set_url_scheme()` whenever `get_preview_post_link()` provides the URL.

Props danielbachhuber.
Fixes #35407.


git-svn-id: https://develop.svn.wordpress.org/trunk@36926 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-10 04:41:34 +00:00
Pascal Birchler 3a51ff4d2e Taxonomy: Improve backward compatibility on the `wp-admin/term.php` page.
Specifically, run `do_action( 'edit-tags.php' );` on this new term edit page introduced in [36308]. Changes the GET param back to `tag_ID` and properly sets the screen base in `WP_Screen`.

See #34988.

git-svn-id: https://develop.svn.wordpress.org/trunk@36874 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-07 12:55:04 +00:00
Drew Jaynes 75e314e23e Docs: Fix two incorrect notations of the `$show_admin_bar` global to specify a boolean type, not `WP_Admin_Bar`.
See [36491]. Fixes #35686.


git-svn-id: https://develop.svn.wordpress.org/trunk@36601 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-20 21:26:26 +00:00
Drew Jaynes 38aeeb5ebe Docs: Fix two notations in the DocBlocks for `show_admin_bar()` and `is_admin_bar_showing()` to reflect use of the `$show_admin_bar` global rather than `$wp_admin_bar`.
Props Frozzare.
Fixes #35686.


git-svn-id: https://develop.svn.wordpress.org/trunk@36491 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-07 01:21:14 +00:00
Sergey Biryukov 1fdddd302e Toolbar: In Comments link, replace title attribute containing the number of pending comments with a screen reader text.
Props slushman, rachelbaker.
Fixes #34895.

git-svn-id: https://develop.svn.wordpress.org/trunk@36093 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-26 01:39:50 +00:00
Andrea Fercia 4dfb95179a When editing terms, properly display an admin `notice-warning` when `tag_ID` is empty.
Also, avoids two related PHP notices when empty or not set (and thus the global `$tag` is a WP_Error object).

Fixes: #34515.

git-svn-id: https://develop.svn.wordpress.org/trunk@35875 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-11 22:48:49 +00:00
Mark Jaquith baa1da6c57 Do not pass FALSE as second parameter in variable class_exists() checks
Because these are generally plugin-provided, we want plugins to be
able to use autoloaders.

fixes #20523

git-svn-id: https://develop.svn.wordpress.org/trunk@35749 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-30 04:14:31 +00:00
John Blackbourn 55d04cb50f Move the `show_ui` logic into the `get_edit_post_link()` and `get_edit_term_link()` functions to facilitate post types and terms which specify `show_ui` as false but provide a custom editing UI via the `get_edit_post_link` and `get_edit_term_link` filters.
Fixes #33763
Fixes #33938


git-svn-id: https://develop.svn.wordpress.org/trunk@35704 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-19 16:24:35 +00:00
Drew Jaynes 5ffe8f5aef Docs: Add missing file headers to two Toolbar API files: wp-includes/admin-bar.php and wp-includes/class-wp-admin-bar.php.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@35157 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-14 17:26:28 +00:00
Jeremy Felt 224efdf892 MS: Add "Settings" link under "Network Admin" toolbar menu.
Props johnjamesjacoby.
Fixes #34287.


git-svn-id: https://develop.svn.wordpress.org/trunk@35156 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-14 16:59:33 +00:00
Scott Taylor c123726ba0 Docs: some `@global object` vernaculars should be converted to the actual object type.
See #33491.


git-svn-id: https://develop.svn.wordpress.org/trunk@35013 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-10 15:44:16 +00:00
Gary Pendergast 43bd3d46c9 Embeds: Add oEmbed provider support.
For the past 6 years, WordPress has operated as an oEmbed consumer, allowing users to easily embed content from other sites. By adding oEmbed provider support, this allows any oEmbed consumer to embed posts from WordPress sites.

In addition to creating an oEmbed provider, WordPress' oEmbed consumer code has been enhanced to work with any site that provides oEmbed data (as long as it matches some strict security rules), and provides a preview from within the post editor.

For security, embeds appear within a sandboxed iframe - the iframe content is a template that can be styled or replaced entirely by the theme on the provider site.

Props swissspidy, pento, melchoyce, netweb, pfefferle, johnbillion, extendwings, davidbinda, danielbachhuber, SergeyBiryukov, afercia

Fixes #32522.



git-svn-id: https://develop.svn.wordpress.org/trunk@34903 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 10:35:18 +00:00
Scott Taylor ed7d34cb13 Pass `false` as the 2nd argument to `class_exists()` to disable autoloading and to not cause problems for those who define `__autoload()`.
Fixes #20523.


git-svn-id: https://develop.svn.wordpress.org/trunk@34348 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-20 03:51:55 +00:00
Scott Taylor c0d850878a Create a function, `get_preview_post_link()`, to DRY the logic for applying the `'preview_post_link'` filter to a URL.
Props TomHarrigan, wonderboymusic.
Fixes #24345.


git-svn-id: https://develop.svn.wordpress.org/trunk@34170 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-15 04:14:23 +00:00
John Blackbourn 811e538325 Update links to the user profile editing screen in the admin toolbar when the current logged in user has no role on the current site. Covers single site and Multisite and introduces tests.
Fixes #25162


git-svn-id: https://develop.svn.wordpress.org/trunk@34122 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-14 17:09:58 +00:00
Drew Jaynes 7b677473f7 Fix the summary and parameter description for `wp_admin_bar_customize_menu()` added in 4.3.
See [33130]. See #32891.


git-svn-id: https://develop.svn.wordpress.org/trunk@33213 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-13 19:57:14 +00:00
Helen Hou-Sandi 29e0f5c3b7 Toolbar: Don't show the customize link in the admin.
props afragen.
fixes #32945.


git-svn-id: https://develop.svn.wordpress.org/trunk@33147 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-09 19:18:39 +00:00
Helen Hou-Sandi f5043ab022 Toolbar: Disambiguate links to the dashboard vs. to the customizer.
All links in the site name menu now point to admin screens, and Customize is its own top-level link. This makes it clear which context you are about to enter.

fixes #32924. see #32678.


git-svn-id: https://develop.svn.wordpress.org/trunk@33130 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-08 20:02:44 +00:00
John Blackbourn 06ed4c4d0f Correct the title used on the user dashboard.
Fixes #32754
Props johnjamesjacoby


git-svn-id: https://develop.svn.wordpress.org/trunk@32917 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-24 00:36:40 +00:00
Scott Taylor 296c559baf `if` is a statment, not a function.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32800 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 20:00:15 +00:00
Scott Taylor d723ecc5f5 Add missing doc blocks to `admin-bar.php`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32537 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-22 03:59:13 +00:00
Scott Taylor cb145bd1c0 In `admin-bar.php`, most functions simply return when a conditional is not met. `wp_admin_bar_render()` shouldn't explicitly return `false`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32525 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-21 20:09:00 +00:00
Dominik Schilling (ocean90) b0d6757918 Use HTTPS URLs for codex.wordpress.org.
see #27115.

git-svn-id: https://develop.svn.wordpress.org/trunk@32116 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-12 21:28:58 +00:00
Jeremy Felt 111203b0f6 Check for an active blog before generating the `my-sites.php` URL.
If a super admin does not have an active blog assigned to their account, `$wp_admin_bar->user->active_blog` will be set as `null`. We can then fall back to `admin_url()` to generate the My Sites URL.

Props SergeyBiryukov, deconf.

Fixes #31755.


git-svn-id: https://develop.svn.wordpress.org/trunk@31981 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-02 05:26:22 +00:00
Mark Jaquith f1bb5c2fd7 Add theme browsing and theme switching to the Customizer
* Brings into core the Customizer Theme Switcher feature plugin
* You can now browse, preview, and activate themes right from the Customizer

fixes #31303.
props celloexpressions, afercia, westonruter, folletto, designsimply

git-svn-id: https://develop.svn.wordpress.org/trunk@31533 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-24 20:30:22 +00:00
Sergey Biryukov b52cb0346e Toolbar: Remove title attributes from 'About WordPress', 'Add New', and 'My Account' items.
props afercia.
fixes #31324.

git-svn-id: https://develop.svn.wordpress.org/trunk@31456 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 20:19:09 +00:00
Sergey Biryukov 35ae49f843 Toolbar: Add a label for search field on front-end.
props afercia.
fixes #31323.

git-svn-id: https://develop.svn.wordpress.org/trunk@31455 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 19:20:53 +00:00
Sergey Biryukov 83d5751a33 Use `get_admin_url()` to get the correct My Sites URL without calling `switch_to_blog()` directly.
props ocean90.
see #31314.

git-svn-id: https://develop.svn.wordpress.org/trunk@31448 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 12:52:10 +00:00
Jeremy Felt 2002097f6f Create the My Sites URL in the context of a user's primary site.
Switch to the user's primary (or active) site before creating the My Sites URL. This previously linked to the current site's dashboard, even if a user was not a member of that site.

Props simonwheatley for the initial patch.

Fixes #31314.


git-svn-id: https://develop.svn.wordpress.org/trunk@31445 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 06:29:57 +00:00
Sergey Biryukov 0fdfb101db Use `require_once()` to prevent a fatal error if `_wp_admin_bar_init()` is called twice.
props danielbachhuber.
fixes #31287.

git-svn-id: https://develop.svn.wordpress.org/trunk@31411 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 15:58:22 +00:00
Sergey Biryukov 74bb197a4a Customizer: Use deep-link for Widgets in toolbar on front-end.
props caseypatrickdriscoll.
fixes #30971.

git-svn-id: https://develop.svn.wordpress.org/trunk@31176 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 07:44:57 +00:00
Scott Taylor 865185903b There are some random `add_action()` and `add_filter()` calls littered around some files in `wp-includes/`. These should be moved to `wp-includes/default-filters.php` with the rest of the registered hooks. It seems like this was the best practice for awhile and then we randomly stopped. This file loads way before any of the includes, so the hooks will be registered for any request that loads WordPress, even `SHORTINIT` - a lot of the hooks registered won't run anyways (that's already the case).
See #30947.


git-svn-id: https://develop.svn.wordpress.org/trunk@31168 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 16:39:39 +00:00
Sergey Biryukov 95ffc6e562 Consistently handle an empty site title in Site and My Sites toolbar menus.
see #28682.

git-svn-id: https://develop.svn.wordpress.org/trunk@30598 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-28 08:12:13 +00:00
Dominik Schilling (ocean90) df884cb92e Customizer: Use deep-links for Backgrounds, Headers, and Widgets.
Replace links in admin menu and toolbar to Custom Background/Header screen with deep-links to the Customizer section.
On the Widgets screen display a link to the Customizer widgets panel.

props topher1kenobe, rzen, celloexpressions, westonruter
fixes #25569, #25571, #28032.

git-svn-id: https://develop.svn.wordpress.org/trunk@30459 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-20 15:28:55 +00:00
Sergey Biryukov f114ff72ac Don't display Edit links for posts and terms in toolbar if they are empty.
props boonebgorges.
fixes #29538.

git-svn-id: https://develop.svn.wordpress.org/trunk@29714 602fd350-edb4-49c9-b593-d223f7449a82
2014-09-07 08:31:57 +00:00
Sergey Biryukov 0df3044683 Restore the post type's view_item label for preview links that don't submit the changes.
fixes #28350.

git-svn-id: https://develop.svn.wordpress.org/trunk@29695 602fd350-edb4-49c9-b593-d223f7449a82
2014-09-03 11:32:52 +00:00