Hi. How can we help?

Tab Manager - How to transfer tab download from staging to live website

You have end to build your site in the staging site, and you have created a lot of custom tab with our plugin Tab Manager Premium.
From these custom tabs there are lot "download" tabs where you  have set a lot of files url.
How replace the old url after import all content on the live site ?

Simple, suppose that your staging site url was http://mystaginsite.com  , add this custom code in your functions.php

if( !function_exists( 'ywtm_change_url_path' ) ) {
add_filter( 'ywtm_change_url_path', 'ywtm_change_url_path', 10, 1 );

function ywtm_change_url_path( $file_url ) {

if ( ! empty( $file_url ) ) {
$current_site_url = get_site_url();
$old_site_url = 'http://mystaginsite.com';

$new_file_url = str_replace( $old_site_url, $current_site_url, $file_url );

if ( $new_file_url !== $file_url && ! is_wp_error( wp_remote_get( $new_file_url ) ) ) {

$file_url = $new_file_url;

}
}

return $file_url;
}
}

 

Was this article helpful?
1 out of 1 found this helpful

Back to Help Center >