• When duplicating a theme in WP 4.1.1 I’m getting this error:

    Notice: Undefined index: dup_theme_child in
    .../wp-content/plugins/duplicate-theme/duplicate-theme.php on line 191 Notice: Undefined index: dup_theme_net in
    .../wp-content/plugins/duplicate-theme/duplicate-theme.php on line 228

    Try this. Use the @ to make sure you’re not accessing an unset variable

    Line 191:
    if( @$_POST['dup_theme_child'] && @$_POST['dup_theme_child']!=""){
    Line 228:
    if(@$_POST['dup_theme_net']){

    This at symbol is also known as the
    STFU operator, which some people don’t like, but would be a handy fix for this. Or perhaps you could use the isset() function.

    While you’re in there, maybe you could make the new theme folder name be lowercase rather than allowing it to be upper and lower?
    Add after line 131:
    str = str.toLowerCase();

    https://www.ads-software.com/plugins/duplicate-theme/

  • The topic ‘Undefined index: dup_theme_child’ is closed to new replies.