• Resolved Rhapsody348

    (@rhapsody348)


    First praise: Your plugin rocks!

    Request: Provide a hook or method for displaying a link on the Import tab so a custom template and / or custom instructions link may be displayed for use by individual administrators on multisite installations

    Background: I am using this plugin on a multi-site installation where subscribers get their own sites as a subdomain of the main site. The sites are setup so that new user registration is closed and users must be added manually by the subscriber’s site administrator. The sites are all for sailors and have custom fields in the user profile about each sailor. There is an Excel template prepared with directions on how the site administrators may populate the template and convert it to a CSV file for import at this link: [ redundant link removed ]. The individual site administrators are told to use the default settings for importing users.

    It would be helpful if there was either a hook or a settings field to insert a message with a link on the Import tab so that the custom template would be available for download.

    • This topic was modified 4 years, 2 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Javier Carazo

    (@carazo)

    @rhapsody348,

    Thanks for your words :), you can always leave a review also if you like it.

    Respect your doubt I am not sure about what do you need.

    The hook you will need is a simple hook that should display (where exactly) a link to a custom template. You will prepare the code, using this hook, to show the link.

    Isn’t it?

    Thread Starter Rhapsody348

    (@rhapsody348)

    Thanks for the reply Javier. I will leave a positive review for you.

    I was able to use a plugin called “Show Hooks” that displayed where all the hooks are located. There is a hook called acui_homepage_start that I use to display a message at the top of the Import tab after that hook is fired. I have pasted the code below for anyone else who might want to do similarly. This code is in my plugin functions.php file.

    /************************
     * Show link to user import template on Import users and customers from CSV Plugin
     ***********************/
    add_action( 'acui_homepage_start', 'cm_show_import_link' );
    function cm_show_import_link() {
    
        echo '<div class="updated"><strong>Crew Manager Import Template:</strong> Download a custom import template to populate with users at this <a href="https://crew-mgr.com/forum/viewtopic.php?f=4&t=8" target=\"_blank\" title = "Download link on support forum">Crew Manager User Import Template Link</a> that includes instructions on use.</div>';
    
    }
    // end function cm_show_import_link()
    Plugin Author Javier Carazo

    (@carazo)

    @rhapsody348,

    I saw the review, thanks again.

    So, you need a new hook, isn’t it? Which one do you need and where?

    Thread Starter Rhapsody348

    (@rhapsody348)

    Hello Javier,

    I am all set using the hook acui_homepage_start that I found using the Show Hooks WordPress Plugin plugin so do not need another hook.

    The link below shows the result of the code I used above with my custom message at the top.
    Import Tab – Screen Shot with Custom Message at Top

    I do have another item I found. I believe it is a problem with Microsoft Office 365 and how it converts a spreadsheet to CSV. The Excel template that I created for importing users and custom fields has the cells formatted so that dates entered are stored in the proper format. I used the format painter to format cells for 100 rows. Even though there is no input in many of the rows, the CSV file is created with blanks for these rows. There is no user login or user email in those rows. When the CSV file is imported, it creates entries for users with the user name usr_xxxx where xxx is the ID generated by WordPress. The user it creates have no email address or any other information. I need to manually delete them from WordPress.

    Would it be possible to check the user email field on import and stop it from being imported into WordPress if there is no email address in the field? Possibly as simple as looking for the presence of “@” in the string.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add Link to Download Custom Import template’ is closed to new replies.