/wp-content/plugins/custompress/ui-admin/add-taxonomy.php

https://github.com/sharpmachine/wakeupmedia.com · PHP · 379 lines · 374 code · 5 blank · 0 comment · 74 complexity · fa3fc9fea3c4efd159005cedf937d50d MD5 · raw file

  1. <?php if (!defined('ABSPATH')) die('No direct access allowed!'); ?>
  2. <?php $post_types = get_post_types('','names'); ?>
  3. <h3><?php _e('Add Taxonomy', $this->text_domain); ?></h3>
  4. <form action="" method="post" class="ct-taxonomy">
  5. <div class="ct-wrap-left">
  6. <div class="ct-table-wrap">
  7. <div class="ct-arrow"><br></div>
  8. <h3 class="ct-toggle"><?php _e('Taxonomy', $this->text_domain) ?></h3>
  9. <table class="form-table <?php do_action('ct_invalid_field_taxonomy'); ?>">
  10. <tr>
  11. <th>
  12. <label for="post_type"><?php _e('Taxonomy', $this->text_domain) ?> <span class="ct-required">( <?php _e('required', $this->text_domain); ?> )</span></label>
  13. </th>
  14. <td>
  15. <input type="text" name="taxonomy" value="<?php if ( isset( $_POST['taxonomy'] ) ) echo $_POST['taxonomy']; ?>">
  16. <span class="description"><?php _e('The system name of the taxonomy. Alphanumeric characters and underscores only. Min 2 letters. Once added the taxonomy system name cannot be changed.', $this->text_domain); ?></span>
  17. </td>
  18. </tr>
  19. </table>
  20. </div>
  21. <div class="ct-table-wrap">
  22. <div class="ct-arrow"><br></div>
  23. <h3 class="ct-toggle"><?php _e('Post Type', $this->text_domain) ?></h3>
  24. <table class="form-table <?php do_action('ct_invalid_field_object_type'); ?>">
  25. <tr>
  26. <th>
  27. <label for="object_type"><?php _e('Post Type', $this->text_domain) ?> (<span class="ct-required"> <?php _e('required', $this->text_domain); ?> </span>)</label>
  28. </th>
  29. <td>
  30. <select name="object_type[]" multiple="multiple" class="ct-object-type">
  31. <?php if ( is_array( $post_types )): ?>
  32. <?php foreach( $post_types as $post_type ): ?>
  33. <option value="<?php echo ( $post_type ); ?>" <?php if ( isset( $_POST['object_type'] ) && is_array( $_POST['object_type'] )) { foreach ( $_POST['object_type'] as $post_value ) { if ( $post_value == $post_type ) echo( 'selected="selected"' ); }} ?>><?php echo( $post_type ); ?></option>
  34. <?php endforeach; ?>
  35. <?php endif; ?>
  36. </select>
  37. <span class="description"><?php _e('Select one or more post types to add this taxonomy to.', $this->text_domain); ?></span>
  38. </td>
  39. </tr>
  40. </table>
  41. </div>
  42. <div class="ct-table-wrap">
  43. <div class="ct-arrow"><br></div>
  44. <h3 class="ct-toggle"><?php _e('Labels', $this->text_domain) ?></h3>
  45. <table class="form-table">
  46. <tr>
  47. <th>
  48. <label for="name"><?php _e('Name', $this->text_domain) ?></label>
  49. </th>
  50. <td>
  51. <input type="text" name="labels[name]" value="<?php if ( isset( $_POST['labels']['name'] ) ) echo $_POST['labels']['name']; ?>">
  52. <span class="description"><?php _e('General name for the taxonomy, usually plural.', $this->text_domain); ?></span>
  53. </td>
  54. </tr>
  55. <tr>
  56. <th>
  57. <label for="singular_name"><?php _e('Singular Name', $this->text_domain) ?></label>
  58. </th>
  59. <td>
  60. <input type="text" name="labels[singular_name]" value="<?php if ( isset( $_POST['labels']['singular_name'] ) ) echo $_POST['labels']['singular_name']; ?>">
  61. <span class="description"><?php _e('Name for one object of this taxonomy. Defaults to value of name.', $this->text_domain); ?></span>
  62. </td>
  63. </tr>
  64. <tr>
  65. <th>
  66. <label for="add_new_item"><?php _e('Add New Item', $this->text_domain) ?></label>
  67. </th>
  68. <td>
  69. <input type="text" name="labels[add_new_item]" value="<?php if ( isset( $_POST['labels']['add_new_item'] ) ) echo $_POST['labels']['add_new_item']; ?>">
  70. <span class="description"><?php _e('The add new item text. Default is "Add New Tag" or "Add New Category".', $this->text_domain); ?></span>
  71. </td>
  72. </tr>
  73. <tr>
  74. <th>
  75. <label for="new_item_name"><?php _e('New Item Name', $this->text_domain) ?></label>
  76. </th>
  77. <td>
  78. <input type="text" name="labels[new_item_name]" value="<?php if ( isset( $_POST['labels']['new_item_name'] ) ) echo $_POST['labels']['new_item_name']; ?>">
  79. <span class="description"><?php _e('The new item name text. Default is "New Tag Name" or "New Category Name".', $this->text_domain); ?></span>
  80. </td>
  81. </tr>
  82. <tr>
  83. <th>
  84. <label for="edit_item"><?php _e('Edit Item', $this->text_domain) ?></label>
  85. </th>
  86. <td>
  87. <input type="text" name="labels[edit_item]" value="<?php if ( isset( $_POST['labels']['edit_item'] ) ) echo $_POST['labels']['edit_item']; ?>">
  88. <span class="description"><?php _e('The edit item text. Default is "Edit Tag" or "Edit Category".', $this->text_domain); ?></span>
  89. </td>
  90. </tr>
  91. <tr>
  92. <th>
  93. <label for="update_item"><?php _e('Update Item', $this->text_domain) ?></label>
  94. </th>
  95. <td>
  96. <input type="text" name="labels[update_item]" value="<?php if ( isset( $_POST['labels']['update_item'] ) ) echo $_POST['labels']['update_item']; ?>">
  97. <span class="description"><?php _e('The update item text. Default is "Update Tag" or "Update Category".', $this->text_domain); ?></span>
  98. </td>
  99. </tr>
  100. <tr>
  101. <th>
  102. <label for="search_items"><?php _e('Search Items', $this->text_domain) ?></label>
  103. </th>
  104. <td>
  105. <input type="text" name="labels[search_items]" value="<?php if ( isset( $_POST['labels']['search_items'] ) ) echo $_POST['labels']['search_items']; ?>">
  106. <span class="description"><?php _e('The search items text. Default is "Search Tags" or "Search Categories".', $this->text_domain); ?></span>
  107. </td>
  108. </tr>
  109. <tr>
  110. <th>
  111. <label for="popular_items"><?php _e('Popular Items', $this->text_domain) ?></label>
  112. </th>
  113. <td>
  114. <input type="text" name="labels[popular_items]" value="<?php if ( isset( $_POST['labels']['popular_items'] ) ) echo $_POST['labels']['popular_items']; ?>">
  115. <span class="description"><?php _e('The popular items text. Default is "Popular Tags" or null.', $this->text_domain); ?></span>
  116. </td>
  117. </tr>
  118. <tr>
  119. <th>
  120. <label for="all_items"><?php _e('All Items', $this->text_domain) ?></label>
  121. </th>
  122. <td>
  123. <input type="text" name="labels[all_items]" value="<?php if ( isset( $_POST['labels']['all_items'] ) ) echo $_POST['labels']['all_items']; ?>">
  124. <span class="description"><?php _e('The all items text. Default is "All Tags" or "All Categories".', $this->text_domain); ?></span>
  125. </td>
  126. </tr>
  127. <tr>
  128. <th>
  129. <label for="parent_item"><?php _e('Parent Item', $this->text_domain) ?></label>
  130. </th>
  131. <td>
  132. <input type="text" name="labels[parent_item]" value="<?php if ( isset( $_POST['labels']['parent_item'] ) ) echo $_POST['labels']['parent_item']; ?>">
  133. <span class="description"><?php _e('The parent item text. This string is not used on non-hierarchical taxonomies such as post tags. Default is null or "Parent Category".', $this->text_domain); ?></span>
  134. </td>
  135. </tr>
  136. <tr>
  137. <th>
  138. <label for="parent_item_colon"><?php _e('Parent Item Colon', $this->text_domain) ?></label>
  139. </th>
  140. <td>
  141. <input type="text" name="labels[parent_item_colon]" value="<?php if ( isset( $_POST['labels']['parent_item_colon'] ) ) echo $_POST['labels']['parent_item_colon']; ?>">
  142. <span class="description"><?php _e('The same as parent_item, but with colon : in the end null, "Parent Category:".', $this->text_domain); ?></span>
  143. </td>
  144. </tr>
  145. <tr>
  146. <th>
  147. <label for="add_or_remove_items"><?php _e('Add Or Remove Items', $this->text_domain) ?></label>
  148. </th>
  149. <td>
  150. <input type="text" name="labels[add_or_remove_items]" value="<?php if ( isset( $_POST['labels']['add_or_remove_items'] ) ) echo $_POST['labels']['add_or_remove_items']; ?>">
  151. <span class="description"><?php _e('The add or remove items text is used in the meta box when JavaScript is disabled. This string isn\'t used on hierarchical taxonomies. Default is "Add or remove tags" or null.', $this->text_domain); ?></span>
  152. </td>
  153. </tr>
  154. <tr>
  155. <th>
  156. <label for="separate_items_with_commas"><?php _e('Separate Items With Commas', $this->text_domain) ?></label>
  157. </th>
  158. <td>
  159. <input type="text" name="labels[separate_items_with_commas]" value="<?php if ( isset( $_POST['labels']['separate_items_with_commas'] ) ) echo $_POST['labels']['separate_items_with_commas']; ?>">
  160. <span class="description"><?php _e('The separate item with commas text used in the taxonomy meta box. This string isn\'t used on hierarchical taxonomies. Default is "Separate tags with commas", or null.', $this->text_domain); ?></span>
  161. </td>
  162. </tr>
  163. <tr>
  164. <th>
  165. <label for="choose_from_most_used"><?php _e('Choose From Most Used', $this->text_domain) ?></label>
  166. </th>
  167. <td>
  168. <input type="text" name="labels[choose_from_most_used]" value="<?php if ( isset( $_POST['labels']['choose_from_most_used'] ) ) echo $_POST['labels']['choose_from_most_used']; ?>">
  169. <span class="description"><?php _e('The choose from most used text used in the taxonomy meta box. This string isn\'t used on hierarchical taxonomies. Default is "Choose from the most used tags" or null.', $this->text_domain); ?></span>
  170. </td>
  171. </tr>
  172. </table>
  173. </div>
  174. </div>
  175. <div class="ct-wrap-right">
  176. <div class="ct-table-wrap">
  177. <div class="ct-arrow"><br></div>
  178. <h3 class="ct-toggle"><?php _e('Public', $this->text_domain) ?></h3>
  179. <table class="form-table publica">
  180. <tr>
  181. <th>
  182. <label for="public"><?php _e('Public', $this->text_domain) ?></label>
  183. </th>
  184. <td>
  185. <span class="description"><?php _e('Should this taxonomy be exposed in the admin UI.', $this->text_domain); ?></span>
  186. </td>
  187. </tr>
  188. <tr>
  189. <th></th>
  190. <td>
  191. <input type="radio" name="public" value="1" <?php if ( isset( $_POST['public'] ) && $_POST['public'] === '1' ) echo( 'checked="checked"' ); elseif ( !isset( $_POST['public'] ) ) echo( 'checked="checked"' ); ?>>
  192. <span class="description"><strong><?php _e('TRUE', $this->text_domain); ?></strong></span>
  193. <br />
  194. <input type="radio" name="public" value="0" <?php if ( isset( $_POST['public'] ) && $_POST['public'] === '0' ) echo( 'checked="checked"' ); ?>>
  195. <span class="description"><strong><?php _e('FALSE', $this->text_domain); ?></strong></span>
  196. <br />
  197. <input type="radio" name="public" value="advanced" <?php if ( isset( $_POST['public'] ) && $_POST['public'] == 'advanced' ) echo( 'checked="checked"' ); ?>>
  198. <span class="description"><strong><?php _e('ADVANCED', $this->text_domain); ?></strong></span>
  199. </td>
  200. </tr>
  201. </table>
  202. </div>
  203. <div class="ct-table-wrap">
  204. <div class="ct-arrow"><br></div>
  205. <h3 class="ct-toggle"><?php _e('Show UI', $this->text_domain) ?></h3>
  206. <table class="form-table show-ui">
  207. <tr>
  208. <th>
  209. <label for="show_ui"><?php _e('Show UI', $this->text_domain) ?></label>
  210. </th>
  211. <td>
  212. <span class="description"><?php _e('Whether to generate a default UI for managing this taxonomy.', $this->text_domain); ?></span>
  213. </td>
  214. </tr>
  215. <tr>
  216. <th></th>
  217. <td>
  218. <input type="radio" name="show_ui" value="1" <?php if ( isset( $_POST['public'] ) && $_POST['public'] == 'advanced' && isset( $_POST['show_ui'] ) && $_POST['show_ui'] === '1' ) echo( 'checked="checked"' ); ?>>
  219. <span class="description"><strong><?php _e('TRUE', $this->text_domain); ?></strong></span>
  220. <br />
  221. <input type="radio" name="show_ui" value="0" <?php if ( isset( $_POST['public'] ) && $_POST['public'] == 'advanced' && isset( $_POST['show_ui'] ) && $_POST['show_ui'] === '0' ) echo( 'checked="checked"' ); ?>>
  222. <span class="description"><strong><?php _e('FALSE', $this->text_domain); ?></strong></span>
  223. </td>
  224. </tr>
  225. </table>
  226. </div>
  227. <div class="ct-table-wrap">
  228. <div class="ct-arrow"><br></div>
  229. <h3 class="ct-toggle"><?php _e('Show Tagcloud', $this->text_domain) ?></h3>
  230. <table class="form-table show_tagcloud">
  231. <tr>
  232. <th>
  233. <label for="show_tagcloud"><?php _e('Show Tagcloud', $this->text_domain) ?></label>
  234. </th>
  235. <td>
  236. <span class="description"><?php _e('Whether to show a tag cloud in the admin UI for this taxonomy.', $this->text_domain); ?></span>
  237. </td>
  238. </tr>
  239. <tr>
  240. <th></th>
  241. <td>
  242. <input type="radio" name="show_tagcloud" value="1" <?php if ( isset( $_POST['public'] ) && $_POST['public'] == 'advanced' && isset( $_POST['show_tagcloud'] ) && $_POST['show_tagcloud'] === '1' ) echo( 'checked="checked"' ); ?>>
  243. <span class="description"><strong><?php _e('TRUE', $this->text_domain); ?></strong></span>
  244. <br />
  245. <input type="radio" name="show_tagcloud" value="0" <?php if ( isset( $_POST['public'] ) && $_POST['public'] == 'advanced' && isset( $_POST['show_tagcloud'] ) && $_POST['show_tagcloud'] === '0' ) echo( 'checked="checked"' ); ?>>
  246. <span class="description"><strong><?php _e('FALSE', $this->text_domain); ?></strong></span>
  247. </td>
  248. </tr>
  249. </table>
  250. </div>
  251. <div class="ct-table-wrap">
  252. <div class="ct-arrow"><br></div>
  253. <h3 class="ct-toggle"><?php _e('Show In Nav Menus ', $this->text_domain) ?></h3>
  254. <table class="form-table show-in-nav-menus">
  255. <tr>
  256. <th>
  257. <label for="show_in_nav_menus"><?php _e('Show In Nav Menus', $this->text_domain) ?></label>
  258. </th>
  259. <td>
  260. <span class="description"><?php _e('Whether to make this taxonomy available for selection in navigation menus.', $this->text_domain); ?></span>
  261. </td>
  262. </tr>
  263. <tr>
  264. <th></th>
  265. <td>
  266. <input type="radio" name="show_in_nav_menus" value="1" <?php if ( isset( $_POST['public'] ) && $_POST['public'] == 'advanced' && isset( $_POST['show_in_nav_menus'] ) && $_POST['show_in_nav_menus'] === '1' ) echo( 'checked="checked"' ); ?>>
  267. <span class="description"><strong><?php _e('TRUE', $this->text_domain); ?></strong></span>
  268. <br />
  269. <input type="radio" name="show_in_nav_menus" value="0" <?php if ( isset( $_POST['public'] ) && $_POST['public'] == 'advanced' && isset( $_POST['show_in_nav_menus'] ) && $_POST['show_in_nav_menus'] === '0' ) echo( 'checked="checked"' ); ?>>
  270. <span class="description"><strong><?php _e('FALSE', $this->text_domain); ?></strong></span>
  271. </td>
  272. </tr>
  273. </table>
  274. </div>
  275. <div class="ct-table-wrap">
  276. <div class="ct-arrow"><br></div>
  277. <h3 class="ct-toggle"><?php _e('Hierarchical', $this->text_domain) ?></h3>
  278. <table class="form-table">
  279. <tr>
  280. <th>
  281. <label for="hierarchical"><?php _e('Hierarchical', $this->text_domain) ?></label>
  282. </th>
  283. <td>
  284. <span class="description"><?php _e('Is this taxonomy hierarchical (have descendants) like categories or not hierarchical like tags.', $this->text_domain); ?></span>
  285. </td>
  286. </tr>
  287. <tr>
  288. <th></th>
  289. <td>
  290. <input type="radio" name="hierarchical" value="1" <?php if ( isset( $_POST['hierarchical'] ) && $_POST['hierarchical'] === '1' ) echo( 'checked="checked"' ); ?>>
  291. <span class="description"><strong><?php _e('TRUE', $this->text_domain); ?></strong></span>
  292. <br />
  293. <input type="radio" name="hierarchical" value="0" <?php if ( isset( $_POST['hierarchical'] ) && $_POST['hierarchical'] === '0' ) echo( 'checked="checked"' ); elseif ( !isset( $_POST['hierarchical'] ) ) echo( 'checked="checked"' ); ?>>
  294. <span class="description"><strong><?php _e('FALSE', $this->text_domain); ?></strong></span>
  295. </td>
  296. </tr>
  297. </table>
  298. </div>
  299. <div class="ct-table-wrap">
  300. <div class="ct-arrow"><br></div>
  301. <h3 class="ct-toggle"><?php _e('Rewrite', $this->text_domain) ?></h3>
  302. <table class="form-table">
  303. <tr>
  304. <th>
  305. <label for="rewrite"><?php _e('Rewrite', $this->text_domain) ?></label>
  306. </th>
  307. <td>
  308. <span class="description"><?php _e('Set to false to prevent rewrite, or true to customize.', $this->text_domain); ?></span>
  309. </td>
  310. </tr>
  311. <tr>
  312. <th></th>
  313. <td>
  314. <input type="radio" name="rewrite" value="1" <?php if ( isset( $_POST['rewrite'] ) && $_POST['rewrite'] === '1' ) echo( 'checked="checked"' ); elseif ( !isset( $_POST['rewrite'] ) ) echo( 'checked="checked"' ); ?>>
  315. <span class="description"><strong><?php _e('TRUE', $this->text_domain); ?></strong></span>
  316. <br />
  317. <span class="description"><?php _e('Default will use query var.', $this->text_domain); ?></span>
  318. <br />
  319. <input type="radio" name="rewrite" value="0" <?php if ( isset( $_POST['rewrite'] ) && $_POST['rewrite'] === '0' ) echo( 'checked="checked"' ); ?>>
  320. <span class="description"><strong><?php _e('FALSE', $this->text_domain); ?></strong></span>
  321. <br />
  322. <span class="description"><?php _e('Prevent rewrite.', $this->text_domain); ?></span>
  323. <br /><br />
  324. <span class="description"><strong><?php _e('Custom Slug', $this->text_domain); ?></strong></span>
  325. <br />
  326. <input type="text" name="rewrite_slug" value="<?php if ( !empty( $_POST['rewrite_slug'] ) ) echo $_POST['rewrite_slug']; ?>" />
  327. <br />
  328. <span class="description"><?php _e('Prepend posts with this slug. If empty default will be used.', $this->text_domain); ?></span>
  329. <br /><br />
  330. <input type="checkbox" name="rewrite_with_front" value="1" <?php if ( !isset( $_POST['rewrite_with_front'] ) || !empty( $_POST['rewrite_with_front'] ) ) echo 'checked="checked"'; ?>>
  331. <span class="description"><strong><?php _e('Allow Front Base', $this->text_domain); ?></strong></span>
  332. <br />
  333. <span class="description"><?php _e('Allowing permalinks to be prepended with front base.', $this->text_domain); ?></span>
  334. <br /><br />
  335. <input type="checkbox" name="rewrite_hierarchical" value="1" <?php if ( !empty( $_POST['rewrite_hierarchical'] ) ) echo 'checked="checked"'; ?>>
  336. <span class="description"><strong><?php _e('Hierarchical URLs', $this->text_domain); ?></strong></span>
  337. <br />
  338. <span class="description"><?php _e('Allow hierarchical urls. Applicable for hierarchical taxonomies.', $this->text_domain); ?></span>
  339. </td>
  340. </tr>
  341. </table>
  342. </div>
  343. <div class="ct-table-wrap">
  344. <div class="ct-arrow"><br></div>
  345. <h3 class="ct-toggle"><?php _e('Query var', $this->text_domain) ?></h3>
  346. <table class="form-table">
  347. <tr>
  348. <th>
  349. <label for="query_var"><?php _e('Query var', $this->text_domain) ?></label>
  350. </th>
  351. <td>
  352. <span class="description"><?php _e('False to prevent queries. Default will use the taxonomy system name as query var.', $this->text_domain); ?></span>
  353. </td>
  354. </tr>
  355. <tr>
  356. <th></th>
  357. <td>
  358. <input type="radio" name="query_var" value="1" <?php if ( isset( $_POST['query_var'] ) && $_POST['query_var'] === '1' ) { echo( 'checked="checked"' ); } elseif ( !isset( $_POST['query_var'] ) ) { echo( 'checked="checked"' ); } ?>>
  359. <span class="description"><strong><?php _e('TRUE', $this->text_domain); ?></strong></span>
  360. <br />
  361. <input type="radio" name="query_var" value="0" <?php if ( isset( $_POST['query_var'] ) && $_POST['query_var'] === '0' ) echo( 'checked="checked"' ); ?>>
  362. <span class="description"><strong><?php _e('FALSE', $this->text_domain); ?></strong></span>
  363. </td>
  364. </tr>
  365. </table>
  366. </div>
  367. </div>
  368. <div class="clear"></div>
  369. <p class="submit">
  370. <?php wp_nonce_field('submit_taxonomy'); ?>
  371. <input type="submit" class="button-primary" name="submit" value="Add Taxonomy">
  372. </p>
  373. <br /><br /><br /><br />
  374. </form>