I use wp_signon() and it returns a user, not an error. However when I do is_user_logged_in() it returns false.
I am trying to get current user info by using get_currentuserinfo() and wp_get_current_user()
Tag » Function
last day of month in mysql
Sometimes we need to get the last day of the month on specific date in mysql becoz every month has different last day eg. FEB. may have 28 or 29, JAN has 31 and APR has 30.
DAY in MySQL
DAY() in MySQL returns the day of the month for a specified date. The day returned will be within the range of 1 to 31. If the given date is ‘2013-03-13’, the function will return 13.
Merge two arrays in PHP
The array_merge() function merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one. It returns the resulting array.
<?php $A1=array("apple","papaya"); $A2=array("banana","grapes"); print_r(array_merge($A1,$A2)); ?> Output would be : Array ( [0] => apple[1] => papaya[2] => banana [3] => grapes )
Increase the PHP Script execution time
set_time_limit : set/increase the PHP Script maximum execution time
By default, PHP has a set of seconds limit to execute the script, if some script reach to run then some fatal error occurs.
How to redirect to another url in wordpress?
We can redirect website visitor to another url in wordpress using wp_redirect() function.
wp_redirect() function in wordpress redirects the user to a specified url.
<?php wp_redirect( $location-url, $status ); exit; ?>