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!
@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' =...
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!
@rahul286
rahul@rtcamp.com
Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017
Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017
Writing PHP – The WordPress Way! by Rahul Bansal  @WordCamp Mumbai 2017
You’ve finished this document.
Download and read it offline.
Upcoming SlideShare
Hiring The Right Way in the WordPress Ecosystem - WordCamp Udaipur 2017
Next
Upcoming SlideShare
Hiring The Right Way in the WordPress Ecosystem - WordCamp Udaipur 2017
Next
Download to read offline and view in fullscreen.

Share

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

Download to read offline

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.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

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
  • shaitaana1

    Mar. 27, 2017

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.

Views

Total views

7,082

On Slideshare

0

From embeds

0

Number of embeds

5,118

Actions

Downloads

5

Shares

0

Comments

0

Likes

1

×