Change site style→

style-1 style-2
  1. nazenani
  2. >
  3. >
  4. >
  5. Never forget null. If data is empty….

Never forget null. If data is empty….

“null” is the theory a little difficult to understand for beginner programmers.

“null” equal no value, not equal “0”.
“0” is a value, a kind of integer.
“null” is empty, there is nothing.

“null” is important theory in WordPress.
If the title of article is empty, “title” value is “null”, not 0.
Then script below return “null”

<?php var_dump(the_title()); ?>

In WordPress, When a value is null, construct UX carefully.
We should think fether “null” should be expressed on UX.

By the way, when tag:”the_title()” is null, how do you describe it?

I reminded 2 patterns.

How about you?


Fields with * is required.

go to related tags archive?

No tags setted.