Template contents didn't get copied

I am using a "Template Showcase" page, the original blogtemplates.php was modified a bit in order to hide "select-theme-button". On the previous NBT plugin version, I had this fixed url link in a custom button on pages:

http://MainSite.com/register/?blog_template=X

This worked fine on a previous version, after redirected to the signup page, all the template contents were copied correctly but after the new NBT update, this fixed URL above doesn't give me a correct result: the plugins, setting, and themes are copied correctly but all the site contents are completely missing. Where else do I need to modify in order to make that fixed URL above working like it used to on my custom button where I place this button on the normal WP pages?

  • Code Injector

    The original blogtemplates.php

    elseif ( 'page-showcase' == $type || 'page_showcase' == $type ) {
    $img = ( ! empty( $template['screenshot'] ) ) ? $template['screenshot'] : nbt_get_default_screenshot_url( $template['blog_id'] );
    $tplid = $template['name'];
    $blog_url = get_site_url( $template['blog_id'], '', 'http' );

    if ( class_exists( 'BuddyPress' ) ) {
    $sign_up_url = bp_get_signup_page();
    }
    else {
    $sign_up_url = network_site_url( 'wp-signup.php' );
    $sign_up_url = apply_filters( 'wp_signup_location', $sign_up_url );
    }
    $sign_up_url = add_query_arg( 'blog_template', $tkey, $sign_up_url );
    ?>
    <div class="template-signup-item theme-page-showcase-wrap <?php echo $default; ?>" data-tkey="<?php echo $tkey; ?>" id="theme-page-showcase-wrap-<?php echo $tkey;?>">

    " class="blog_template-item_selector">
    <img src="<?php echo $img;?>" />

    <div class="theme-page-showcase-overlay">
    <div class="template-name"><?php echo $tplid; ?></div>
    <button rel="nofollow" class="view-demo-button" data-blog-url="<?php echo $blog_url;?>"><?php _e( 'View demo', 'blog_templates' ); ?></button>

    <button class="select-theme-button" data-signup-url="<?php echo esc_url( $sign_up_url );?>"><?php echo $options['previewer_button_text']; ?></button>
    </div>

    <?php if ( ! empty( $template['description'] ) ): ?>
    <div id="nbt-desc-pointer-<?php echo $tkey; ?>" class="nbt-desc-pointer">
    <?php echo nl2br($template['description']); ?>
    </div>
    <?php endif; ?>
    </div>
    <?php
    }

    was modified to this:

    elseif ( 'page-showcase' == $type || 'page_showcase' == $type ) {
    $img = ( ! empty( $template['screenshot'] ) ) ? $template['screenshot'] : nbt_get_default_screenshot_url( $template['blog_id'] );
    $tplid = $template['name'];
    $blog_url = get_site_url( $template['blog_id'], '', 'http' );

    if ( class_exists( 'BuddyPress' ) ) {
    $sign_up_url = bp_get_signup_page();
    }
    else {
    $sign_up_url = network_site_url( 'wp-signup.php' );
    $sign_up_url = apply_filters( 'wp_signup_location', $sign_up_url );
    }
    $sign_up_url = add_query_arg( 'blog_template', $tkey, $sign_up_url );
    ?>
    <div class="template-signup-item theme-page-showcase-wrap <?php echo $default; ?>" data-tkey="<?php echo $tkey; ?>" id="theme-page-showcase-wrap-<?php echo $tkey;?>">

    " class="blog_template-item_selector">
    <img src="<?php echo $img;?>" />

    <?php global $template_page;
    $template_page = get_site_url( '/templates/','/templates/') . $tplid;
    ?>

    <div class="theme-page-showcase-overlay">
    <button rel="nofollow" class="view-demo-button" data-blog-url="<?php echo $template_page;?>"><?php _e( 'View ' . $tplid, 'blog_templates' ); ?></button>
    <button class="select-theme-button" data-signup-url="<?php echo esc_url( $sign_up_url );?>"><?php echo $options['previewer_button_text']; ?></button>
    </div>
    </div>
    <?php
    }

    Then when user want to choose the template, I have this fixed URL link in a custom button on NON-NBT pages:

    http://MainSite.com/register/?blog_template=X

    Just for more clarification.

  • Sajid

    Hi @Cas

    Hope you are doing good today :slight_smile:

    The issue does not seems to be with blog template as long as it have the correct ID of blog template and redirecting to register page. The issue seems to be with register page.

    I can see you are not using default wp-signup.php page. Have you tried with default wp-signup.php form instead ? Also is it BuddyPress registration form ?

    Also, if its okay for you, then please grant support access so I can take a closer look. You could grant access from WPMUDEV > Support > Support Access > Grant Access or see below link for more details.
    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Code Injector

    I can see you are not using default wp-signup.php page. Have you tried with default wp-signup.php form instead ? Also is it BuddyPress registration form ?

    Yes, it is BuddyPress registration.

    The site is still under my local dev machine at the moment, there're a few important things need to be done before uploading the site, its size is around 10GB. I have to make sure that it's done 100% before uploading. Where is this particular piece of code in any of your plugins which could prevent just the content to get copied but settings? Using your default unmodified button directly on the NBT showcase theme page, everything are all copied correctly. Please advice without granting access.

  • Sajid

    Hi @Cas

    Hope you are doing good today :slight_smile:

    I am sorry for the delay on this ticket. I have tested by applying the changes you made in your template file and it still worked for me, with direct link or either by selecting the template on showcase page.

    As mentioned above it has nothing to do with these changes. Because the ID is present in the URL that's all the plugin need to copy a template into new site. So I think we should change our direction to troubleshoot this issue now and lets start deactivating other plugins on your website and activate them one by one to find out the culprit as illustrated in our getting support manual (flowchart).
    https://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    Let me know how it goes :slight_smile:

    Cheers, Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.