not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

talhyperlocal.php 3.1 KiB

9 vuotta sitten
9 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /*
  3. Plugin Name: Talk About Local Hyperlocal Sites Directory
  4. Plugin URI:
  5. Description:
  6. Version: 0.1.2.1
  7. Author: Adrian Short
  8. Author URI: https://adrianshort.org/
  9. License: GPL v3
  10. */
  11. require_once ( dirname( __FILE__ ) . '/includes/map.php' );
  12. /**
  13. * Create custom post types and taxonomies
  14. * @return void
  15. */
  16. function talhyperlocal_init() {
  17. // Create 'site' custom post type
  18. $args = array(
  19. 'labels' => array(
  20. 'name' => 'Sites',
  21. 'singular_name' => 'Site',
  22. 'add_new_item' => 'Add a New Site',
  23. ),
  24. 'description' => 'Hyperlocal website',
  25. 'public' => true,
  26. 'show_ui' => true,
  27. 'has_archive' => true,
  28. 'show_in_menu' => true,
  29. 'exclude_from_search' => false,
  30. 'capability_type' => 'post',
  31. 'map_meta_cap' => true,
  32. 'hierarchical' => false,
  33. 'rewrite' => array(
  34. 'slug' => 'site',
  35. 'with_front' => true,
  36. ),
  37. 'query_var' => true,
  38. 'supports' => array(
  39. 'title',
  40. 'editor',
  41. 'custom-fields',
  42. ),
  43. );
  44. register_post_type( 'site', $args );
  45. // Create taxonomy: Councils
  46. $args = array(
  47. 'labels' => array(
  48. 'name' => 'Councils',
  49. ),
  50. 'hierarchical' => false,
  51. 'show_ui' => true,
  52. 'query_var' => true,
  53. 'rewrite' => array(
  54. 'slug' => 'councils',
  55. 'with_front' => true,
  56. ),
  57. 'show_admin_column' => true,
  58. );
  59. register_taxonomy( 'councils', array( 'site' ), $args );
  60. // Create taxonomy: Countries
  61. $args = array(
  62. 'labels' => array(
  63. 'name' => 'Countries',
  64. ),
  65. 'hierarchical' => false,
  66. 'show_ui' => true,
  67. 'query_var' => true,
  68. 'rewrite' => array(
  69. 'slug' => 'countries',
  70. 'with_front' => true,
  71. ),
  72. 'show_admin_column' => true,
  73. );
  74. register_taxonomy( 'countries', array( 'site' ), $args );
  75. // Create taxonomy: Hyperlocal Groups
  76. $args = array(
  77. 'labels' => array(
  78. 'name' => 'Groups',
  79. ),
  80. 'hierarchical' => false,
  81. 'show_ui' => true,
  82. 'query_var' => true,
  83. 'rewrite' => array(
  84. 'slug' => 'groups',
  85. 'with_front' => true,
  86. ),
  87. 'show_admin_column' => true,
  88. );
  89. register_taxonomy( 'groups', array( 'site' ), $args );
  90. // Create taxonomy: Platforms
  91. $args = array(
  92. 'labels' => array(
  93. 'name' => 'Platforms',
  94. ),
  95. 'hierarchical' => false,
  96. 'show_ui' => true,
  97. 'query_var' => true,
  98. 'rewrite' => array(
  99. 'slug' => 'platforms',
  100. 'with_front' => true,
  101. ),
  102. 'show_admin_column' => true,
  103. );
  104. register_taxonomy( 'platforms', array( 'site' ), $args );
  105. }
  106. add_action( 'init', 'talhyperlocal_init' );