-
Always remember about variable type
Yes, I use the correct word. Always remember about variable type. It is not always important because PHP uses type casting, but it may lead you to hard-to-find mistakes. For example, I need to get some variable value. There are only three allowed states: 0, basic, advanced. As you may see, 0 is easily recognizable as integer and two others are strings. If variable (it is post_meta to be exact) is not set, it should use default value – 0. So, it is pretty easy: [crayon-675b3737ebddd008556689/] I do not need to filter it more, because I translate this variable once more later. So, let’s jump to this ‘later’: [crayon-675b3737ebde2598164101/] Yes,…