Writing PHP! The WordPress Way!
@rahul286
Agenda! π―
Why? π΅
What Can Go Wrong? π£
βANYTHING THAT CAN GO WRONG, WILL GO WRONG!β
-Murphy's Law ππ
Different PHP Versions π²
PHP Versions used by
WordPress sites
Different PHP Extensions π
Examples! π
curl() vs
wp_remote_*()
White Screen of Death! β
array_merge() vs
wp_parse_args()
$input_string = 'type=post&posts_per_page=5&cat=1'
$input_array = array ( 'type' => 'post', 'posts_per_page'
=> 5, 'cat' => '1' )
Example of Example! π€
parse_url() vs
wp_parse_url()
json_encode() vs
wp_json_encode()
array_column() v/s
wp_list_pluck()
intval() vs
absint()
More WordPress Ways π©
β’ checked()
β’ selected()
β’ wp_dropdown_pages()/users()/*()
Helper Functions
Takeaway! π€
Did you find this useful? π
We are βalwaysβ hiring! π€
careers.rtcamp.com
Thanks!