No video

How to get the WordPress user role from the database

  Рет қаралды 1,796

Joshua Herbison

Joshua Herbison

Күн бұрын

A WordPress tutorial on how to get the user's role from the database.
#wordpress #wordpressTutorial #wordpressDevelopment

Пікірлер: 14
@jherbison
@jherbison 3 жыл бұрын
I do a lot of database queries and it helps a lot to be able to connect the user to the user role in a database query.
@viktorshevchenko3888
@viktorshevchenko3888 3 жыл бұрын
Thank you so much for this video with detailed explanations.
@jherbison
@jherbison 3 жыл бұрын
You’re welcome. Thank you for watching and commenting.
@Daud181
@Daud181 3 жыл бұрын
Cool great video
@jherbison
@jherbison 3 жыл бұрын
Thanks.. It is still processing I think.
@pkg2885
@pkg2885 2 жыл бұрын
Thank you for all your videos ... ^^ Very much enjoy learning code from you. I am now subscribed for your channel ^_^
@jamllesol8796
@jamllesol8796 Жыл бұрын
Haven't tried it but this is amazing
@stefanpfadt4353
@stefanpfadt4353 2 жыл бұрын
Hi great video! I am a non-coder and wwant to ask how you would go about this scenario: I have a search form on my website and I want specific search fields only visible to certain user roles, so subscriber can only see first search field, contributor can see 2 and so on. What steps would I have to take? Code/function wise? I appreciate any input or suggestion ;)
@raj080288
@raj080288 3 жыл бұрын
What extension are you using to pre supply the php snippet?
@jherbison
@jherbison 3 жыл бұрын
I create most of my snippets myself. I did a video a couple of weeks ago on sublime text snippets. kzfaq.info/get/bejne/iJyBh5ygxrObdo0.html
@jherbison
@jherbison 3 жыл бұрын
Thank you for watching and commenting.
@raj080288
@raj080288 2 жыл бұрын
@@jherbison thank.you for providing such great content. Looking forward to more videos
@theman7050
@theman7050 3 жыл бұрын
Joshua, under what circumstances is it ok to query the database back and forth like this? I mean ive heard that repeated queries directly to database affect site speed. Is it correct? Coz I run into situations where I cannot make CPT for everything and database tables appear to be more feasible. So how to draw the line there?
@jherbison
@jherbison 2 жыл бұрын
Thank you for the question. WordPress already uses over 40 database queries for their default theme page load. I like to limit the queries as much as possible. I remove as much of WordPress default queries to get it down to about 19 for a page load. So I feel adding a couple of my own queries is fine. Plus, I like speed and this is the reason I do my own queries. If you do a generic get_user_by database query, it return the entire user information as an object. I slim down the query by only requesting what I need from the user information. Hope that helps.. Thank you for watching and commenting.
Using GET or POST, When, Why and How to get the data in PHP
14:32
Joshua Herbison
Рет қаралды 744
Before VS during the CONCERT 🔥 "Aliby" | Andra Gogan
00:13
Andra Gogan
Рет қаралды 5 МЛН
Кадр сыртындағы қызықтар | Келінжан
00:16
If Barbie came to life! 💝
00:37
Meow-some! Reacts
Рет қаралды 71 МЛН
Create a Shortcode Plugin that uses ob_start() function to return data
15:19
What is the difference between JSON and PHP Serialize
18:50
Joshua Herbison
Рет қаралды 1,5 М.
Create WordPress Custom User Role for Custom Post Type
47:48
Vicode Media
Рет қаралды 7 М.
How to create a WordPress Gutenberg Custom Block
42:09
Joshua Herbison
Рет қаралды 48 М.
WordPress Tutorial on how to create a GDPR WordPress Plugin
1:37:05
Joshua Herbison
Рет қаралды 3,5 М.
Use Contact Form 7 to Collect User Data & Display it on WordPress
13:53
I forced EVERYONE to use Linux
22:59
NetworkChuck
Рет қаралды 427 М.
Should You Dare Criticize Kamala Harris... | Piers Morgan
12:40
Jordan B Peterson
Рет қаралды 1,9 МЛН
Why is anti-immigration sentiment on the rise in Canada?
13:00
The Guardian
Рет қаралды 1,9 МЛН
Before VS during the CONCERT 🔥 "Aliby" | Andra Gogan
00:13
Andra Gogan
Рет қаралды 5 МЛН