Update Theme System (8 posts)

  1. antonshevchuk
    Posted 5 years ago #

    Users who use my constructor theme have a trouble with update of it.
    It's because automatic update is clears destination folder:

    // from upgrade method in Theme_Upgrader class
    $options = array(
    	'package' => $r['package'],
    	'destination' => WP_CONTENT_DIR . '/themes',
    	'clear_destination' => true, // !!!
    	'clear_working' => true,
    	'hook_extra' => array('theme' => $theme);

    How I can avoid this error?

  2. tmonkey
    Posted 5 years ago #

    Is this a solution or a question? I'm having the problem with updating with a couple of sites... do child themes help with this?

  3. antonshevchuk
    Posted 5 years ago #

    It's question...

    I need solutions for avoid removal some folders in theme during automatic upgrade.

  4. aLan "Lan" Tait
    Posted 5 years ago #


    The problem you describe is not an "error" as you suggest.

    I am just starting to use your constructor theme. I am writing a plugin that had a similar problem. Here is a solution to the update problem...

    Preventing WordPress Automatic Updates From Deleting Custom Settings (Themes and Plugins)


  5. Frumph
    Posted 5 years ago #

    use the function $arrayvar = wp_upload_dir() to get the correct paths to the upload directories and put your content you do not want to get deleted from there instead of within the theme dir itself.

  6. aLan "Lan" Tait
    Posted 5 years ago #

    Thanks Frumph, this looks like a good solution for a few problems. Likewise [basedir] and [baseurl] in wp_upload_dir() look like a perfect replacement for custom. I will modify my code and the post to reflect this, Both in this Theme and in another theme and plugin I am working on.

    Thanks again Frump - this was a real help!

  7. Frumph
    Posted 5 years ago #

    Yup yup, it even puts the correct paths in there if a person is on wpms and such.

  8. antonshevchuk
    Posted 5 years ago #

    Thank you for information!!!
    New version in progress......

Topic Closed

This topic has been closed to new replies.

About this Topic