15,528 reputation
21653
bio website tomjn.com
location United Kingdom
age 26
visits member for 4 years
seen 1 hour ago

I'm a fulltime WordPress Developer at Code For The People in the UK. I also build RTS AIs & attend WordPress/design conferences.

Any questions please say hello, I can normally be found in the WPSE chat ( link in the top header ).


21h
comment get_permalink wrongfully returns only year and month and not all the link
But where did $id come from? post the surrounding code, even if you think it isn't relevant
1d
comment get_permalink wrongfully returns only year and month and not all the link
Can you provide a code example?
2d
comment Automatic links to grid references
You mean longitude and latitudes? Can you provide examples and more information for people who don't know about grid references and how they're formatted but know about WordPress?
2d
comment Replacing string with a variable in php
How does it not work? What did you expect to happen, and what actually happened? Can you verify that $myoptionValue[fieldcount] contains the expected value? Can you update your question with a full debug output of the contents of $myoptionValue?
2d
answered Replacing string with a variable in php
2d
comment Replacing string with a variable in php
Thanks, now we know those are meant to be string literals it's possible to answer this question
2d
comment Replacing string with a variable in php
I gathered that, but where does id1 and idinfo come from? Are you sure you don't mean $myoptionValue['idinfo'] or $myoptionValue[$idinfo] ? Where $myoptionValue comes from is very clear, but idinfo and id1 are being used as keys to access this array but they aren't defined anywhere, they're pulled out of thin air
2d
comment Replacing string with a variable in php
They aren't defined anywhere though, please show where the values come from, without knowing how they're defined, or what their values are, it's incredibly difficult to refactor your code. Are they constants? are they produced using a DEFINE statement? Even if you think those details aren't relevant, please provide them
2d
comment Replacing string with a variable in php
Where are idinfo, id1 and id2 defined? Unless these are constants somewhere this is invalid PHP, I would expect your original code to generate fatal errors
2d
comment Replacing string with a variable in php
I strongly suspect micro-optimisation is at work here, $myoptionValue[id2] also looks like it would generate a PHP fatal error, do you mean $myoptionValue[$id2]? To truly condense this down you need to show more of the surrounding code
Aug
30
comment Remove all nav menu classes except those which begin with certain letters
So you want to return an array that contains only items that begin with fa- or appear in a whitelist? Is there anything specific to WordPress that requires WordPress expertise here and not generic PHP array knowledge?
Aug
29
comment Can't use get_option function in PHP file located inside plugin folder
So you're making a direct query to a non-wordpress file that is inside a WordPress plugin that then tries to use a WordPress API?
Aug
29
comment how to avoid the character conversion of WordPress pages?
Even if your PHP in content plugin is restricted to a single person, in a single country, on a single browser, with a single login, at a particular time of day, of a certain age, on a certain browser, from a certain ISP, on a certain OS, it is still a cardinal sin. I can say without doubt that PHP in content is an abomination, and that I can say any word of any severity that I want and it would still be applicable. It is about the worst thing that you can ever do in any PHP application nevermind WordPress specific. I give you the benefit of the doubt as someone who knows no better
Aug
29
answered how to avoid the character conversion of WordPress pages?
Aug
29
comment how to avoid the character conversion of WordPress pages?
I would STRONGLY recommend against plugins that allow PHP to be embedded in content
Aug
29
revised how to avoid the character conversion of WordPress pages?
added 2 characters in body
Aug
29
comment repost old posts wordpress on facebook
I should note that this isn't a forum, it's a Q&A site, and a lot of things that would be suitable on a forum are not suitable here. One of those is plugin recommendations, questions need to have definitive answers. However, that doesn't mean your question is bad, and you'll get a good response if you ask it on the Facebook groups or in the G+ community =]
Aug
29
comment Allow the access over wp-login.php
Is there any particular reason you didn't use the built in maintenance mode and template, or one of the maintenance mode plugins?
Aug
29
answered How to redirect unattached image attachments
Aug
29
comment Does WordPress create a new Linux user when creating a new WordPress blog?
That statement makes no sense, PHP files are just PHP files, WordPress loads the theme, not the other way around. There is nothing auto-magical about a theme file. In a multisite install all frontend requests go through index.php, so asking that question is like asking how do you prevent a window on the 5th floor from opening a window on the 6th floor