Skip to content

Commit

Permalink
Masterbar - Add query param to URL only for users who can access wp-a…
Browse files Browse the repository at this point in the history
…dmin (#38493)

* Add query param to URL only for users with manage options permission

* changelog

* Bump version

* Add query param to URL only for users who can access wp-admin
  • Loading branch information
okmttdhr authored Jul 24, 2024
1 parent e12d29a commit 2e29add
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Add query param to URL only for users with manage options permission
2 changes: 1 addition & 1 deletion projects/packages/jetpack-mu-wpcom/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"autotagger": true,
"branch-alias": {
"dev-trunk": "5.48.x-dev"
"dev-trunk": "5.49.x-dev"
},
"textdomain": "jetpack-mu-wpcom",
"version-constants": {
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/jetpack-mu-wpcom/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-mu-wpcom",
"version": "5.48.0",
"version": "5.49.0-alpha",
"description": "Enhances your site with features powered by WordPress.com",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/jetpack-mu-wpcom/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Jetpack_Mu_Wpcom main class.
*/
class Jetpack_Mu_Wpcom {
const PACKAGE_VERSION = '5.48.0';
const PACKAGE_VERSION = '5.49.0-alpha';
const PKG_DIR = __DIR__ . '/../';
const BASE_DIR = __DIR__ . '/';
const BASE_FILE = __FILE__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ function maybe_add_origin_site_id_to_url( $url ) {
return $url;
}

// Add query param to URL only for users who can access wp-admin.
if ( ! current_user_can( 'read' ) ) {
return $url;
}

return add_query_arg( 'origin_site_id', $site_id, $url );
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


4 changes: 2 additions & 2 deletions projects/plugins/mu-wpcom-plugin/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


2 changes: 1 addition & 1 deletion projects/plugins/wpcomsh/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"composer/installers": true,
"roots/wordpress-core-installer": true
},
"autoloader-suffix": "26841ac2064774301cbe06d174833bfc_wpcomshⓥ5_0_0"
"autoloader-suffix": "26841ac2064774301cbe06d174833bfc_wpcomshⓥ5_0_1_alpha"
},
"extra": {
"mirror-repo": "Automattic/wpcom-site-helper",
Expand Down
4 changes: 2 additions & 2 deletions projects/plugins/wpcomsh/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/plugins/wpcomsh/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "@automattic/jetpack-wpcomsh",
"description": "A helper for connecting WordPress.com sites to external host infrastructure.",
"homepage": "https://jetpack.com",
"version": "5.0.0",
"version": "5.0.1-alpha",
"bugs": {
"url": "https://github.com/Automattic/jetpack/labels/[Plugin] Wpcomsh"
},
Expand Down
4 changes: 2 additions & 2 deletions projects/plugins/wpcomsh/wpcomsh.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
/**
* Plugin Name: WordPress.com Site Helper
* Description: A helper for connecting WordPress.com sites to external host infrastructure.
* Version: 5.0.0
* Version: 5.0.1-alpha
* Author: Automattic
* Author URI: http://automattic.com/
*
* @package wpcomsh
*/

define( 'WPCOMSH_VERSION', '5.0.0' );
define( 'WPCOMSH_VERSION', '5.0.1-alpha' );

// If true, Typekit fonts will be available in addition to Google fonts
add_filter( 'jetpack_fonts_enable_typekit', '__return_true' );
Expand Down

0 comments on commit 2e29add

Please sign in to comment.