writing php – the wordpress way! by rahul bansal @wordcamp mumbai 2017

26
Writing PHP! The WordPress Way! @rahul286

Upload: rtcamp

Post on 05-Apr-2017

376 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

Writing PHP! The WordPress Way!

@rahul286

Page 2: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

Agenda! 🎯

Page 3: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017
Page 4: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

Why? 🕵

Page 5: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

What Can Go Wrong? 💣

Page 6: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

“ANYTHING THAT CAN GO WRONG, WILL GO WRONG!”

-Murphy's Law 😈😛

Page 7: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

Different PHP Versions 🎲

Page 8: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

PHP Versions used by

WordPress sites

Page 9: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

Different PHP Extensions 🎭

Page 10: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017
Page 11: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

Examples! 🎉

Page 12: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

curl() vs

wp_remote_*()

Page 13: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

White Screen of Death! ☠

Page 14: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

array_merge() vs

wp_parse_args()

Page 15: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

$input_string = 'type=post&posts_per_page=5&cat=1'

$input_array = array ( 'type' => 'post', 'posts_per_page'

=> 5, 'cat' => '1' )

Example of Example! 🤓

Page 16: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

parse_url() vs

wp_parse_url()

Page 17: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

json_encode() vs

wp_json_encode()

Page 18: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

array_column() v/s

wp_list_pluck()

Page 19: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

intval() vs

absint()

Page 20: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

More WordPress Ways 🎩

Page 21: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

• checked()

• selected()

• wp_dropdown_pages()/users()/*()

Helper Functions

Page 22: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

Takeaway! 🤓

Page 23: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017
Page 24: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

Did you find this useful? 😉

Page 25: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

We are “always” hiring! 🤗

careers.rtcamp.com

Page 26: Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017

Thanks!

@[email protected]