diff --git a/uc-people.php b/uc-people.php index 51c98ba..916391e 100644 --- a/uc-people.php +++ b/uc-people.php @@ -10,50 +10,51 @@ if ( ! defined( 'WPINC' ) ) { die; } +include 'acf-export.php'; function create_custom_custom_post_type(){ $labels = array( - 'name' => 'Contacts', - 'singular_name' => 'Contact', - 'add_new' => 'New Contact', - 'add_new_item' => 'Add New Contact', - 'edit_item' => 'Edit Contact', - 'view_item' => 'View Contact', - 'search_items' => 'Search Contacts' + 'name' => 'People', + 'singular_name' => 'Person', + 'add_new' => 'New Person', + 'add_new_item' => 'Add New Person', + 'edit_item' => 'Edit Person', + 'view_item' => 'View Person', + 'search_items' => 'Search People' ); $args = array( - 'label' => 'Contacts', + 'label' => 'People', 'labels' => $labels, 'description' => '', 'public' => true, - 'menu_position' => 5, - 'menu_icon' => null, + 'menu_position' => 35, + 'menu_icon' => 'dashicons-groups', 'supports' => array( 'tags', 'thumbnail', 'revisions', 'page-attributes' ), 'has_archive' => true ); - register_post_type( 'contact', $args ); + register_post_type( 'person', $args ); - register_taxonomy( 'team', 'contact', + register_taxonomy( 'team', 'person', array( - 'label' => 'Teams', + 'label' => 'Groups', 'labels' => array( - 'name' => 'Teams', - 'singular_name' => 'Team', - 'search_items' => 'Search Teams', - 'edit_item' => 'Edit ', - 'view_item' => 'Team.viewitem', - 'update_item' => 'Update Team', - 'add_new_item' => 'Add new Team', - 'new_item_name' => 'Team.newitemname' + 'name' => 'Groups', + 'singular_name' => 'Group', + 'search_items' => 'Search Groups', + 'edit_item' => 'Edit Group', + 'view_item' => 'View Group', + 'update_item' => 'Update Group', + 'add_new_item' => 'Add new Group', + 'new_item_name' => 'New Group' ), 'public' => true, 'hierarchical' => true, 'rewrite' => array('hierarchical' => true ) ) ); - register_taxonomy( 'tag', 'contact', + register_taxonomy( 'tag', 'person', array( 'label' => 'Tags', 'labels' => array( @@ -130,7 +131,7 @@ function importFile(){ 'post_title' => $title, 'post_name' => 'testing-contact', 'post_status' => 'publish', - 'post_type' => 'contact', + 'post_type' => 'person', 'menu_order' => ( !empty($v['Order']) ? $v['Order'] : 0 ), ); $id = wp_insert_post( $args, true ); @@ -148,14 +149,23 @@ function importFile(){ } function uc_people_settings_page_menu(){ - add_users_page( 'Import People', 'Import People', 'manage_options', 'uc-import-people', 'uc_people_settings_page' ); + add_submenu_page('tools.php', 'Import People', 'Import People', 'manage_options', 'uc-import-people', 'uc_people_settings_page' ); } add_action('admin_menu', 'uc_people_settings_page_menu'); function uc_people_settings_page(){ ?>
-

Import People

+

Import People from Users CSV

+

This tool is to help people with the initial setup of "People" in their site.

+

New Site Setup

+

For new sites, use the "Export Users" tool to generate a template. Open that in a spreadsheet program, and fill out *all* of the information you'll want on your site, and then import that .csv here.

+

Converting UUP Users to "People"

+

For sites that were using the University User Profiles plugin, use the "Export Users" tool and then import that full list here.

+
+

One Time Use

+

This tool can not be used to update information about each Person. If you upload the same .csv twice, you will end up with two records for each person.

+

Choose .csv in the "export users" specific format.

@@ -175,4 +185,5 @@ function uc_acf_admin_enqueue_scripts(){ wp_enqueue_script( 'ucpeoplejs', plugin_dir_url(__FILE__).'/uc-people.js', array('jquery'), '1.0' ); } -add_action('acf/input/admin_enqueue_scripts', 'uc_acf_admin_enqueue_scripts'); \ No newline at end of file +add_action('acf/input/admin_enqueue_scripts', 'uc_acf_admin_enqueue_scripts'); +?>