Tag Info

New answers tagged

0

WordPress stores user_name of logged in user in auth cookie. Auth cookie is signed, so it's easy to check if it's fake, so you can trust this info. OK, so how to get user's user_name from cookie? There is function for that ;) wp_parse_auth_cookie and this is what it returns: return compact( 'username', 'expiration', 'token', 'hmac', 'scheme' ); So you ...


1

I wouldn't say it's not "normal", but it's above typical. The common minimum of queries would go like: main query (set of posts) functionality (menus, widgets, etc) data (terms and such) On a WP test data that would make something under 50 queries on home page. With object cache it will fall under 10 on repeat visits. Without knowing your set up — yes, ...


1

You could simply use fetch_feed() that implements it's own extension of SimplePie_Cache: $feed = new SimplePie(); ... $feed->set_cache_class( 'WP_Feed_Cache' ); ... $feed->set_feed_url( $url ); ... $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) ); that caches the feeds with ...


0

It is hard to advise on issues like that, since they are specific to your installation. In a very general sense one of two categories of issues can cause it: You are not doing what you think you are doing. An example would be placing files into wrong server/folder. Your server is not doing what you think it is doing. An example would be PHP code loaded ...


0

I think this should work. function upload_image_from_url($url) { /** Require dependencies */ require_once( ABSPATH . 'wp-admin/includes/image.php' ); require_once( ABSPATH . 'wp-admin/includes/file.php' ); require_once( ABSPATH . 'wp-admin/includes/media.php' ); // Save as a temporary file $tmp = download_url( $url ); // ...



Top 50 recent answers are included