function alm_get_current_repeater($repeater, $type) { $template = $repeater; $include = ''; // If is Custom Repeaters (Custom Repeaters v1) if ($type == 'repeater' && has_action('alm_repeater_installed')) { $include = ALM_REPEATER_PATH . 'repeaters/' . $template . '.php'; if (!file_exists($include)) { //confirm file exists alm_get_default_repeater(); } } elseif ($type == 'template_' && has_action('alm_unlimited_installed')) { global $wpdb; $blog_id = $wpdb->blogid; if ($blog_id > 1) { $include = ALM_UNLIMITED_PATH . 'repeaters/' . $blog_id . '/' . $template . '.php'; } else { $include = ALM_UNLIMITED_PATH . 'repeaters/' . $template . '.php'; } if (!file_exists($include)) { //confirm file exists $include = alm_get_default_repeater(); } } else { $include = alm_get_default_repeater(); } return $include; }
$readOnly = 'false'; $template_dir = 'alm_templates'; if (is_child_theme()) { $template_theme_file = get_stylesheet_directory() . '/' . $template_dir . '/default.php'; if (!file_exists($template_theme_file)) { $template_theme_file = get_template_directory() . '/' . $template_dir . '/default.php'; } } else { $template_theme_file = get_template_directory() . '/' . $template_dir . '/default.php'; } // if theme or child theme contains the template, use that file if (file_exists($template_theme_file)) { $local_template = true; $readOnly = true; } $filename = alm_get_default_repeater(); // Get default repeater template $handle = fopen($filename, "r"); // Open file $contents = ''; if (filesize($filename) != 0) { $contents = fread($handle, filesize($filename)); } fclose($handle); ?> <h3 class="heading"><?php _e('Default Template', 'ajax-load-more'); ?> </h3> <div class="expand-wrap">