• Resolved kryu2

    (@kryu2)


    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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Anderson

    (@davidanderson)

    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

    Thread Starter kryu2

    (@kryu2)

    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);
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Feature request:about zip filename creation logic’ is closed to new replies.