I have 2 projects, one in Wordpress, and the other one in Laravel 4.2.
Recently i had to merge both projects into one Laravel 4.2 App using jgrossi/corcel. This was my only option.
Everything works fantastic! I can even post directly into Wordpress without logging into Wordpress to get posts, comments, etc.
But there is something I can't figure out. Wordpress is using Jetpack for subscribers. The laravel app needs a field to add more subscribers. I have very little experience in Wordpress.
Is it possible to add subscribers from outside Wordpress directly into the database? If not, is there a way to use a Jetpack plugin outside of Wordpress?
Yes you can add new users in database with subscribers role.
Wordpress stores the users data in wp_users
table and its meta info in wp_usermeta
. So follow the following steps
wp_users
table. As a sample here is entry from my wp_users
table. You can submit values for these attributes using your normal laravel form with post request.
wp_usermeta
table. Here you need to set two key value attributes against user_id
of newly inserted record.
meta_key = wp_capabilites
and meta_value = a:1:{s:10:"subscriber";b:1;}
. As you can note the meta_value
for wp_capabilities
is in serialzed form.meta_key = show_admin_bar_front
and meta_value = true
.So you added a new user with subscriber role.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With