Support

Account

Home Forums General Issues Shortcode returns word "Array"

Solving

Shortcode returns word "Array"

  • I created a checkbox field. I created a shortcode to display that to the logged in user:

    add_shortcode( 'show_causeofloss_as', 'createcauseoflossshortcode' );
    function createcauseoflossshortcode() {
       if(is_user_logged_in()){
    $user_id = get_current_user_id();
       $value_cause = get_user_meta( $user_id, 'user_cause', true);
    
       return $value_cause;
    
    }
    }

    BUT this just returns the word “Array”. I’ve tried lots of variations of this too and just get the word array. I’ve searched all over for weeks (the only thing I can’t figure out) and no one seems to have the same issue.

    Any ideas?

  • Is there anyway to return the data from checkbox selection with a shortcode?

  • You would need to build your own shortcode. https://pagely.com/blog/creating-custom-shortcodes/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.