get( 'Name' ); $child_theme_name = sprintf( __( '%s Child', 'themify' ), $parent_name ); $current_user = wp_get_current_user(); $author = sprintf( '%s (%s)', $current_user->display_name, $current_user->user_email ); $child_stylesheet_content = << 'defer', 'in_footer' => true ] ); } add_action( 'wp_enqueue_scripts', 'custom_child_theme_scripts' ); remove this line too */ /* Custom functions can be added below. */ MARKER; /* create the child theme functions.php */ Themify_Filesystem::put_contents( trailingslashit( $dir ) . 'functions.php', $functions_content ); /* copy screenshot */ $screenshot = $parent->get_screenshot( 'relative' ); if ( $screenshot ) { copy( trailingslashit( $parent->get_template_directory() ) . $screenshot, trailingslashit( $dir ) . $screenshot ); } $scripts_content = << $name, 'dir' => $dir ]; } /** * Generates a name to be used for auto generated child themes. * * @return string */ static function get_name() { $template = get_template(); $new_theme = "{$template}-child"; if ( is_multisite() ) { /* we may want a different child theme per site in the network */ $new_theme .= '-' . get_current_blog_id(); } return $new_theme; } /** * Check if current theme has a child theme * * @return bool */ static function exists() { $name = self::get_name(); $dir = trailingslashit( get_theme_root() ) . $name; return Themify_Filesystem::is_dir( $dir ); } static function form() { $exists = self::exists(); ?>