WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Shortcode To Check For Logged In User? (2 posts)

  1. Bob Rockefeller
    Member
    Posted 1 year ago #

    Is there a WooCommerce shortcode to check for which user is logged in to use to control what content is shown? Perhaps it would look something like:

    [woocommerce username= "someone" status="in"]
    Show content specific to someone
    [/woocommerce]

    If not that, maybe a generic someone is logged in short code:

    [woocommerce status="in"]
    Show content if any user is logged in
    [/woocommerce]

    Bob

    http://wordpress.org/extend/plugins/woocommerce/

  2. royho
    Member
    Posted 1 year ago #

    This is not really a WooCommerce thing but more of a WordPress native function.

    You can always call is_user_logged_in() function to check if someone is logged in. It returns a boolean. However if you need that to work in a shortcode, you would need to build a custom shortcode for that.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic