WordPress plugin to import taxonomy terms (tags)
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.

32 lines
806 B

  1. <?php
  2. /*
  3. Plugin Name: Tag Importer
  4. Plugin URI:
  5. Description: Import terms (tags) into a non-hierarchical taxonomy
  6. Version: 0.2
  7. Author: Adrian Short
  8. Author URI: https://adrianshort.org/
  9. License: CC0/public domain
  10. */
  11. add_action( 'admin_menu', 'as_tagimporter_menu' );
  12. // Add submenu to Tools menu
  13. function as_tagimporter_menu() {
  14. add_submenu_page(
  15. 'tools.php', // top-level handle
  16. 'Tag Importer', // page title
  17. 'Tag Importer', // submenu title
  18. 'manage_options', // capabilities
  19. 'as_tagimporter', // submenu handle
  20. 'as_tagimporter_page' //function
  21. );
  22. }
  23. function as_tagimporter_page() {
  24. if ( ! current_user_can( 'manage_options' ) ) {
  25. wp_die("You do not have sufficient permissions to access this page.");
  26. }
  27. require_once ( dirname( __FILE__ ) . '/settings.php' );
  28. }