if (!defined('CCTM_PATH')) { exit('No direct script access allowed'); } if (!current_user_can('administrator')) { exit('Admins only.'); } require_once CCTM_PATH . '/includes/CCTM_PostTypeDef.php'; require_once CCTM_PATH . '/includes/CCTM_OutputFilter.php'; $data = array(); $data['page_title'] = sprintf(__('Sample Themes for %s', CCTM_TXTDOMAIN), "<em>{$post_type}</em>"); $data['help'] = 'http://code.google.com/p/wordpress-custom-content-type-manager/wiki/SampleTemplates'; $data['menu'] = sprintf('<a href="' . get_admin_url(false, 'admin.php') . '?page=cctm&a=list_post_types" class="button">%s</a>', __('Back', CCTM_TXTDOMAIN)) . ' ' . sprintf('<a href="' . get_admin_url(false, 'admin.php') . '?page=cctm&a=list_custom_field_types&pt=%s" class="button">%s</a>', $post_type, __('Create Custom Field for this Post Type', CCTM_TXTDOMAIN)); $data['msg'] = ''; $data['post_type'] = $post_type; // Validate post type if (!CCTM_PostTypeDef::is_existing_post_type($post_type)) { include CCTM_PATH . '/controllers/error.php'; return; } $current_theme_name = wp_get_theme(); $current_theme_path = get_stylesheet_directory(); $hash = array(); $tpl = file_get_contents(CCTM_PATH . '/tpls/samples/single_post.tpl'); $tpl = htmlspecialchars($tpl); $data['single_page_msg'] = sprintf(__('WordPress supports a custom theme file for each registered post-type (content-type). Copy the text below into a file named <strong>%s</strong> and save it into your active theme.', CCTM_TXTDOMAIN), 'single-' . $post_type . '.php'); $data['single_page_msg'] .= sprintf(__('You are currently using the %1$s theme. Save the file into the %2$s directory.', CCTM_TXTDOMAIN), '<strong>' . $current_theme_name . '</strong>', '<strong>' . $current_theme_path . '</strong>'); // built-in content types don't verbosely display what fields they display /* Array ( [product] => Array (