Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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

4,486 views

Published on

These slides cover common mistakes PHP programmers often make when they join the WordPress ecosystem.

There are few PHP functions for which WordPress has its API. One common case is use of PHP’s curl() function instead of using wp_remote_*() functions.

Using WordPress equivalent has its benefits.

Published in: Technology
  • Be the first to comment

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

  1. 1. Writing PHP! The WordPress Way! @rahul286
  2. 2. Agenda! 🎯
  3. 3. Why? 🕵
  4. 4. What Can Go Wrong? 💣
  5. 5. “ANYTHING THAT CAN GO WRONG, WILL GO WRONG!” -Murphy's Law 😈😛
  6. 6. Different PHP Versions 🎲
  7. 7. PHP Versions used by WordPress sites
  8. 8. Different PHP Extensions 🎭
  9. 9. Examples! 🎉
  10. 10. curl() vs wp_remote_*()
  11. 11. White Screen of Death! ☠
  12. 12. array_merge() vs wp_parse_args()
  13. 13. $input_string = 'type=post&posts_per_page=5&cat=1' $input_array = array ( 'type' => 'post', 'posts_per_page' => 5, 'cat' => '1' ) Example of Example! 🤓
  14. 14. parse_url() vs wp_parse_url()
  15. 15. json_encode() vs wp_json_encode()
  16. 16. array_column() v/s wp_list_pluck()
  17. 17. intval() vs absint()
  18. 18. More WordPress Ways 🎩
  19. 19. • checked() • selected() • wp_dropdown_pages()/users()/*() Helper Functions
  20. 20. Takeaway! 🤓
  21. 21. Did you find this useful? 😉
  22. 22. We are “always” hiring! 🤗 careers.rtcamp.com
  23. 23. Thanks! @rahul286 rahul@rtcamp.com

×