WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. kryu2
    Member
    Posted 12 months 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 12 months 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 11 months 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);

Reply

You must log in to post.

About this Plugin

About this Topic

Tags