Texas has been on my list for a while now and Austin sounds like a great place to start. Looking forward for some sunshine, good company, great food and an exciting WordCamp Austin 2013. Maybe even a roundhouse kick to the face.
I’ve seen many people define an empty
$matches variable before using it in
preg_match_all functions in PHP. I’ve done it myself, and I was quite surprised to learn that you don’t really have to — even if there’s no match, you will not get an undefined variable notice.
It’s a shame that the Russian “consumer watchdog” Rospotrebnadzor, the Ministry of Justice, and the Federal Service for Supervision in the Sphere of Telecom, Information Technologies and Mass Communications (or Roskomnadzor) were “smart” enough to block access to over 20 million blogs hosted on WordPress.com because three of them contained suicide, drugs, and terrorism related content, which apparently has to be censored in Russia.
Looks like somebody’s building the Great Firewall of Russia. I hoped we were better than that. Oh well…
I’ll be travelling to Bulgaria and speaking about the Settings API at WordCamp Sofia this weekend. There are still tickets available if you’re willing to come.
The Moscow WordPress Meetup is this Saturday. If you’re in Moscow, come join us for a few hours of geek talk about WordPress. We have several presentations scheduled, as well as good coffee, stickers and buttons. Despite the Moscow weather recently, I feel that Saturday will be a great day.
“Why is Github asking me to input my username and password when I try to push changes to a repository I own?” I asked this myself a couple of times before I figured out I had cloned it the wrong way:
git clone https://github.com/kovshenin/publish.git .
As opposed to:
git clone firstname.lastname@example.org:kovshenin/publish.git .
Where the former will use the HTTP protocol, and thus require basic authentication (username and password), and the latter will use the SSH protocol, and will try to use my SSH key instead, for password-less authentication. The former will work, but you’ll have to keep entering your username and password every time. The latter is more secure.
Simple, but tricky. No, I don’t use a GUI for version control, and neither should you, trust me :)
I was wondering why my
posts_where filter was not being executed on my WordPress query and after a bit of poking around, I figured out that get_posts sets
suppress_filters to true, unless specified otherwise, making
WP_Query skip a bunch of SQL filters, including the
posts_where I was trying to set. So learn the easy way —
get_posts will suppress filters by default.
Hopefully this won’t be such a problem when when date_query makes it into core, since one of the most popular uses for
posts_where is better date filtering.
Here’s a tip! Don’t add nonce fields on the front end of your site for logged out users. That may cause trouble with page caching plugins, which will serve HTML from cache with the nonce field, even if the nonce has expired. Also, nonces don’t really help prevent spam in contact forms, etc., especially for anonymous visitors. Nonces are used for security.