• Resolved D U Enoch

    (@eugyenoch)


    How do I output the affiliate first name in a short code.

    i don’t mind a custom code snippet

Viewing 1 replies (of 1 total)
  • Plugin Author iova.mihai

    (@iovamihai)

    Hey @eugyenoch,

    Thank you for reaching out! Currently, we don’t have a built-in shortcode to output the affiliate’s first name.

    Even so, you can add the following code snippet to your website to register the [slicewp_custom_shortcode_affiliate_first_name] custom shortcode. Once registered, this shortcode can be used to display the affiliate’s first name.

    function slicewp_custom_shortcode_affiliate_first_name() {

    $affiliate = slicewp_get_affiliate( slicewp_get_current_affiliate_id() );

    if ( empty( $affiliate ) ) {
    return '';
    }

    $user = get_userdata( $affiliate->get( 'user_id' ) );

    if ( empty( $user ) ) {
    return '';
    }

    return $user->first_name;

    }
    add_shortcode( 'slicewp_custom_shortcode_affiliate_first_name', 'slicewp_custom_shortcode_affiliate_first_name' );

    Thank you and best wishes,

    Mihai

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.