Remove „Private:“ from the titles of private WordPress pages

# add to functions.php of your theme
function the_title_trim($title) {
  $title = attribute_escape($title);
  $findthese = array( '#Protected:#', '#Private:#' );
  $replacewith = array( '', // What to replace "Protected:" with '' //What to replace "Private:" with );
  $title = preg_replace($findthese, $replacewith, $title);

  return $title;
add_filter('the_title', 'the_title_trim');

The tipping point for NodeJS

The prime reason to use PHP is the prime reason to leave it

People have argued in the past that PHPs badness is it’s advantage. And it’s true. The speed at which non-programmers can put out functional and even notably use- and successfull websites is staggering. An absolute absence of arrogance in the community and the silly utter wackyness of the language keeps everyone focused on solving the problem and not building an architecture that one can get high over but never gets finished. Paul Graham calls this the Blub Paradox, and explains the advantage C has over Lisp due to the weaknesses C has vis-a-vis Lisp, and not its power.

PHPs documentation and the availability of answers on the interweb are still an example for many other technologies and the duct-tape & chickenwire approach to getting things done on the *nix platform make for some awesome environments that everyone can tinker with. An environment where even *nix fanatics are happy and gladly join forces with Mac-Hippsters who like to fiddle with nice UIs on their *nix platform and non-tech beancounters who are longing for something they can understand and click on that is up and running next week.

The installbase of the usual PHP applikations puts every other web-oriented technology stack to shame and even PHPs security track-record is pretty impressive, given the size of its installbase.

Yet I do think PHP is on the way out. At least with me.

Why is that? Well, the point lies in the above. PHP and it’s amatureishly designed applications are a mess. A working mess, but a mess none-the-less. And, this is perhaps the biggest downfall. The teams working with PHP rarely know true indepth rules of software development. Example: Up to this very day I’ve run into more PHP developers whom I’ve had to explain why versioning is an important thing than ones that already knew and were using it. It’s just one example, if one which sounds patently absurd to any real developer, but there is truth to this in many different fields of development with projects with PHP stuff at their core.

PHP originated as a templating language for end-users, very much like SQL started as a query interface for office workers. Simple and easy to use, but very hard to scale technology wise. This shows at every corner to this very day.

Why and where the move to NodeJS makes sense

NodeJS is the new kid on the block, at least to a point where it makes sense of considering it for something mission-critical, and because it drops an entire programming language out of the web-mix and focuses solely on JavaScript it offers an intrigueing advantage over PHP, especially with modern asynchronous and „progressive“ „webapps“ making the decision about server or client-side more and more arbitrary.

This however, to me, is not the main point making a move from LAMP to Node attractive.

The interesting part about Node is, that while being built on a losely typed language (a fact that has the C-family members and Java folks abruptly wake at night, bathed in cold sweat) and having hippster written all over it, Node does come with a factual demand for the newest and flashiest in technology. Which is not a bad thing, no matter how it may sound. For example, it makes no sense at all to do Node without looking into load-balancing and stream-handling at the same time.

And here lies Nodes big advantage yet, in my opinion: You can not be a non-programmer and get something useful done with node. Especially if you’re a ’non-programmer‘ that has been doing LAMP for the past 15 years. The barrier of entry is notably higher that with PHP, despite having one programming language less to deal with. You need basic knowlege of TCP/IP and HTTP to get up and running with Node. You have to be ready for the world of distributed and virutalised serverpower where the question about the underlying host technology is just about academic and nothing else. You have to feel safe doing low-level things whilst at the same time not crying like a baby when you notice you’re lacking that one single FTP thingie to dump all your shit on to get your unmaintainable ball-of-mud running instantly.

NodeJS is hip, but it is a specialist technology none-the-less, which put’s it in a position that PHP can never reach. And probably wouldn’t want to reach either.


I find myself longing for environment where people building non-trivial webapps take approaches beyond the next WordPress plugin and the next bizar hack to get things running half-way and understand the requirement for avoiding the quick-and-dirty way. While that is possible in PHP, I’ve come to the conclusion that it’s too difficult to find the right people in the PHP community and that it as a whole is to large and has to many fiddlers and part-time proggers and not enough ‚real‘ programmers to be sure you’re getting the right mate or joining a crew that actually knows what it is doing.

That is the one last big reason why I’m looking into moving to Node and away from PHP.

We’ll see how this goes.

Quoted of the Web: „PHPs badness is its advantage“

I love Python, I think JavaScript is sort of OK and I did a lot of serious programming in ActionScript 2&3, both of which are quite simular to JS. I was basically forced into doing PHP by the market. I never really liked PHP but I really never hated it either. The thing about PHP is that it’s so specific in its domain and such a hack that no one doing PHP development for a living will go around boasting about the greatness of the language. There is a refreshing lack of arrogance in the PHP community which, in my observation, makes it very easy for n00bs to pick up. As a result we get countless people reinventing the wheel in PHP and discovering basic programming patters anew for them selves and starting yet another Framework/CMS/Whatnot and the results often are really bizar. But the community remains alive that way.

Working with Drupal with a current project because it’s the prime go-to CMS here is like a live alice in wonderland trip. A strange historically grown mess, barely tamed by sanitiy and a relentless chaotic community that all by accident seem to come up with hacks that somehow solve the problem in some way. And yet there’s a solid global corporation building its business all around Drupal []. The surreal hacks with which the Drupal people solve their problems are mindboggling, and yet everybody seems totally OK with it. And Drupals track record of deployments is impressive.

I guess with PHP it’s somehow like the C vs. Lisp argument: C is so shitty compared to Lisp that you have to get yourself together and work as a team, or you won’t get anything done. Hence Lisp has this loner exisitance on the side and all the real work gets done in this ancient C thing.

PHP is a simular thing. It is so bad that no respectable programmer would pick it up voluntarly nowadays, but yet it grew out of Perl (which is worse in some ways), was somewhat of an improvement and was at the right place at the right time. The badness of PHP accounts for its considerable lack of arrogance (compare the PHP community to the Ruby community for instance) and for no one feeling guilty when he does a quick bad hack.

As a programmer you don’t feel dirty when you do bad programming in PHP, you already felt that when you picked PHP as the solution. Hence quite a bit of work gets done in PHP. That’s why PHP has Drupal and Typo3 and Joomla and the Java Community has nothing of that proportions. The barrier of entry into PHP is *very* low which gives it its momentum.

WordPress Path to actual active theme / Pfad zum eigentlich aktiven Theme

preg_replace("/\/\w*?\.css/", "/", get_stylesheet_uri());

Gibt den Pfad des aktiven Themes zurück, auch wenn dies ein Child-Theme ist. Vorrausgesetzt, das Child Stylesheet ist mit WordPress Bordmitteln im Theme eingebunden und aktiviert.

Returns the path of the actual active theme, even if this is a child theme. This only works if the child themes stylesheet is included with WordPress methods.

Return value comes with trailing Slash!!

URLs in WordPress

bloginfo("wpurl"); //check this!

Returns Root Domain URL without trailing slash.


Returns URL of the WordPress Home target without trailing slash. Usually is the same as the root domain, but needn’t be!


Returns the URL leading to the WP Admin directory including trailing slash. URLs in WordPress weiterlesen

Letztes URL Element mit Inhalt / Last URL Segment with content

array_pop(array_filter(explode("/", $_SERVER['REQUEST_URI']), function ($val){return (strlen($val) > 0);}));

(Das ist PHP / This is PHP)

is_int($thisValue = array_pop(array_filter(explode("/", $_SERVER['REQUEST_URI']), function ($val){return (strlen($val) > 0);}))) ? $thisValue : false;

This command only returns a value if the snippet retrieved is an Integer (better for grabbing IDs) – otherwise it returns false / Dieser Befehl gibt den Wert nur zurück, falls das URL Snippet einen Integerwert enthält – ansonsten wird der Wert „false“ zurückgeben (praktisch um IDs abzugreifen)