• Resolved jjnash01

    (@jjnash01)


    I would like to access wordpress data from my react app. Is there a way to achieve this like if I were to write apho and use the WP functions?

    Would also like to know how to get the logged in detail of possible?

    Thanks in advance

Viewing 1 replies (of 1 total)
  • Plugin Author rockiger

    (@rockiger)

    Hello @jjnash01,

    the user logs in via WP. The WP will set the HTTP header accordingly. To access the user object via JS, here is one global JS variable ‘rp-react-app-asset-0’. It has two properties, user and usermeta.

    If the user is logged in, the properties hold the user data, otherwise, they are empty.

    To access other WP data/functions, you have to use the WP-API at your-domain/wp-json. Alternatively, you can use the WP GraphQL plugin.

    PS: If you like the plugin, please consider writing a review.

Viewing 1 replies (of 1 total)
  • The topic ‘Access the standard wordpress calls from inside’ is closed to new replies.