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.
@viktorshevchenko38883 жыл бұрын
Thank you so much for this video with detailed explanations.
@jherbison3 жыл бұрын
You’re welcome. Thank you for watching and commenting.
@Daud1813 жыл бұрын
Cool great video
@jherbison3 жыл бұрын
Thanks.. It is still processing I think.
@pkg28852 жыл бұрын
Thank you for all your videos ... ^^ Very much enjoy learning code from you. I am now subscribed for your channel ^_^
@jamllesol87962 жыл бұрын
Haven't tried it but this is amazing
@stefanpfadt43532 жыл бұрын
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 ;)
@theman70503 жыл бұрын
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?
@jherbison3 жыл бұрын
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.
@raj0802883 жыл бұрын
What extension are you using to pre supply the php snippet?
@jherbison3 жыл бұрын
I create most of my snippets myself. I did a video a couple of weeks ago on sublime text snippets. kzbin.info/www/bejne/iGe0hWyllrJqfLs
@jherbison3 жыл бұрын
Thank you for watching and commenting.
@raj0802883 жыл бұрын
@@jherbison thank.you for providing such great content. Looking forward to more videos