function cpt_add_new() { global $cpt_error, $CPT_URL; $RETURN_URL = isset($_GET['return']) ? 'action="' . cpt_check_return(esc_attr($_GET['return'])) . '"' : ''; //check if we are editing a custom post type or creating a new one if (isset($_GET['edittype']) && !isset($_GET['cpt_edit'])) { check_admin_referer('cpt_edit_post_type'); //get post type to edit. This will reference array index for our option. $editType = intval($_GET['edittype']); //load custom posts saved in WP $cpt_options = get_option('cpt_custom_post_types'); //load custom post type values to edit $cpt_post_type_name = isset($cpt_options[$editType]["name"]) ? $cpt_options[$editType]["name"] : null; $cpt_label = isset($cpt_options[$editType]["label"]) ? $cpt_options[$editType]["label"] : null; $cpt_singular_label = isset($cpt_options[$editType]["singular_label"]) ? $cpt_options[$editType]["singular_label"] : null; $cpt_public = isset($cpt_options[$editType]["public"]) ? $cpt_options[$editType]["public"] : null; $cpt_showui = isset($cpt_options[$editType]["show_ui"]) ? $cpt_options[$editType]["show_ui"] : null; $cpt_capability = isset($cpt_options[$editType]["capability_type"]) ? $cpt_options[$editType]["capability_type"] : null; $cpt_hierarchical = isset($cpt_options[$editType]["hierarchical"]) ? $cpt_options[$editType]["hierarchical"] : null; $cpt_rewrite = isset($cpt_options[$editType]["rewrite"]) ? $cpt_options[$editType]["rewrite"] : null; $cpt_rewrite_slug = isset($cpt_options[$editType]["rewrite_slug"]) ? $cpt_options[$editType]["rewrite_slug"] : null; $cpt_rewrite_withfront = isset($cpt_options[$editType]["rewrite_withfront"]) ? $cpt_options[$editType]["rewrite_withfront"] : null; $cpt_query_var = isset($cpt_options[$editType]["query_var"]) ? $cpt_options[$editType]["query_var"] : null; $cpt_description = isset($cpt_options[$editType]["description"]) ? $cpt_options[$editType]["description"] : null; $cpt_menu_position = isset($cpt_options[$editType]["menu_position"]) ? $cpt_options[$editType]["menu_position"] : null; $cpt_menu_icon = isset($cpt_options[$editType]["menu_icon"]) ? $cpt_options[$editType]["menu_icon"] : null; $cpt_supports = isset($cpt_options[$editType][0]) ? $cpt_options[$editType][0] : null; $cpt_taxes = isset($cpt_options[$editType][1]) ? $cpt_options[$editType][1] : null; $cpt_labels = isset($cpt_options[$editType][2]) ? $cpt_options[$editType][2] : null; $cpt_has_archive = isset($cpt_options[$editType]["has_archive"]) ? $cpt_options[$editType]["has_archive"] : null; $cpt_exclude_from_search = isset($cpt_options[$editType]["exclude_from_search"]) ? $cpt_options[$editType]["exclude_from_search"] : null; $cpt_show_in_menu = isset($cpt_options[$editType]["show_in_menu"]) ? $cpt_options[$editType]["show_in_menu"] : true; $cpt_show_in_menu_string = isset($cpt_options[$editType]["show_in_menu_string"]) ? $cpt_options[$editType]["show_in_menu_string"] : null; $cpt_submit_name = __('Save Custom Post Type', 'cpt-plugin'); } else { $cpt_submit_name = __('Create Custom Post Type', 'cpt-plugin'); } if (isset($_GET['edittax']) && !isset($_GET['cpt_edit'])) { check_admin_referer('cpt_edit_tax'); //get post type to edit $editTax = intval($_GET['edittax']); //load custom posts saved in WP $cpt_options = get_option('cpt_custom_tax_types'); //load custom taxonomy values to edit $cpt_tax_name = $cpt_options[$editTax]["name"]; $cpt_tax_label = stripslashes($cpt_options[$editTax]["label"]); $cpt_singular_label_tax = stripslashes($cpt_options[$editTax]["singular_label"]); $cpt_tax_object_type = isset($cpt_options[$editTax]["cpt_name"]) ? $cpt_options[$editTax]["cpt_name"] : null; $cpt_tax_hierarchical = $cpt_options[$editTax]["hierarchical"]; $cpt_tax_showui = $cpt_options[$editTax]["show_ui"]; $cpt_tax_query_var = $cpt_options[$editTax]["query_var"]; $cpt_tax_rewrite = $cpt_options[$editTax]["rewrite"]; $cpt_tax_rewrite_slug = $cpt_options[$editTax]["rewrite_slug"]; $cpt_tax_show_admin_column = $cpt_options[$editTax]["show_admin_column"]; $cpt_tax_labels = stripslashes_deep($cpt_options[$editTax][0]); $cpt_post_types = $cpt_options[$editTax][1]; $cpt_tax_submit_name = __('Save Custom Taxonomy', 'cpt-plugin'); } else { $cpt_tax_submit_name = __('Create Custom Taxonomy', 'cpt-plugin'); } //flush rewrite rules flush_rewrite_rules(); /* BEGIN 'ADD NEW' PAGE OUTPUT */ ?> <div class="wrap"> <?php //check for success/error messages if (isset($_GET['cpt_msg'])) { ?> <div id="message" class="updated"> <?php if ($_GET['cpt_msg'] == 1) { _e('Custom post type created successfully. You may need to refresh to view the new post type in the admin menu.', 'cpt-plugin'); echo '<a href="' . cpt_check_return('cpt') . '"> ' . __('Manage custom post types', 'cpt-plugin') . '</a>'; } elseif ($_GET['cpt_msg'] == 2) { _e('Custom taxonomy created successfully. You may need to refresh to view the new taxonomy in the admin menu.', 'cpt-plugin'); echo '<a href="' . cpt_check_return('tax') . '"> ' . __('Manage custom taxonomies', 'cpt-plugin') . '</a>'; } ?> </div> <?php } else { if (isset($_GET['cpt_error'])) { ?> <div class="error"> <?php if ($_GET['cpt_error'] == 1) { _e('Post type name is a required field.', 'cpt-plugin'); } if ($_GET['cpt_error'] == 2) { _e('Taxonomy name is a required field.', 'cpt-plugin'); } if ($_GET['cpt_error'] == 3) { _e('You must assign your custom taxonomy to at least one post type.', 'cpt-plugin'); } if ($_GET['cpt_error'] == 4) { _e('Please doe not use quotes in your post type slug or rewrite slug.', 'cpt-plugin'); } if ($_GET['cpt_error'] == 5) { _e('Please doe not use quotes in your taxonomy slug or rewrite slug.', 'cpt-plugin'); } ?> </div> <?php } } screen_icon('plugins'); if (isset($_GET['edittype']) || isset($_GET['edittax'])) { ?> <h2> <?php _e('Edit Custom Post Type or Taxonomy', 'cpt-plugin'); ?> · <a href="<?php echo cpt_check_return('add'); ?> "> <?php _e('Reset', 'cpt-plugin'); ?> </a> </h2> <?php } else { ?> <h2> <?php _e('Create New Custom Post Type or Taxonomy', 'cpt-plugin'); ?> · <a href="<?php echo cpt_check_return('add'); ?> "> <?php _e('Reset', 'cpt-plugin'); ?> </a> </h2> <?php } ?> <table border="0" cellspacing="10" class="widefat"> <?php //BEGIN CPT HALF ?> <tr> <td width="50%" valign="top"> <p><?php _e('If you are unfamiliar with the options below only fill out the <strong>Post Type Name</strong> and <strong>Label</strong> fields and check which meta boxes to support. The other settings are set to the most common defaults for custom post types. Hover over the question mark for more details.', 'cpt-plugin'); ?> </p> <form method="post" <?php echo $RETURN_URL; ?> > <?php if (function_exists('wp_nonce_field')) { wp_nonce_field('cpt_add_custom_post_type'); } ?> <?php if (isset($_GET['edittype'])) { ?> <input type="hidden" name="cpt_edit" value="<?php echo esc_attr($editType); ?> " /> <?php } ?> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Post Type Name', 'cpt-plugin'); ?> <span class="required">*</span> <a href="#" title="<?php esc_attr_e('The post type name. Used to retrieve custom post type content. Should be short and sweet', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_custom_post_type[name]" tabindex="1" value="<?php if (isset($cpt_post_type_name)) { echo esc_attr($cpt_post_type_name); } ?> " maxlength="20" onblur="this.value=this.value.toLowerCase()" /> <?php _e('(e.g. movie)', 'cpt-plugin'); ?> <br /> <p><strong><?php _e('Max 20 characters, can not contain capital letters or spaces. Reserved post types: post, page, attachment, revision, nav_menu_item.', 'cpt-plugin'); ?> </strong></p> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Label', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_custom_post_type[label]" tabindex="2" value="<?php if (isset($cpt_label)) { echo esc_attr($cpt_label); } ?> " /> <?php _e('(e.g. Movies)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Singular Label', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom Post Type Singular label. Used in WordPress when a singular label is needed.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_custom_post_type[singular_label]" tabindex="3" value="<?php if (isset($cpt_singular_label)) { echo esc_attr($cpt_singular_label); } ?> " /> <?php _e('(e.g. Movie)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Description', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom Post Type Description. Describe what your custom post type is used for.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><textarea name="cpt_custom_post_type[description]" tabindex="4" rows="4" cols="40"><?php if (isset($cpt_description)) { echo esc_attr($cpt_description); } ?> </textarea></td> </tr> <tr valign="top"> <td colspan="2"> <p align="center"> <?php echo '<a href="#" class="comment_button" id="1">' . __('Advanced Label Options', 'cpt-plugin') . '</a>'; ?> | <?php echo '<a href="#" class="comment_button" id="2">' . __('Advanced Options', 'cpt-plugin') . '</a>'; ?> </p> </td> </tr> </table> <div style="display:none;" id="slidepanel1"> <p><?php _e('Below are the advanced label options for custom post types. If you are unfamiliar with these labels, leave them blank and the plugin will automatically create labels based off of your custom post type name', 'cpt-plugin'); ?> </p> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Menu Name', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom menu name for your custom post type.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[menu_name]" tabindex="2" value="<?php if (isset($cpt_labels["menu_name"])) { echo esc_attr($cpt_labels["menu_name"]); } ?> " /><br/> <?php _e('(e.g. My Movies)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Add New', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[add_new]" tabindex="2" value="<?php if (isset($cpt_labels["add_new"])) { echo esc_attr($cpt_labels["add_new"]); } ?> " /><br/> <?php _e('(e.g. Add New)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Add New Item', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[add_new_item]" tabindex="2" value="<?php if (isset($cpt_labels["add_new_item"])) { echo esc_attr($cpt_labels["add_new_item"]); } ?> " /><br/> <?php _e('(e.g. Add New Movie)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Edit', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[edit]" tabindex="2" value="<?php if (isset($cpt_labels["edit"])) { echo esc_attr($cpt_labels["edit"]); } ?> " /><br/> <?php _e('(e.g. Edit)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Edit Item', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[edit_item]" tabindex="2" value="<?php if (isset($cpt_labels["edit_item"])) { echo esc_attr($cpt_labels["edit_item"]); } ?> " /><br/> <?php _e('(e.g. Edit Movie)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('New Item', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[new_item]" tabindex="2" value="<?php if (isset($cpt_labels["new_item"])) { echo esc_attr($cpt_labels["new_item"]); } ?> " /><br/> <?php _e('(e.g. New Movie)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('View', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[view]" tabindex="2" value="<?php if (isset($cpt_labels["view"])) { echo esc_attr($cpt_labels["view"]); } ?> " /><br/> <?php _e('(e.g. View Movie)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('View Item', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[view_item]" tabindex="2" value="<?php if (isset($cpt_labels["view_item"])) { echo esc_attr($cpt_labels["view_item"]); } ?> " /><br/> <?php _e('(e.g. View Movie)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Search Items', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[search_items]" tabindex="2" value="<?php if (isset($cpt_labels["search_items"])) { echo esc_attr($cpt_labels["search_items"]); } ?> " /><br/> <?php _e('(e.g. Search Movies)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Not Found', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[not_found]" tabindex="2" value="<?php if (isset($cpt_labels["not_found"])) { echo esc_attr($cpt_labels["not_found"]); } ?> " /><br/> <?php _e('(e.g. No Movies Found)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Not Found in Trash', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[not_found_in_trash]" tabindex="2" value="<?php if (isset($cpt_labels["not_found_in_trash"])) { echo esc_attr($cpt_labels["not_found_in_trash"]); } ?> " /><br/> <?php _e('(e.g. No Movies found in Trash)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Parent', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Post type label. Used in the admin menu for displaying post types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_labels[parent]" tabindex="2" value="<?php if (isset($cpt_labels["parent"])) { echo esc_attr($cpt_labels["parent"]); } ?> " /><br/> <?php _e('(e.g. Parent Movie)', 'cpt-plugin'); ?> </td> </tr> </table> </div> <div style="display:none;" id="slidepanel2"> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Public', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Whether posts of this type should be shown in the admin UI', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_post_type[public]" tabindex="4"> <option value="0" <?php if (isset($cpt_public)) { if ($cpt_public == 0 && $cpt_public != '') { echo 'selected="selected"'; } } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_public)) { if ($cpt_public == 1 || is_null($cpt_public)) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: True)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Show UI', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Whether to generate a default UI for managing this post type', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_post_type[show_ui]" tabindex="5"> <option value="0" <?php if (isset($cpt_showui)) { if ($cpt_showui == 0 && $cpt_showui != '') { echo 'selected="selected"'; } } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_showui)) { if ($cpt_showui == 1 || is_null($cpt_showui)) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: True)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Has Archive', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Whether the post type will have a post type archive page', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_post_type[has_archive]" tabindex="6"> <option value="0" <?php if (isset($cpt_has_archive)) { if ($cpt_has_archive == 0) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_has_archive)) { if ($cpt_has_archive == 1) { echo 'selected="selected"'; } } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: False)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Exclude From Search', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Whether the post type will be searchable', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_post_type[exclude_from_search]" tabindex="6"> <option value="0" <?php if (isset($cpt_exclude_from_search)) { if ($cpt_exclude_from_search == 0) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_exclude_from_search)) { if ($cpt_exclude_from_search == 1) { echo 'selected="selected"'; } } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: False)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Capability Type', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('The post type to use for checking read, edit, and delete capabilities', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_custom_post_type[capability_type]" tabindex="6" value="<?php if (isset($cpt_capability)) { echo esc_attr($cpt_capability); } else { echo 'post'; } ?> " /></td> </tr> <tr valign="top"> <th scope="row"><?php _e('Hierarchical', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Whether the post type can have parent-child relationships', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_post_type[hierarchical]" tabindex="8"> <option value="0" <?php if (isset($cpt_hierarchical)) { if ($cpt_hierarchical == 0) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_hierarchical)) { if ($cpt_hierarchical == 1) { echo 'selected="selected"'; } } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: False)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Rewrite', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Triggers the handling of rewrites for this post type', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_post_type[rewrite]" tabindex="9"> <option value="0" <?php if (isset($cpt_rewrite)) { if ($cpt_rewrite == 0 && $cpt_rewrite != '') { echo 'selected="selected"'; } } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_rewrite)) { if ($cpt_rewrite == 1 || is_null($cpt_rewrite)) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: True)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Custom Rewrite Slug', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom slug to use instead of the default.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_custom_post_type[rewrite_slug]" tabindex="10" value="<?php if (isset($cpt_rewrite_slug)) { echo esc_attr($cpt_rewrite_slug); } ?> " /> <?php _e('(default: post type name)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('With Front', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Should the permastruct be prepended with the front base.', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_post_type[rewrite_withfront]" tabindex="4"> <option value="0" <?php if (isset($cpt_rewrite_withfront)) { if ($cpt_rewrite_withfront == 0 && $cpt_rewrite_withfront != '') { echo 'selected="selected"'; } } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_rewrite_withfront)) { if ($cpt_rewrite_withfront == 1 || is_null($cpt_rewrite_withfront)) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: True)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Query Var', 'cpt-plugin'); ?> <a href="#" title="" class="help">?</a></th> <td> <select name="cpt_custom_post_type[query_var]" tabindex="10"> <option value="0" <?php if (isset($cpt_query_var)) { if ($cpt_query_var == 0 && $cpt_query_var != '') { echo 'selected="selected"'; } } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_query_var)) { if ($cpt_query_var == 1 || is_null($cpt_query_var)) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: True)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Menu Position', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('The position in the menu order the post type should appear. show_in_menu must be true.', 'cpt-plugin'); ?> " class="help">?</a> <p><?php _e('See <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Parameters">Available options</a> in the "menu_position" section. Range of 5-100', 'cpt-plugin'); ?> </p> </th> <td><input type="text" name="cpt_custom_post_type[menu_position]" tabindex="11" size="5" value="<?php if (isset($cpt_menu_position)) { echo esc_attr($cpt_menu_position); } ?> " /></td> </tr> <tr valign="top"> <th scope="row"><?php _e('Show in Menu', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Whether to show the post type in the admin menu and where to show that menu. Note that show_ui must be true', 'cpt-plugin'); ?> " class="help">?</a> <p><?php _e('"Show UI" must be "true". If an existing top level page such as "tools.php" is indicated for second input, post type will be sub menu of that.', 'cpt-plugins'); ?> </p> </th> <td> <p><select name="cpt_custom_post_type[show_in_menu]" tabindex="10"> <option value="0" <?php if (isset($cpt_show_in_menu)) { if ($cpt_show_in_menu == 0) { echo 'selected="selected"'; } } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_show_in_menu)) { if ($cpt_show_in_menu == 1 || is_null($cpt_show_in_menu)) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select></p> <p> <input type="text" name="cpt_custom_post_type[show_in_menu_string]" tabindex="12" size="20" value="<?php if (isset($cpt_show_in_menu_string)) { echo esc_attr($cpt_show_in_menu_string); } ?> " /></p></td> </tr> <tr valign="top"> <th scope="row"><?php _e('Menu Icon', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('URL to image to be used as menu icon.', 'cpt-plugin'); ?> " class="help">?</a> </th> <td><input type="text" name="cpt_custom_post_type[menu_icon]" tabindex="11" size="20" value="<?php if (isset($cpt_menu_icon)) { echo esc_attr($cpt_menu_icon); } ?> " /> (Full URL for icon)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Supports', 'cpt-plugin'); ?> </th> <td> <input type="checkbox" name="cpt_supports[]" tabindex="11" value="title" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('title', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Title', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds the title meta box when creating content for this custom post type', 'cpt-plugin'); ?> " class="help">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="12" value="editor" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('editor', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Editor', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds the content editor meta box when creating content for this custom post type', 'cpt-plugin'); ?> " class="help">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="13" value="excerpt" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('excerpt', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Excerpt', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds the excerpt meta box when creating content for this custom post type', 'cpt-plugin'); ?> " class="help">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="14" value="trackbacks" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('trackbacks', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Trackbacks', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds the trackbacks meta box when creating content for this custom post type', 'cpt-plugin'); ?> " class="help">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="15" value="custom-fields" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('custom-fields', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Custom Fields', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds the custom fields meta box when creating content for this custom post type', 'cpt-plugin'); ?> " class="help">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="16" value="comments" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('comments', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Comments', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds the comments meta box when creating content for this custom post type', 'cpt-plugin'); ?> " class="help">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="17" value="revisions" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('revisions', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Revisions', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds the revisions meta box when creating content for this custom post type', 'cpt-plugin'); ?> " class="help">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="18" value="thumbnail" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('thumbnail', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Featured Image', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds the featured image meta box when creating content for this custom post type', 'cpt-plugin'); ?> " class="help">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="19" value="author" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('author', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Author', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds the author meta box when creating content for this custom post type', 'cpt-plugin'); ?> " class="help">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="20" value="page-attributes" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('page-attributes', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Page Attributes', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds the page attribute meta box when creating content for this custom post type', 'cpt-plugin'); ?> " class="help">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="21" value="post-formats" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('post-formats', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> <?php _e('Post Formats', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Adds post format support', 'cpt-plugin'); ?> " class="help">?</a> <br/ > </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Built-in Taxonomies', 'cpt-plugin'); ?> </th> <td> <?php //load built-in WP Taxonomies $args = array('public' => true); $output = 'objects'; $add_taxes = get_taxonomies($args, $output); foreach ($add_taxes as $add_tax) { if ($add_tax->name != 'nav_menu' && $add_tax->name != 'post_format') { ?> <input type="checkbox" name="cpt_addon_taxes[]" tabindex="20" value="<?php echo $add_tax->name; ?> " <?php if (isset($cpt_taxes) && is_array($cpt_taxes)) { if (in_array($add_tax->name, $cpt_taxes)) { echo 'checked="checked"'; } } ?> /> <?php echo $add_tax->label; ?> <br /> <?php } } ?> </td> </tr> </table> </div> <p class="submit"> <input type="submit" class="button-primary" tabindex="21" name="cpt_submit" value="<?php echo $cpt_submit_name; ?> " /> </p> </form> </td> <?php //BEGIN TAXONOMY SIDE ?> <td width="50%" valign="top"> <?php //debug area $cpt_options = get_option('cpt_custom_tax_types'); ?> <p><?php _e('If you are unfamiliar with the options below only fill out the <strong>Taxonomy Name</strong> and <strong>Post Type Name</strong> fields. The other settings are set to the most common defaults for custom taxonomies. Hover over the question mark for more details.', 'cpt-plugin'); ?> </p> <form method="post" <?php echo $RETURN_URL; ?> > <?php if (function_exists('wp_nonce_field')) { wp_nonce_field('cpt_add_custom_taxonomy'); } ?> <?php if (isset($_GET['edittax'])) { ?> <input type="hidden" name="cpt_edit_tax" value="<?php echo $editTax; ?> " /> <?php } ?> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Taxonomy Name', 'cpt-plugin'); ?> <span class="required">*</span> <a href="#" title="<?php esc_attr_e('The taxonomy name. Used to retrieve custom taxonomy content. Should be short and sweet', 'cpt-plugin'); ?> " class="help">?</a> <p><?php _e('Note: Changing the name, after adding terms to the taxonomy, will not update the terms in the database.', 'cpt-plugin'); ?> </p> </th> <td><input type="text" name="cpt_custom_tax[name]" maxlength="32" onblur="this.value=this.value.toLowerCase()" tabindex="21" value="<?php if (isset($cpt_tax_name)) { echo esc_attr($cpt_tax_name); } ?> " /> <?php _e('(e.g. actors)', 'cpt-plugin'); ?> <p><strong><?php _e('Max 32 characters, should only contain alphanumeric lowercase characters and underscores in place of spaces.', 'cpt-plugin'); ?> </strong></p> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Label', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Taxonomy label. Used in the admin menu for displaying custom taxonomy.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_custom_tax[label]" tabindex="22" value="<?php if (isset($cpt_tax_label)) { echo esc_attr($cpt_tax_label); } ?> " /> <?php _e('(e.g. Actors)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Singular Label', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Taxonomy Singular label. Used in WordPress when a singular label is needed.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_custom_tax[singular_label]" tabindex="23" value="<?php if (isset($cpt_singular_label_tax)) { echo esc_attr($cpt_singular_label_tax); } ?> " /> <?php _e('(e.g. Actor)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Attach to Post Type', 'cpt-plugin'); ?> <span class="required">*</span> <a href="#" title="<?php esc_attr_e('What post type object to attach the custom taxonomy to. Can be post, page, or link by default. Can also be any custom post type name.', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <?php if (isset($cpt_tax_object_type)) { ?> <strong><?php _e('This is the old method. Delete the post type from the textbox and check which post type to attach this taxonomy to</strong>', 'cpt-plugin'); ?> <input type="text" name="cpt_custom_tax[cpt_name]" tabindex="24" value="<?php if (isset($cpt_tax_object_type)) { echo esc_attr($cpt_tax_object_type); } ?> " /> <?php _e('(e.g. movies)', 'cpt-plugin'); ?> <?php } ?> <?php $args = array('public' => true); $output = 'objects'; // or objects $post_types = get_post_types($args, $output); foreach ($post_types as $post_type) { if ($post_type->name != 'attachment') { ?> <input type="checkbox" name="cpt_post_types[]" tabindex="20" value="<?php echo $post_type->name; ?> " <?php if (isset($cpt_post_types) && is_array($cpt_post_types)) { if (in_array($post_type->name, $cpt_post_types)) { echo 'checked="checked"'; } } ?> /> <?php echo $post_type->label; ?> <br /> <?php } } ?> </td> </tr> <tr valign="top"> <td colspan="2"> <p align="center"> <?php echo '<a href="#" class="comment_button" id="3">' . __('Advanced Label Options', 'cpt-plugin') . '</a>'; ?> | <?php echo '<a href="#" class="comment_button" id="4">' . __('Advanced Options', 'cpt-plugin') . '</a>'; ?> </p> </td> </tr> </table> <div style="display:none;" id="slidepanel3"> <p><?php _e('Below are the advanced label options for custom taxonomies. If you are unfamiliar with these labels the plugin will automatically create labels based off of your custom taxonomy name', 'cpt-plugin'); ?> </p> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Search Items', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[search_items]" tabindex="2" value="<?php if (isset($cpt_tax_labels["search_items"])) { echo esc_attr($cpt_tax_labels["search_items"]); } ?> " /><br/> <?php _e('(e.g. Search Actors)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Popular Items', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[popular_items]" tabindex="2" value="<?php if (isset($cpt_tax_labels["popular_items"])) { echo esc_attr($cpt_tax_labels["popular_items"]); } ?> " /><br/> <?php _e('(e.g. Popular Actors)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('All Items', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[all_items]" tabindex="2" value="<?php if (isset($cpt_tax_labels["all_items"])) { echo esc_attr($cpt_tax_labels["all_items"]); } ?> " /><br/> <?php _e('(e.g. All Actors)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Parent Item', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[parent_item]" tabindex="2" value="<?php if (isset($cpt_tax_labels["parent_item"])) { echo esc_attr($cpt_tax_labels["parent_item"]); } ?> " /><br/> <?php _e('(e.g. Parent Actor)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Parent Item Colon', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[parent_item_colon]" tabindex="2" value="<?php if (isset($cpt_tax_labels["parent_item_colon"])) { echo esc_attr($cpt_tax_labels["parent_item_colon"]); } ?> " /><br/> <?php _e('(e.g. Parent Actor:)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Edit Item', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[edit_item]" tabindex="2" value="<?php if (isset($cpt_tax_labels["edit_item"])) { echo esc_attr($cpt_tax_labels["edit_item"]); } ?> " /><br/> <?php _e('(e.g. Edit Actor)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Update Item', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[update_item]" tabindex="2" value="<?php if (isset($cpt_tax_labels["update_item"])) { echo esc_attr($cpt_tax_labels["update_item"]); } ?> " /><br/> <?php _e('(e.g. Update Actor)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Add New Item', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[add_new_item]" tabindex="2" value="<?php if (isset($cpt_tax_labels["add_new_item"])) { echo esc_attr($cpt_tax_labels["add_new_item"]); } ?> " /><br/> <?php _e('(e.g. Add New Actor)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('New Item Name', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[new_item_name]" tabindex="2" value="<?php if (isset($cpt_tax_labels["new_item_name"])) { echo esc_attr($cpt_tax_labels["new_item_name"]); } ?> " /><br/> <?php _e('(e.g. New Actor Name)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Separate Items with Commas', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[separate_items_with_commas]" tabindex="2" value="<?php if (isset($cpt_tax_labels["separate_items_with_commas"])) { echo esc_attr($cpt_tax_labels["separate_items_with_commas"]); } ?> " /><br/> <?php _e('(e.g. Separate actors with commas)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Add or Remove Items', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[add_or_remove_items]" tabindex="2" value="<?php if (isset($cpt_tax_labels["add_or_remove_items"])) { echo esc_attr($cpt_tax_labels["add_or_remove_items"]); } ?> " /><br/> <?php _e('(e.g. Add or remove actors)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Choose From Most Used', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_tax_labels[choose_from_most_used]" tabindex="2" value="<?php if (isset($cpt_tax_labels["choose_from_most_used"])) { echo esc_attr($cpt_tax_labels["choose_from_most_used"]); } ?> " /><br/> <?php _e('(e.g. Choose from the most used actors)', 'cpt-plugin'); ?> </td> </tr> </table> </div> <div style="display:none;" id="slidepanel4"> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Hierarchical', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Whether the taxonomy can have parent-child relationships', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_tax[hierarchical]" tabindex="25"> <option value="0" <?php if (isset($cpt_tax_hierarchical)) { if ($cpt_tax_hierarchical == 0) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> >False</option> <option value="1" <?php if (isset($cpt_tax_hierarchical)) { if ($cpt_tax_hierarchical == 1) { echo 'selected="selected"'; } } ?> >True</option> </select> <?php _e('(default: False)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Show UI', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Whether to generate a default UI for managing this custom taxonomy', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_tax[show_ui]" tabindex="26"> <option value="0" <?php if (isset($cpt_tax_showui)) { if ($cpt_tax_showui == 0 && $cpt_tax_showui != '') { echo 'selected="selected"'; } } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_tax_showui)) { if ($cpt_tax_showui == 1 || is_null($cpt_tax_showui)) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: True)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Query Var', 'cpt-plugin'); ?> <a href="#" title="" class="help">?</a></th> <td> <select name="cpt_custom_tax[query_var]" tabindex="27"> <option value="0" <?php if (isset($cpt_tax_query_var)) { if ($cpt_tax_query_var == 0 && $cpt_tax_query_var != '') { echo 'selected="selected"'; } } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_tax_query_var)) { if ($cpt_tax_query_var == 1 || is_null($cpt_tax_query_var)) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: True)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Rewrite', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Triggers the handling of rewrites for this taxonomy', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_tax[rewrite]" tabindex="28"> <option value="0" <?php if (isset($cpt_tax_rewrite)) { if ($cpt_tax_rewrite == 0 && $cpt_tax_rewrite != '') { echo 'selected="selected"'; } } ?> ><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" <?php if (isset($cpt_tax_rewrite)) { if ($cpt_tax_rewrite == 1 || is_null($cpt_tax_rewrite)) { echo 'selected="selected"'; } } else { echo 'selected="selected"'; } ?> ><?php _e('True', 'cpt-plugin'); ?> </option> </select> <?php _e('(default: True)', 'cpt-plugin'); ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Custom Rewrite Slug', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Custom Taxonomy Rewrite Slug', 'cpt-plugin'); ?> " class="help">?</a></th> <td><input type="text" name="cpt_custom_tax[rewrite_slug]" tabindex="9" value="<?php if (isset($cpt_tax_rewrite_slug)) { echo esc_attr($cpt_tax_rewrite_slug); } ?> " /> <?php _e('(default: taxonomy name)', 'cpt-plugin'); ?> </td> </tr> <?php if (version_compare(CPTUI_WP_VERSION, '3.5', '>')) { ?> <tr valign="top"> <th scope="row"><?php _e('Show Admin Column', 'cpt-plugin'); ?> <a href="#" title="<?php esc_attr_e('Whether to allow automatic creation of taxonomy columns on associated post-types.', 'cpt-plugin'); ?> " class="help">?</a></th> <td> <select name="cpt_custom_tax[show_admin_column]" tabindex="28"> <?php if (!isset($cpt_tax_show_admin_column) || $cpt_tax_show_admin_column == 0) { ?> <option value="0" selected="selected"><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1"><?php _e('True', 'cpt-plugin'); ?> </option> <?php } else { ?> <option value="0"><?php _e('False', 'cpt-plugin'); ?> </option> <option value="1" selected="selected"><?php _e('True', 'cpt-plugin'); ?> </option> <?php } ?> </select> <?php _e('(default: False)', 'cpt-plugin'); ?> </td> </tr> <?php } ?> </table> </div> <p class="submit"> <input type="submit" class="button-primary" tabindex="29" name="cpt_add_tax" value="<?php echo $cpt_tax_submit_name; ?> " /> </p> </form> </td> </tr> </table> </div> <?php //load footer cpt_footer(); }
function cpt_add_new() { global $cpt_error, $CPT_URL; If (isset($_GET['return'])) { $RETURN_URL = 'action="' .cpt_check_return(esc_attr($_GET['return'])). '"'; }Else{ $RETURN_URL = ''; } //check if we are editing a custom post type or creating a new one If (isset($_GET['edittype']) && !isset($_GET['cpt_edit'])) { check_admin_referer('cpt_edit_post_type'); //get post type to edit $editType = intval($_GET['edittype']); //load custom posts saved in WP $cpt_options = get_option('cpt_custom_post_types'); //load custom post type values to edit $cpt_post_type_name = $cpt_options[$editType]["name"]; $cpt_label = $cpt_options[$editType]["label"]; $cpt_singular_label = $cpt_options[$editType]["singular_label"]; $cpt_public = $cpt_options[$editType]["public"]; $cpt_showui = $cpt_options[$editType]["show_ui"]; $cpt_capability = $cpt_options[$editType]["capability_type"]; $cpt_hierarchical = $cpt_options[$editType]["hierarchical"]; $cpt_rewrite = $cpt_options[$editType]["rewrite"]; $cpt_rewrite_slug = $cpt_options[$editType]["rewrite_slug"]; $cpt_query_var = $cpt_options[$editType]["query_var"]; $cpt_description = $cpt_options[$editType]["description"]; $cpt_menu_position = $cpt_options[$editType]["menu_position"]; $cpt_supports = $cpt_options[$editType][0]; $cpt_taxes = $cpt_options[$editType][1]; $cpt_labels = $cpt_options[$editType][2]; $cpt_submit_name = 'Save Custom Post Type'; }Else{ $cpt_submit_name = 'Create Custom Post Type'; } If (isset($_GET['edittax']) && !isset($_GET['cpt_edit'])) { check_admin_referer('cpt_edit_tax'); //get post type to edit $editTax = intval($_GET['edittax']); //load custom posts saved in WP $cpt_options = get_option('cpt_custom_tax_types'); //load custom post type values to edit $cpt_tax_name = $cpt_options[$editTax]["name"]; $cpt_tax_label = $cpt_options[$editTax]["label"]; $cpt_singular_label = $cpt_options[$editTax]["singular_label"]; $cpt_tax_object_type = ( isset( $cpt_options[$editTax]["cpt_name"] ) ) ? $cpt_options[$editTax]["cpt_name"] : null; $cpt_tax_hierarchical = $cpt_options[$editTax]["hierarchical"]; $cpt_tax_showui = $cpt_options[$editTax]["show_ui"]; $cpt_tax_query_var = $cpt_options[$editTax]["query_var"]; $cpt_tax_rewrite = $cpt_options[$editTax]["rewrite"]; $cpt_tax_rewrite_slug = $cpt_options[$editTax]["rewrite_slug"]; $cpt_tax_labels = $cpt_options[$editTax][0]; $cpt_post_types = $cpt_options[$editTax][1]; $cpt_tax_submit_name = 'Save Custom Taxonomy'; }Else{ $cpt_tax_submit_name = 'Create Custom Taxonomy'; } //flush rewrite rules flush_rewrite_rules(); ?><div class="wrap"><?php //check for success/error messages If (isset($_GET['cpt_msg']) && $_GET['cpt_msg']==1) { ?> <div id="message" class="updated"> <?php _e('Custom post type created successfully. You may need to refresh to view the new post type.', 'cpt-plugin'); ?> </div> <?php }elseIf (isset($_GET['cpt_msg']) && $_GET['cpt_msg']==2) { ?> <div id="message" class="updated"> <?php _e('Custom taxonomy created successfully. You may need to refresh to view the new taxonomy.', 'cpt-plugin'); ?> </div> <?php }else{ If (isset($_GET['cpt_error']) && $_GET['cpt_error']==1) { ?> <div class="error"> <?php _e('Post type name is a required field.', 'cpt-plugin'); ?> </div> <?php }ElseIf (isset($_GET['cpt_error']) && $_GET['cpt_error']==2) { ?> <div class="error"> <?php _e('Taxonomy name is a required field.', 'cpt-plugin'); ?> </div> <?php }ElseIf (isset($_GET['cpt_error']) && $_GET['cpt_error']==3) { ?> <div class="error"> <?php _e('You must assign your custom taxonomy to at least one post type.', 'cpt-plugin'); ?> </div> <?php } } ?> <table border="0" cellspacing="10"> <tr> <td width="50%" valign="top"> <?php If (isset($_GET['edittype'])) { ?> <h2><?php _e('Edit Custom Post Type', 'cpt-plugin') ?> · <a href="<?php echo cpt_check_return( 'add' ); ?>"><?php _e('Reset', 'cpt-plugin');?></a></h2> <?php }Else{ ?> <h2><?php _e('Create New Custom Post Type', 'cpt-plugin') ?> · <a href="<?php echo cpt_check_return( 'add' ); ?>"><?php _e('Reset', 'cpt-plugin');?></a></h2> <?php } ?> <p><?php _e('If you are unfamiliar with the options below only fill out the <strong>Post Type Name</strong> and <strong>Label</strong> fields and check which meta boxes to support. The other settings are set to the most common defaults for custom post types.', 'cpt-plugin'); ?></p> <form method="post" <?php echo $RETURN_URL; ?>> <?php if ( function_exists('wp_nonce_field') ) wp_nonce_field('cpt_add_custom_post_type'); ?> <?php If (isset($_GET['edittype'])) { ?> <input type="hidden" name="cpt_edit" value="<?php echo $editType; ?>" /> <?php } ?> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Post Type Name', 'cpt-plugin') ?> <span style="color:red;">*</span></th> <td><input type="text" name="cpt_custom_post_type[name]" tabindex="1" value="<?php If (isset($cpt_post_type_name)) { echo esc_attr($cpt_post_type_name); } ?>" /> <a href="#" title="The post type name. Used to retrieve custom post type content. Should be short and sweet" style="cursor: help;">?</a> (e.g. movies)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Label', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_custom_post_type[label]" tabindex="2" value="<?php If (isset($cpt_label)) { echo esc_attr($cpt_label); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Movies)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Singular Label', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_custom_post_type[singular_label]" tabindex="3" value="<?php If (isset($cpt_singular_label)) { echo esc_attr($cpt_singular_label); } ?>" /> <a href="#" title="Custom Post Type Singular label. Used in WordPress when a singular label is needed." style="cursor: help;">?</a> (e.g. Movie)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Description', 'cpt-plugin') ?></th> <td><textarea name="cpt_custom_post_type[description]" tabindex="4" rows="4" cols="40"><?php If (isset($cpt_description)) { echo esc_attr($cpt_description); } ?></textarea><a href="#" title="Custom Post Type Description. Describe what your custom post type is used for." style="cursor: help;">?</a></td> </tr> <tr valign="top"> <th scope="row"><?php echo '<p><a href="#" class="comment_button" id="1">' . __('View Advanced Label Options', 'cpt-plugin') . '</a>'; ?></th> <td><?php echo '<p><a href="#" class="comment_button" id="2">' . __('View Advanced Options', 'cpt-plugin') . '</a>'; ?></td> </tr> </table> <div style="display:none;" id="slidepanel1"> <p><?php _e('Below are the advanced label options for custom post types. If you are unfamiliar with these labels the plugin will automatically create labels based off of your custom post type name', 'cpt-plugin'); ?></p> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Add New', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[add_new]" tabindex="2" value="<?php If (isset($cpt_labels["add_new"])) { echo esc_attr($cpt_labels["add_new"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Add New)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Add New Item', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[add_new_item]" tabindex="2" value="<?php If (isset($cpt_labels["add_new_item"])) { echo esc_attr($cpt_labels["add_new_item"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Add New Movie)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Edit', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[edit]" tabindex="2" value="<?php If (isset($cpt_labels["edit"])) { echo esc_attr($cpt_labels["edit"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Edit)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Edit Item', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[edit_item]" tabindex="2" value="<?php If (isset($cpt_labels["edit_item"])) { echo esc_attr($cpt_labels["edit_item"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Edit Movie)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('New Item', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[new_item]" tabindex="2" value="<?php If (isset($cpt_labels["new_item"])) { echo esc_attr($cpt_labels["new_item"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. New Movie)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('View', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[view]" tabindex="2" value="<?php If (isset($cpt_labels["view"])) { echo esc_attr($cpt_labels["view"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. View Movie)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('View Item', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[view_item]" tabindex="2" value="<?php If (isset($cpt_labels["view_item"])) { echo esc_attr($cpt_labels["view_item"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. View Movie)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Search Items', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[search_items]" tabindex="2" value="<?php If (isset($cpt_labels["search_items"])) { echo esc_attr($cpt_labels["search_items"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Search Movies)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Not Found', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[not_found]" tabindex="2" value="<?php If (isset($cpt_labels["not_found"])) { echo esc_attr($cpt_labels["not_found"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. No Movies Found)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Not Found in Trash', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[not_found_in_trash]" tabindex="2" value="<?php If (isset($cpt_labels["not_found_in_trash"])) { echo esc_attr($cpt_labels["not_found_in_trash"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. No Movies found in Trash)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Parent', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_labels[parent]" tabindex="2" value="<?php If (isset($cpt_labels["parent"])) { echo esc_attr($cpt_labels["parent"]); } ?>" /> <a href="#" title="Post type label. Used in the admin menu for displaying post types." style="cursor: help;">?</a> (e.g. Parent Movie)</td> </tr> </table> </div> <div style="display:none;" id="slidepanel2"> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Public', 'cpt-plugin') ?></th> <td> <SELECT name="cpt_custom_post_type[public]" tabindex="4"> <OPTION value="0" <?php If (isset($cpt_public)) { If ($cpt_public == 0 && $cpt_public != '') { echo 'selected="selected"'; } } ?>>False</OPTION> <OPTION value="1" <?php If (isset($cpt_public)) { If ($cpt_public == 1 || is_null($cpt_public)) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>True</OPTION> </SELECT> <a href="#" title="Whether posts of this type should be shown in the admin UI" style="cursor: help;">?</a> (default: True) </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Show UI', 'cpt-plugin') ?></th> <td> <SELECT name="cpt_custom_post_type[show_ui]" tabindex="5"> <OPTION value="0" <?php If (isset($cpt_showui)) { If ($cpt_showui == 0 && $cpt_showui != '') { echo 'selected="selected"'; } } ?>>False</OPTION> <OPTION value="1" <?php If (isset($cpt_showui)) { If ($cpt_showui == 1 || is_null($cpt_showui)) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>True</OPTION> </SELECT> <a href="#" title="Whether to generate a default UI for managing this post type" style="cursor: help;">?</a> (default: True) </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Capability Type', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_custom_post_type[capability_type]" tabindex="6" value="post" value="<?php echo esc_attr($cpt_capability); ?>" /> <a href="#" title="The post type to use for checking read, edit, and delete capabilities" style="cursor: help;">?</a></td> </tr> <tr valign="top"> <th scope="row"><?php _e('Hierarchical', 'cpt-plugin') ?></th> <td> <SELECT name="cpt_custom_post_type[hierarchical]" tabindex="7"> <OPTION value="0" <?php If (isset($cpt_hierarchical)) { If ($cpt_hierarchical == 0) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>False</OPTION> <OPTION value="1" <?php If (isset($cpt_hierarchical)) { If ($cpt_hierarchical == 1) { echo 'selected="selected"'; } } ?>>True</OPTION> </SELECT> <a href="#" title="Whether the post type is hierarchical" style="cursor: help;">?</a> (default: False) </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Rewrite', 'cpt-plugin') ?></th> <td> <SELECT name="cpt_custom_post_type[rewrite]" tabindex="8"> <OPTION value="0" <?php If (isset($cpt_rewrite)) { If ($cpt_rewrite == 0 && $cpt_rewrite != '') { echo 'selected="selected"'; } } ?>>False</OPTION> <OPTION value="1" <?php If (isset($cpt_rewrite)) { If ($cpt_rewrite == 1 || is_null($cpt_rewrite)) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>True</OPTION> </SELECT> <a href="#" title="" style="cursor: help;">?</a> (default: True) </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Custom Rewrite Slug', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_custom_post_type[rewrite_slug]" tabindex="9" value="<?php If (isset($cpt_rewrite_slug)) { echo esc_attr($cpt_rewrite_slug); } ?>" /> <a href="#" title="Custom Post Type Rewrite Slug" style="cursor: help;">?</a> (default: post type name)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Query Var', 'cpt-plugin') ?></th> <td> <SELECT name="cpt_custom_post_type[query_var]" tabindex="10"> <OPTION value="0" <?php If (isset($cpt_query_var)) { If ($cpt_query_var == 0 && $cpt_query_var != '') { echo 'selected="selected"'; } } ?>>False</OPTION> <OPTION value="1" <?php If (isset($cpt_query_var)) { If ($cpt_query_var == 1 || is_null($cpt_query_var)) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>True</OPTION> </SELECT> <a href="#" title="" style="cursor: help;">?</a> (default: True) </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Menu Position', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_custom_post_type[menu_position]" tabindex="11" size="5" value="<?php If (isset($cpt_menu_position)) { echo esc_attr($cpt_menu_position); } ?>" /> <a href="#" title="The menu position of the custom post type" style="cursor: help;">?</a></td> </tr> <tr valign="top"> <th scope="row"><?php _e('Supports', 'cpt-plugin') ?></th> <td> <input type="checkbox" name="cpt_supports[]" tabindex="11" value="title" <?php If (isset($cpt_supports) && is_array($cpt_supports)) { If (in_array('title', $cpt_supports)) { echo 'checked="checked"'; } }Elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> Title <a href="#" title="Adds the title meta box when creating content for this custom post type" style="cursor: help;">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="12" value="editor" <?php If (isset($cpt_supports) && is_array($cpt_supports)) { If (in_array('editor', $cpt_supports)) { echo 'checked="checked"'; } }Elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> Editor <a href="#" title="Adds the content editor meta box when creating content for this custom post type" style="cursor: help;">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="13" value="excerpt" <?php If (isset($cpt_supports) && is_array($cpt_supports)) { If (in_array('excerpt', $cpt_supports)) { echo 'checked="checked"'; } }Elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> Excerpt <a href="#" title="Adds the excerpt meta box when creating content for this custom post type" style="cursor: help;">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="14" value="trackbacks" <?php If (isset($cpt_supports) && is_array($cpt_supports)) { If (in_array('trackbacks', $cpt_supports)) { echo 'checked="checked"'; } }Elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> Trackbacks <a href="#" title="Adds the trackbacks meta box when creating content for this custom post type" style="cursor: help;">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="15" value="custom-fields" <?php If (isset($cpt_supports) && is_array($cpt_supports)) { If (in_array('custom-fields', $cpt_supports)) { echo 'checked="checked"'; } }Elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> Custom Fields <a href="#" title="Adds the custom fields meta box when creating content for this custom post type" style="cursor: help;">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="16" value="comments" <?php If (isset($cpt_supports) && is_array($cpt_supports)) { If (in_array('comments', $cpt_supports)) { echo 'checked="checked"'; } }Elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> Comments <a href="#" title="Adds the comments meta box when creating content for this custom post type" style="cursor: help;">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="17" value="revisions" <?php If (isset($cpt_supports) && is_array($cpt_supports)) { If (in_array('revisions', $cpt_supports)) { echo 'checked="checked"'; } }Elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> Revisions <a href="#" title="Adds the revisions meta box when creating content for this custom post type" style="cursor: help;">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="18" value="thumbnail" <?php If (isset($cpt_supports) && is_array($cpt_supports)) { If (in_array('thumbnail', $cpt_supports)) { echo 'checked="checked"'; } }Elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> Featured Image <a href="#" title="Adds the featured image meta box when creating content for this custom post type" style="cursor: help;">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="19" value="author" <?php If (isset($cpt_supports) && is_array($cpt_supports)) { If (in_array('author', $cpt_supports)) { echo 'checked="checked"'; } }Elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> Author <a href="#" title="Adds the author meta box when creating content for this custom post type" style="cursor: help;">?</a> <br/ > <input type="checkbox" name="cpt_supports[]" tabindex="20" value="page-attributes" <?php If (isset($cpt_supports) && is_array($cpt_supports)) { If (in_array('page-attributes', $cpt_supports)) { echo 'checked="checked"'; } }Elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> /> Page Attributes <a href="#" title="Adds the page attribute meta box when creating content for this custom post type" style="cursor: help;">?</a> <br/ > </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Built-in Taxonomies', 'cpt-plugin') ?></th> <td> <?php //load built-in WP Taxonomies $args=array( 'public' => true ); $output = 'objects'; $add_taxes = get_taxonomies($args,$output); foreach ($add_taxes as $add_tax ) { if ( $add_tax->name != 'nav_menu' ) { ?> <input type="checkbox" name="cpt_addon_taxes[]" tabindex="20" value="<?php echo $add_tax->name; ?>" <?php If (isset($cpt_taxes) && is_array($cpt_taxes)) { If (in_array($add_tax->name, $cpt_taxes)) { echo 'checked="checked"'; } } ?> /> <?php echo $add_tax->label; ?><br /> <?php } } ?> </td> </tr> </table> </div> <p class="submit"> <input type="submit" class="button-primary" tabindex="21" name="cpt_submit" value="<?php _e($cpt_submit_name, 'cpt-plugin') ?>" /> </p> </form> </td> <td width="50%" valign="top"> <?php //debug area $cpt_options = get_option('cpt_custom_tax_types'); ?> <?php If (isset($_GET['edittax'])) { ?> <h2><?php _e('Edit Custom Taxonomy', 'cpt-plugin') ?> · <a href="<?php echo cpt_check_return( 'add' ); ?>"><?php _e('Reset', 'cpt-plugin');?></a></h2> <?php }Else{ ?> <h2><?php _e('Create Custom Taxonomy', 'cpt-plugin') ?> · <a href="<?php echo cpt_check_return( 'add' ); ?>"><?php _e('Reset', 'cpt-plugin');?></a></h2> <?php } ?> <p><?php _e('If you are unfamiliar with the options below only fill out the <strong>Taxonomy Name</strong> and <strong>Post Type Name</strong> fields. The other settings are set to the most common defaults for custom taxonomies.', 'cpt-plugin');?></p> <form method="post" <?php echo $RETURN_URL; ?>> <?php if ( function_exists('wp_nonce_field') ) wp_nonce_field('cpt_add_custom_taxonomy'); ?> <?php If (isset($_GET['edittax'])) { ?> <input type="hidden" name="cpt_edit_tax" value="<?php echo $editTax; ?>" /> <?php } ?> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Taxonomy Name', 'cpt-plugin') ?> <span style="color:red;">*</span></th> <td><input type="text" name="cpt_custom_tax[name]" tabindex="21" value="<?php If (isset($cpt_tax_name)) { echo esc_attr($cpt_tax_name); } ?>" /> <a href="#" title="The taxonomy name. Used to retrieve custom taxonomy content. Should be short and sweet" style="cursor: help;">?</a> (e.g. actors)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Label', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_custom_tax[label]" tabindex="22" value="<?php If (isset($cpt_tax_label)) { echo esc_attr($cpt_tax_label); } ?>" /> <a href="#" title="Taxonomy label. Used in the admin menu for displaying custom taxonomy." style="cursor: help;">?</a> (e.g. Actors)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Singular Label', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_custom_tax[singular_label]" tabindex="23" value="<?php If (isset($cpt_singular_label)) { echo esc_attr($cpt_singular_label); } ?>" /> <a href="#" title="Taxonomy Singular label. Used in WordPress when a singular label is needed." style="cursor: help;">?</a> (e.g. Actor)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Attach to Post Type', 'cpt-plugin') ?> <span style="color:red;">*</span></th> <td> <?php if ( isset( $cpt_tax_object_type ) ) { ?> <strong>This is the old method. Delete the post type from the textbox and check which post type to attach this taxonomy to</strong> <input type="text" name="cpt_custom_tax[cpt_name]" tabindex="24" value="<?php If (isset($cpt_tax_object_type)) { echo esc_attr($cpt_tax_object_type); } ?>" /> <a href="#" title="What object to attach the custom taxonomy to. Can be post, page, or link by default. Can also be any custom post type name." style="cursor: help;">?</a> (e.g. movies) <?php } ?> <?php $args=array( 'public' => true ); $output = 'objects'; // or objects $post_types=get_post_types($args,$output); foreach ($post_types as $post_type ) { if ( $post_type->name != 'attachment' ) { ?> <input type="checkbox" name="cpt_post_types[]" tabindex="20" value="<?php echo $post_type->name; ?>" <?php If (isset($cpt_post_types) && is_array($cpt_post_types)) { If (in_array($post_type->name, $cpt_post_types)) { echo 'checked="checked"'; } } ?> /> <?php echo $post_type->label; ?><br /> <?php } } ?> </td> </tr> <tr valign="top"> <th scope="row"><?php echo '<p><a href="#" class="comment_button" id="3">' . __('View Advanced Label Options', 'cpt-plugin') . '</a>'; ?></th> <td><?php echo '<p><a href="#" class="comment_button" id="4">' . __('View Advanced Options', 'cpt-plugin') . '</a>'; ?></td> </tr> </table> <div style="display:none;" id="slidepanel3"> <p><?php _e('Below are the advanced label options for custom taxonomies. If you are unfamiliar with these labels the plugin will automatically create labels based off of your custom taxonomy name', 'cpt-plugin'); ?></p> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Search Items', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[search_items]" tabindex="2" value="<?php If (isset($cpt_tax_labels["search_items"])) { echo esc_attr($cpt_tax_labels["search_items"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. Search Actors)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Popular Items', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[popular_items]" tabindex="2" value="<?php If (isset($cpt_tax_labels["popular_items"])) { echo esc_attr($cpt_tax_labels["popular_items"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. Popular Actors)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('All Items', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[all_items]" tabindex="2" value="<?php If (isset($cpt_tax_labels["all_items"])) { echo esc_attr($cpt_tax_labels["all_items"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. All Actors)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Parent Item', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[parent_item]" tabindex="2" value="<?php If (isset($cpt_tax_labels["parent_item"])) { echo esc_attr($cpt_tax_labels["parent_item"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. Parent Actor)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Parent Item Colon', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[parent_item_colon]" tabindex="2" value="<?php If (isset($cpt_tax_labels["parent_item_colon"])) { echo esc_attr($cpt_tax_labels["parent_item_colon"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. Parent Actor:)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Edit Item', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[edit_item]" tabindex="2" value="<?php If (isset($cpt_tax_labels["edit_item"])) { echo esc_attr($cpt_tax_labels["edit_item"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. Edit Actor)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Update Item', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[update_item]" tabindex="2" value="<?php If (isset($cpt_tax_labels["update_item"])) { echo esc_attr($cpt_tax_labels["update_item"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. Update Actor)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Add New Item', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[add_new_item]" tabindex="2" value="<?php If (isset($cpt_tax_labels["add_new_item"])) { echo esc_attr($cpt_tax_labels["add_new_item"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. Add New Actor)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('New Item Name', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[new_item_name]" tabindex="2" value="<?php If (isset($cpt_tax_labels["new_item_name"])) { echo esc_attr($cpt_tax_labels["new_item_name"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. New Actor Name)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Separate Items with Commas', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[separate_items_with_commas]" tabindex="2" value="<?php If (isset($cpt_tax_labels["separate_items_with_commas"])) { echo esc_attr($cpt_tax_labels["separate_items_with_commas"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. Separate actors with commas)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Add or Remove Items', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[add_or_remove_items]" tabindex="2" value="<?php If (isset($cpt_tax_labels["add_or_remove_items"])) { echo esc_attr($cpt_tax_labels["add_or_remove_items"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. Add or remove actors)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Choose From Most Used', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_tax_labels[choose_from_most_used]" tabindex="2" value="<?php If (isset($cpt_tax_labels["choose_from_most_used"])) { echo esc_attr($cpt_tax_labels["choose_from_most_used"]); } ?>" /> <a href="#" title="Custom taxonomy label. Used in the admin menu for displaying taxonomies." style="cursor: help;">?</a> (e.g. Choose from the most used actors)</td> </tr> </table> </div> <div style="display:none;" id="slidepanel4"> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Hierarchical', 'cpt-plugin') ?></th> <td> <SELECT name="cpt_custom_tax[hierarchical]" tabindex="25"> <OPTION value="0" <?php If (isset($cpt_tax_hierarchical)) { If ($cpt_tax_hierarchical == 0) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>False</OPTION> <OPTION value="1" <?php If (isset($cpt_tax_hierarchical)) { If ($cpt_tax_hierarchical == 1) { echo 'selected="selected"'; } } ?>>True</OPTION> </SELECT> <a href="#" title="Whether the taxonomy is hierarchical" style="cursor: help;">?</a> (default: False) </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Show UI', 'cpt-plugin') ?></th> <td> <SELECT name="cpt_custom_tax[show_ui]" tabindex="26"> <OPTION value="0" <?php If (isset($cpt_tax_showui)) { If ($cpt_tax_showui == 0 && $cpt_tax_showui != '') { echo 'selected="selected"'; } } ?>>False</OPTION> <OPTION value="1" <?php If (isset($cpt_tax_showui)) { If ($cpt_tax_showui == 1 || is_null($cpt_tax_showui)) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>True</OPTION> </SELECT> <a href="#" title="Whether to generate a default UI for managing this custom taxonomy" style="cursor: help;">?</a> (default: True) </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Query Var', 'cpt-plugin') ?></th> <td> <SELECT name="cpt_custom_tax[query_var]" tabindex="27"> <OPTION value="0" <?php If (isset($cpt_tax_query_var)) { If ($cpt_tax_query_var == 0 && $cpt_tax_query_var != '') { echo 'selected="selected"'; } } ?>>False</OPTION> <OPTION value="1" <?php If (isset($cpt_tax_query_var)) { If ($cpt_tax_query_var == 1 || is_null($cpt_tax_query_var)) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>True</OPTION> </SELECT> <a href="#" title="" style="cursor: help;">?</a> (default: True) </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Rewrite', 'cpt-plugin') ?></th> <td> <SELECT name="cpt_custom_tax[rewrite]" tabindex="28"> <OPTION value="0" <?php If (isset($cpt_tax_rewrite)) { If ($cpt_tax_rewrite == 0 && $cpt_tax_rewrite != '') { echo 'selected="selected"'; } } ?>>False</OPTION> <OPTION value="1" <?php If (isset($cpt_tax_rewrite)) { If ($cpt_tax_rewrite == 1 || is_null($cpt_tax_rewrite)) { echo 'selected="selected"'; } }Else{ echo 'selected="selected"'; } ?>>True</OPTION> </SELECT> <a href="#" title="" style="cursor: help;">?</a> (default: True) </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Custom Rewrite Slug', 'cpt-plugin') ?></th> <td><input type="text" name="cpt_custom_tax[rewrite_slug]" tabindex="9" value="<?php If (isset($cpt_tax_rewrite_slug)) { echo esc_attr($cpt_tax_rewrite_slug); } ?>" /> <a href="#" title="Custom Taxonomy Rewrite Slug" style="cursor: help;">?</a> (default: taxonomy name)</td> </tr> </table> </div> <p class="submit"> <input type="submit" class="button-primary" tabindex="29" name="cpt_add_tax" value="<?php _e($cpt_tax_submit_name, 'cpt-plugin') ?>" /> </p> </form> </td> </tr> </table> </div> <?php //load footer cpt_footer(); }