Nicely done. I was just looking for this solution myself. The full solution is this:
To have it look in the child theme:
line 149 of ucOptions, change to $current_theme_has_uc_page = file_exists(get_stylesheet_directory() . '/under-construction.php');
and have it display the under-construction.php file on the child theme:
line 125 of underConstruction, change to
require_once(get_stylesheet_directory() . '/under-construction.php');
A better solution (which can be implemented in a future update) is to check to see if the currently active theme is a child theme and contains the under-construction.php file like this:
if (is_child_theme() && file_exists(get_stylesheet_directory() . '/under-construction.php')) {
$current_theme_has_uc_page = file_exists(get_stylesheet_directory() . '/under-construction.php');
} else {
$current_theme_has_uc_page = file_exists(get_stylesheet_directory() . '/under-construction.php');
}
That would replace line 149 $current_theme_has_uc_page = file_exists(get_template_directory() . '/under-construction.php');
And then for underConstruction.php, replace the following:
if($this->displayStatusCodeIs(3)){
require_once(get_template_directory() . '/under-construction.php');
die();
}
With this:
if($this->displayStatusCodeIs(3)){
if ( is_child_theme() && file_exists(get_stylesheet_directory() . '/under-construction.php') ) {
require_once(get_stylesheet_directory() . '/under-construction.php');
} else {
require_once(get_template_directory() . '/under-construction.php');
}
die();
}
This will allow for the under-construction.php to live in either the parent or child and pull from the correct place. And if it’s a child theme without the underconstruction.php, it will look to see if it exists in the parent and use it instead.