cptui_render_posttypes_taxonomies_section

Content for the Post Types/Taxonomies Tools tab.

Description

cptui_render_posttypes_taxonomies_section(); 

Usage

  1. if ( !function_exists( 'cptui_render_posttypes_taxonomies_section' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/inc/tools.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = cptui_render_posttypes_taxonomies_section(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/tools.php  
  1. function cptui_render_posttypes_taxonomies_section() { 
  2. ?> 
  3.  
  4. <p><?php _e( 'If you are wanting to migrate registered post types or taxonomies from this site to another, that will also use Custom Post Type UI, use the import and export functionality. If you are moving away from Custom Post Type UI, use the information in the "Get Code" tab.', 'custom-post-type-ui' ); ?></p> 
  5.  
  6. <p> 
  7. <?php 
  8. printf( 
  9. '<strong>%s</strong>: %s',  
  10. __( 'NOTE', 'custom-post-type-ui' ),  
  11. __( 'This will not export the associated posts or taxonomy terms, just the settings.', 'custom-post-type-ui' ) 
  12. ); 
  13. ?> 
  14. </p> 
  15. <table class="form-table cptui-table"> 
  16. <?php if ( ! empty( $_GET ) && empty( $_GET['action'] ) ) { ?> 
  17. <tr> 
  18. <td class="outter"> 
  19. <h2><label for="cptui_post_import"><?php _e( 'Import Post Types', 'custom-post-type-ui' ); ?></label></h2> 
  20.  
  21. <form method="post"> 
  22. <textarea class="cptui_post_import" placeholder="<?php esc_attr_e( 'Paste content here.', 'custom-post-type-ui' ); ?>" id="cptui_post_import" name="cptui_post_import"></textarea> 
  23.  
  24. <p class="wp-ui-highlight"> 
  25. <strong><?php _e( 'Note:', 'custom-post-type-ui' ); ?></strong> <?php _e( 'Importing will overwrite previous registered settings.', 'custom-post-type-ui' ); ?> 
  26. </p> 
  27.  
  28. <p> 
  29. <strong><?php _e( 'To import post types from a different WordPress site, paste the exported content from that site and click the "Import" button.', 'custom-post-type-ui' ); ?></strong> 
  30. </p> 
  31.  
  32. <p> 
  33. <input class="button button-primary" type="submit" value="<?php esc_attr_e( 'Import', 'custom-post-type-ui' ); ?>" /> 
  34. </p> 
  35. </form> 
  36. </td> 
  37. <td class="outter"> 
  38. <h2><label for="cptui_post_export"><?php _e( 'Export Post Types', 'custom-post-type-ui' ); ?></label></h2> 
  39. <?php 
  40. $cptui_post_types = cptui_get_post_type_data(); 
  41. if ( ! empty( $cptui_post_types ) ) { 
  42. $content = esc_html( json_encode( $cptui_post_types ) ); 
  43. } else { 
  44. $content = __( 'No post types registered yet.', 'custom-post-type-ui' ); 
  45. ?> 
  46. <textarea title="<?php esc_attr_e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'custom-post-type-ui' ); ?>" onclick="this.focus();this.select();" onfocus="this.focus();this.select();" readonly="readonly" aria-readonly="true" class="cptui_post_import" id="cptui_post_export" name="cptui_post_export"><?php echo $content; ?></textarea> 
  47.  
  48. <p> 
  49. <strong><?php _e( 'Use the content above to import current post types into a different WordPress site. You can also use this to simply back up your post type settings.', 'custom-post-type-ui' ); ?></strong> 
  50. </p> 
  51. </td> 
  52. </tr> 
  53. <?php } elseif ( ! empty( $_GET ) && 'taxonomies' == $_GET['action'] ) { ?> 
  54. <tr> 
  55. <td class="outter"> 
  56. <h2><label for="cptui_tax_import"><?php _e( 'Import Taxonomies', 'custom-post-type-ui' ); ?></label></h2> 
  57.  
  58. <form method="post"> 
  59. <textarea class="cptui_tax_import" placeholder="<?php esc_attr_e( 'Paste content here.', 'custom-post-type-ui' ); ?>" id="cptui_tax_import" name="cptui_tax_import"></textarea> 
  60.  
  61. <p class="wp-ui-highlight"> 
  62. <strong><?php _e( 'Note:', 'custom-post-type-ui' ); ?></strong> <?php _e( 'Importing will overwrite previous registered settings.', 'custom-post-type-ui' ); ?> 
  63. </p> 
  64.  
  65. <p> 
  66. <strong><?php _e( 'To import taxonomies from a different WordPress site, paste the exported content from that site and click the "Import" button.', 'custom-post-type-ui' ); ?></strong> 
  67. </p> 
  68.  
  69. <p> 
  70. <input class="button button-primary" type="submit" value="<?php esc_attr_e( 'Import', 'custom-post-type-ui' ); ?>" /> 
  71. </p> 
  72. </form> 
  73. </td> 
  74. <td class="outter"> 
  75. <h2><label for="cptui_tax_export"><?php _e( 'Export Taxonomies', 'custom-post-type-ui' ); ?></label></h2> 
  76. <?php 
  77. $cptui_taxonomies = cptui_get_taxonomy_data(); 
  78. if ( ! empty( $cptui_taxonomies ) ) { 
  79. $content = esc_html( json_encode( $cptui_taxonomies ) ); 
  80. } else { 
  81. $content = __( 'No taxonomies registered yet.', 'custom-post-type-ui' ); 
  82. ?> 
  83. <textarea title="<?php esc_attr_e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'custom-post-type-ui' ); ?>" onclick="this.focus();this.select()" onfocus="this.focus();this.select();" readonly="readonly" aria-readonly="true" class="cptui_tax_import" id="cptui_tax_export" name="cptui_tax_export"><?php echo $content; ?></textarea> 
  84.  
  85. <p> 
  86. <strong><?php _e( 'Use the content above to import current taxonomies into a different WordPress site. You can also use this to simply back up your taxonomy settings.', 'custom-post-type-ui' ); ?></strong> 
  87. </p> 
  88. </td> 
  89. </tr> 
  90. <?php } ?> 
  91. </table> 
  92. <?php