WordPress.org

Forums

UpdraftPlus Backup and Restoration
[resolved] Feature request:about zip filename creation logic (3 posts)

  1. kryu2
    Member
    Posted 1 year ago #

    I'm using a Japanse title on my WordPress site.

    UpdraftPlus plugin use a logic for creating a zip filename.
    $blog_name = preg_replace('/[^A-Za-z0-9_]/','', str_replace(' ','_', substr(get_bloginfo(), 0, 32)));

    get_bloginfo() returns blog name, then all blog name strings are delete.

    Could you add option to use URL parameter?
    Like get_bloginfo('url')

    https://wordpress.org/plugins/updraftplus/

  2. David Anderson
    Member
    Plugin Author

    Posted 1 year ago #

    Hi kryu2,

    If you follow the source a couple of lines down, you'll see that a filter already exists:

    $blog_name = apply_filters('updraftplus_blog_name', $blog_name);

    So, you can use that to set whatever you like; see: http://wp.smashingmagazine.com/2012/02/16/inside-wordpress-actions-filters/

    David

  3. kryu2
    Member
    Posted 1 year ago #

    Thank you for your quick replay.
    And sorry for my late response.

    I write a code below, and works fine!
    Thanks!!

    function updraftplus_filename_func() {
    	return str_replace(array('.','/'),'_', str_replace(array('http://','https;//'),'', substr(home_url(), 0, 32)));
    }
    add_filter( 'updraftplus_blog_name', 'updraftplus_filename_func', 10);

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • UpdraftPlus Backup and Restoration
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags