Skip to content

Commit

Permalink
Merge pull request #313 from Automattic/update/wordpress-org-api-constat
Browse files Browse the repository at this point in the history
Apply constant for WordPress.org API
  • Loading branch information
gudmdharalds authored Oct 20, 2022
2 parents fa90ffb + 37310cb commit 7d1b929
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@
define( 'VIPGOCI_ADDON_PLUGIN', 'vipgoci-addon-plugin' );
define( 'VIPGOCI_ADDON_THEME', 'vipgoci-addon-theme' );

/*
* WordPress.org defines.
*/
define( 'VIPGOCI_WORDPRESS_ORG_API_BASE_URL', 'https://api.wordpress.org' );

/*
* Defines for WPScan API support.
*/
Expand Down
4 changes: 3 additions & 1 deletion wp-core-misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,9 @@ function vipgoci_wpcore_api_determine_slug_and_other_for_addons(
$addon_query_type_short = VIPGOCI_ADDON_PLUGIN === $addon_query_type ?
'plugins' : 'themes';

$api_url = 'https://api.wordpress.org/' . rawurlencode( $addon_query_type_short ) . '/update-check/1.1/';
$api_url = VIPGOCI_WORDPRESS_ORG_API_BASE_URL . '/' .
rawurlencode( $addon_query_type_short ) . '/' .
'update-check/1.1/';

$api_query_data = array(
$addon_query_type_short => json_encode(
Expand Down

0 comments on commit 7d1b929

Please sign in to comment.