user id which initiated script
I'm developing a website on wordpress platform. I have strange issues caused by user id.
It is this the user who initiated the script:
what i mean is, when somebody go to a page, and php executes, so i need to know the user id in php when code executes. For some reasons, sometime the id is not right.
also when php script is executing , if i do:
global $user_ID = get_current_user_id();
then i have the user id which initiated this script ?
The issue was in strpos(), this is not a smart function, it not able to find a substring:
But substr_count() worked. And this is not my first time when strpos() fault... i will no more use it.
How to tell which database tables belongs to which multisite site
I have a local multisite installation I use for development with a relatively large number of sites set up. Every site has its own numbered database tables (i.e. wp_n_links, wp_n_options, wp_n_postmeta etc.) Every time I need to look at a database table in phpMyAdmin I have to look through all the wp_n_options tables to find the tables for the site...
Which url points to which file
Actually i have deployed a wordpress running website on my local environment. I want to have some general instruction that how can i know which file points to which url. Like if i entered the url mysite.com/household-insrtuments. it opens a page in the backend i searched from the text through the project i found that this opens the file name 'housi...
WordPress: different WP_Query usage: Which is correct, in which context?
I have been creating custom WordPress loops with two different approaches, both which involve creating a new instance of the WP_Query object. I typically have multiple loops on a single page. I do not understand how these two approaches differ, and which is the correct context to use each. Approach 1: http://codex.wordpress.org/Class_Reference/WP_Q...