Skip to content

Commit

Permalink
Do not replace BP Default on 12.0 upgrade if it comes from /themes
Browse files Browse the repository at this point in the history
  • Loading branch information
imath committed Jul 30, 2023
1 parent ac3adb5 commit 0df2579
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions inc/core/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ function bp_classic_default_theme_root_uri( $theme_root_uri, $siteurl, $styleshe
* @since 1.0.0
*/
function bp_classic_update_bp_default_theme_options() {
// If the current active template theme is not BP Default from the BuddyPress plugin, stop.
if ( false === strpos( get_template_directory(), 'plugins/buddypress/bp-themes/bp-default' ) ) {
return;
}

$theme_root = str_replace( content_url(), '', bp_classic_get_themes_url() );

if ( 'bp-default' === get_template() ) {
Expand Down
5 changes: 5 additions & 0 deletions inc/migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ function bp_classic_switch_directory_post_type( $post_type = '' ) {
* @since 1.0.0
*/
function bp_classic_restore_default_theme() {
// If the current active template theme is not BP Default from the this plugin, stop.
if ( false === strpos( get_template_directory(), 'bp-classic/themes/bp-default' ) ) {
return;
}

// Force refresh theme roots.
delete_site_transient( 'theme_roots' );

Expand Down
2 changes: 1 addition & 1 deletion languages/bp-classic.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-07-29T12:06:13+00:00\n"
"POT-Creation-Date: 2023-07-30T15:41:02+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.5.0\n"
"X-Domain: bp-classic\n"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0-beta1",
"description": "BuddyPress Classic backward compatibility plugin.",
"scripts": {
"bpdefault": "svn export --force https://github.com/buddypress/BP-Default.git/trunk themes/bp-default",
"bpdefault": "svn export --force https://github.com/buddypress/BP-Default.git/branches/prepare/bp-classic-moving themes/bp-default",
"pot": "wp i18n make-pot . --exclude=\".phpcs,node_modules,tests,vendor\" languages/bp-classic.pot --headers='{\"Project-Id-Version\": \"BP Classic\", \"Report-Msgid-Bugs-To\": \"https://github.com/buddypress/bp-classic/issues\", \"Last-Translator\": \"JOHN JAMES JACOBY <[email protected]>\", \"Language-Team\": \"ENGLISH <[email protected]>\"}'"
},
"repository": {
Expand Down

0 comments on commit 0df2579

Please sign in to comment.