SlideShare a Scribd company logo
10 Questions I Ask Every
      Developer
        (and the answers)
Interviewed 175+ candidates.
   Responsible for hiring 45+.
I’ve found some amazing people.
I’ve also made mistakes. Lots of them.
Not the developers
you’re looking for.
1. Does the candidate “get” the
   platform?

2. How much does he/she already know
   about building on WordPress?

3. Does the candidate think critically
   about his/her work?
There’s not always one right answer.

... But there are better and worse answers.

... And there are some very wrong answers.

... Saying “I’m not familiar with that” is
better than making something up.
Part 1: Honestly, now, do you “Wordpress”?
Question #1

Tell me what a “hook” is, and talk
  about the two basic hooks in
 WordPress, and the difference
         between them.
Question #1
Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them.




A killer feature that gets customers
              addicted.


                                          wrong answer
Question #1
Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them.




 A way to extend WordPress. The
two types are plug-ins and themes.


                                          wrong answer
Question #1
Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them.




                         A hook is a
                      technique used to
                    alter or augment the
                    behavior of software.
Question #1
Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them.




                         WordPress has
                       “action” hooks and
                         “filter” hooks.
Question #1
Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them.




 Action are hooks that WordPress launches at specific
              intervals during execution.

 add_action	
  (	
  'hook_name',	
  'your_function_name',	
  [priority],	
  [accepted_args]	
  );
Question #1
  Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them.




Filters are functions that WordPress passes data through, at
 certain points in execution, just before taking some action
                        with the data.
        add_filter	
  (	
  'hook_name',	
  'your_filter',	
  [priority],	
  [accepted_args]	
  );
Question #2

Explain what a “taxonomy” is.
Question #2
           Explain what a “taxonomy” is.




A way to preserve unused (dead) code.




              wrong answer
Question #2
                    Explain what a “taxonomy” is.




The various types of content in WordPress: posts, pages,
                  media, menus, etc.




                       wrong answer
Question #2
               Explain what a “taxonomy” is.




A taxonomy is a way to group things together.
Question #2
              Explain what a “taxonomy” is.




WordPress posts have two default taxonomies:
           categories and tags.
Question #2
                  Explain what a “taxonomy” is.




Bonus - a couple of lesser known default taxonomies.

                   Link Category
                 Navigation Menu
Question #3

Let’s say you see “wp_list_filter()”
  for the first time. How do you
     figure out what this does?
Question #3
Let’s say you see “wp_list_pluck()” for the first time. How do you figure out what this does?




                        not wrong... but not great
Question #3
Let’s say you see “wp_list_pluck()” for the first time. How do you figure out what this does?




                        not wrong... but not great
Question #3
Let’s say you see “wp_list_pluck()” for the first time. How do you figure out what this does?


        It’s open source. I look at the source.
Part 2: So... you think you’re good at this.
Question #4


  Explain what sanitizing and
validating data means, and apply
       that to WordPress.
Question #4
         Explain what sanitizing and validating data means, and apply that to WordPress.




Checking database integrity and ensuring nothing has been
                       corrupted.




                                    wrong answer
Question #4
     Explain what sanitizing and validating data means, and apply that to WordPress.




Testing data to make sure it’s what you expected.




           good layman explanation... tell me more
Question #4
          Explain what sanitizing and validating data means, and apply that to WordPress.




Untrusted data comes from many sources (users, third party
   sites, your own database!, ...) and all of it needs to be
             validated both on input and output.
Question #4
         Explain what sanitizing and validating data means, and apply that to WordPress.



WordPress includes a large number of helper functions and
  methods to ensure that output and input data is safe.

                HTML Fragments, e.g. wp_kses()
                      Text nodes, e.g. esc_html()
                                       Attribute
Question #4
     Explain what sanitizing and validating data means, and apply that to WordPress.


   Examples of validation / sanitizing helpers:

HTML: wp_kses( $string, $allowed_html, $allowed_protocols )

          Text nodes & attributes: esc_html( $text )

             URLs: esc_url( $url, (array) $protocols )

       Database: wpdb->insert( $table, (array) $data )

 Filesystem: validate_file( $filename, (array) $allowed_files )
Question #5

 Say a client needs to selectively
  exclude posts from their blog
home. Specifically, how would you
           achieve that?
Question #5
  Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that?




User approach: I would add a new category called “Exclude
             From Home” for the authors.




                                     not bad... but not great
Question #5
  Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that?




User approach: I would add a new custom meta box with an
          “Exclude from home page” checkbox.




                                       good enough answer
Question #5
  Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that?




    User approach (bonus points): I would hook into
post_submitbox_misc_actions to add a checkbox to
 the “publish” box with an “Exclude from home” option.
Question #5
Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that?




Technical approach: Inside the loop, I would write an “if”
statement checking my criteria around the post output.




                                       very wrong answer
Question #5
  Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that?




Technical approach: I would do a new post query at the top
  of my home.php template, excluding posts based on my
                          criteria.




                                             wrong answer
Question #5
  Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that?


 Technical approach: I would use pre_get_posts to hook
into the post query, check if the query is for the blog home,
and alter the query to exclude posts based on my approach
                     before it executes.
                 function	
  exclude_category(	
  $query	
  )	
  {
                 	
  	
  	
  	
  if	
  (	
  $query-­‐>is_home()	
  &&	
  $query-­‐>is_main_query()	
  )	
  {
                 	
  	
  	
  	
  	
  	
  	
  	
  $query-­‐>set(	
  'cat',	
  '-­‐1,-­‐1347'	
  );
                 	
  	
  	
  	
  }
                 }
                 add_action(	
  'pre_get_posts',	
  'exclude_category'	
  );
Question #6

Tell me about your favorite
  function in WordPress.
Question #6
            Tell me about your favorite function / class / API in WordPress.




  media_sideload_image($file,	
  $post_id,	
  $desc);

Download an image from the specified URL and attach it to a post.
Question #6
           Tell me about your favorite function / class / API in WordPress.




           human_time_diff(	
  $from,	
  $to	
  );

     Determines the difference between two timestamps.
The difference is returned in a human readable format such as "1
                     hour", "5 mins", "2 days".
Question #6
  Tell me about your favorite function / class / API in WordPress.




  wp_list_pluck(	
  $list,	
  $field	
  );


Pluck a certain field out of each object in a list
Question #6
          Tell me about your favorite function / class / API in WordPress.




_doing_it_wrong(	
  $function,	
  $message,	
  $version	
  )

          Trigger a user error if WP_DEBUG is true.
                   (technically internal only)
Question #7

 Say you needed to retrieve some
data from a remote source once a
  day. Tell me about some of the
    WordPress APIs you’d use.
Question #7
 Say you needed to retrieve some data from a remote source once a day. Tell me about some of the WordPress
                                               APIs you’d use.


I would use wp_schedule_event() (the WP-Cron APIs)
              to schedule the daily update.
            add_action('my_hourly_event',	
  'do_this_hourly');

            function	
  my_activation()	
  {
            	
   if	
  (	
  !wp_next_scheduled(	
  'my_hourly_event'	
  )	
  )	
  {
            	
   	
   wp_schedule_event(	
  time(),	
  'hourly',	
  'my_hourly_event');
            	
   }
            }
            add_action('wp',	
  'my_activation');

            function	
  do_this_hourly()	
  {
            	
   //	
  do	
  something	
  every	
  hour
            }
Question #7
 Say you needed to retrieve some data from a remote source once a day. Tell me about some of the WordPress
                                               APIs you’d use.


I would use wp_remote_post() (part of the WP HTTP
             API) to remotely fetch the data.
         $response	
  =	
  wp_remote_post(	
  $url,	
  array(
         	
   'method'	
  =>	
  'POST',
         	
   'timeout'	
  =>	
  45,
         	
   'redirection'	
  =>	
  5,
         	
   'httpversion'	
  =>	
  '1.0',
         	
   'blocking'	
  =>	
  true,
         	
   'headers'	
  =>	
  array(),
         	
   'body'	
  =>	
  array(	
  'username'	
  =>	
  'bob',	
  'password'	
  =>	
  '1234xyz'	
  ),
         	
   'cookies'	
  =>	
  array()
         	
  	
  	
  	
  )
         );
Question #7
  Say you needed to retrieve some data from a remote source once a day. Tell me about some of the WordPress
                                                APIs you’d use.




    Extra credit: I would use the set_transient() (the
Transients API) to cache the remote data after processing it.
       set_transient(	
  'processed_remote_data',	
  $processed_data,	
  60*60*24	
  );
Part 3: So you can code. But can you think?
Question #8

 Tell me what you the most
interesting trend or “thing to
   watch” in our space is.
Question #8
         Tell me what you the most interesting trend or “thing to watch” in our space is.




 Mobile first & the evolution of responsive design. The idea of
“progressive enhancement”, and what designing for mobile
   first really means. Image and advertising challenges in
                  responsive technologies.
Question #8
           Tell me what you the most interesting trend or “thing to watch” in our space is.




 HiDPI (“retina”). We still need to solve technical hurdles (e.g.
image uploads in WordPress), and at some point this is going
to be a major requirements. It seems like Responsive Design
                            circa 2009.
Question #8
         Tell me what you the most interesting trend or “thing to watch” in our space is.




Meaningful social media integration. Really innovative social
 media integration with content, especially within in e-
      commerce, is still a relatively new frontier.
Question #8
          Tell me what you the most interesting trend or “thing to watch” in our space is.




Explosion of devices. There are new challenges we haven’t fully
  wrapped our heads around as we have so many different
  screen sizes and types emerges, each with - potentially -
                   their own browser quirks.
Question #8
     Tell me what you the most interesting trend or “thing to watch” in our space is.




Typography. Foundries are maturing, @font-face has
       essentially been universally adopted.
Question #9

  What frustrates you about
WordPress? What’s something that
  you think needs to change?
Question #9
     What frustrates you about WordPress? What’s something that you think needs to change?




  Taxonomy / term architecture could be improved.
No term meta data, strange artifacts due to way tags and
       categories of the same name are linked.
Question #9
       What frustrates you about WordPress? What’s something that you think needs to change?




There are no formal methods to create direct relationships
       between two content objects (post objects).
Question #9
     What frustrates you about WordPress? What’s something that you think needs to change?




User interface for managing widgets and menus* can be
           clumsy. Awkward drag and scroll.
Question #9
  What frustrates you about WordPress? What’s something that you think needs to change?




 Some areas don’t handle conflicts in plug-in well -
for example registering two custom menu items in
                  the same spot.
Question #10


Why do you want to work day in
  and out with WordPress?
Question #10
             Why do you want to work day in and out with WordPress?




“It’s become the dominant CMS on the web. And growing.”
Question #10
              Why do you want to work day in and out with WordPress?




“It’s the only platform where customers don’t call me back
           in every month asking for a retraining.”
Question #10
            Why do you want to work day in and out with WordPress?




“Because I believe in the freedoms in open source, and
  WordPress is an awesome open source platform.”
Question #10
Why do you want to work day in and out with WordPress?




  “The community.”
10 Questions I Ask Every
      Developer
   @jakemgold • @10up • 10up.com

More Related Content

Similar to 10 questions for every developer

Dependency Injection for PHP
Dependency Injection for PHPDependency Injection for PHP
Dependency Injection for PHP
mtoppa
 
How To Write a WordPress Plugin
How To Write a WordPress PluginHow To Write a WordPress Plugin
How To Write a WordPress Plugin
Andy Stratton
 
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
Ronald Hsu
 
Bending word press to your will
Bending word press to your willBending word press to your will
Bending word press to your will
Tom Jenkins
 
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Evan Mullins
 
Cain & Obenland — Episode 4
Cain & Obenland — Episode 4Cain & Obenland — Episode 4
Cain & Obenland — Episode 4
Konstantin Obenland
 
Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post Types
K.Adam White
 
Session 3.pptx
Session 3.pptxSession 3.pptx
Session 3.pptx
ShubhamJogdand8
 
Extending WordPress. Making use of Custom Post Types
Extending WordPress. Making use of Custom Post TypesExtending WordPress. Making use of Custom Post Types
Extending WordPress. Making use of Custom Post Types
Utsav Singh Rathour
 
Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019
Adam Tomat
 
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
Joe Querin
 
Scaling Complexity in WordPress Enterprise Apps
Scaling Complexity in WordPress Enterprise AppsScaling Complexity in WordPress Enterprise Apps
Scaling Complexity in WordPress Enterprise Apps
Mike Schinkel
 
Custom Post Types in WP3
Custom Post Types in WP3Custom Post Types in WP3
Custom Post Types in WP3
gregghenry
 
SELJE_Database_Unit_Testing.pdf
SELJE_Database_Unit_Testing.pdfSELJE_Database_Unit_Testing.pdf
SELJE_Database_Unit_Testing.pdf
Eric Selje
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
Yoav Farhi
 
WordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress OptimizationWordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress Optimization
Joost de Valk
 
Task 03
Task 03Task 03
Task 03
EdiPHP
 
tutorial54
tutorial54tutorial54
tutorial54
tutorialsruby
 
tutorial54
tutorial54tutorial54
tutorial54
tutorialsruby
 
WordPress 3: Leveraging the Shiny New Features
WordPress 3: Leveraging the Shiny New FeaturesWordPress 3: Leveraging the Shiny New Features
WordPress 3: Leveraging the Shiny New Features
Reggie Nicolay
 

Similar to 10 questions for every developer (20)

Dependency Injection for PHP
Dependency Injection for PHPDependency Injection for PHP
Dependency Injection for PHP
 
How To Write a WordPress Plugin
How To Write a WordPress PluginHow To Write a WordPress Plugin
How To Write a WordPress Plugin
 
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
 
Bending word press to your will
Bending word press to your willBending word press to your will
Bending word press to your will
 
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
 
Cain & Obenland — Episode 4
Cain & Obenland — Episode 4Cain & Obenland — Episode 4
Cain & Obenland — Episode 4
 
Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post Types
 
Session 3.pptx
Session 3.pptxSession 3.pptx
Session 3.pptx
 
Extending WordPress. Making use of Custom Post Types
Extending WordPress. Making use of Custom Post TypesExtending WordPress. Making use of Custom Post Types
Extending WordPress. Making use of Custom Post Types
 
Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019
 
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
 
Scaling Complexity in WordPress Enterprise Apps
Scaling Complexity in WordPress Enterprise AppsScaling Complexity in WordPress Enterprise Apps
Scaling Complexity in WordPress Enterprise Apps
 
Custom Post Types in WP3
Custom Post Types in WP3Custom Post Types in WP3
Custom Post Types in WP3
 
SELJE_Database_Unit_Testing.pdf
SELJE_Database_Unit_Testing.pdfSELJE_Database_Unit_Testing.pdf
SELJE_Database_Unit_Testing.pdf
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
 
WordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress OptimizationWordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress Optimization
 
Task 03
Task 03Task 03
Task 03
 
tutorial54
tutorial54tutorial54
tutorial54
 
tutorial54
tutorial54tutorial54
tutorial54
 
WordPress 3: Leveraging the Shiny New Features
WordPress 3: Leveraging the Shiny New FeaturesWordPress 3: Leveraging the Shiny New Features
WordPress 3: Leveraging the Shiny New Features
 

10 questions for every developer

  • 1. 10 Questions I Ask Every Developer (and the answers)
  • 2. Interviewed 175+ candidates. Responsible for hiring 45+.
  • 3. I’ve found some amazing people.
  • 4. I’ve also made mistakes. Lots of them.
  • 6. 1. Does the candidate “get” the platform? 2. How much does he/she already know about building on WordPress? 3. Does the candidate think critically about his/her work?
  • 7. There’s not always one right answer. ... But there are better and worse answers. ... And there are some very wrong answers. ... Saying “I’m not familiar with that” is better than making something up.
  • 8. Part 1: Honestly, now, do you “Wordpress”?
  • 9. Question #1 Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them.
  • 10. Question #1 Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them. A killer feature that gets customers addicted. wrong answer
  • 11. Question #1 Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them. A way to extend WordPress. The two types are plug-ins and themes. wrong answer
  • 12. Question #1 Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them. A hook is a technique used to alter or augment the behavior of software.
  • 13. Question #1 Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them. WordPress has “action” hooks and “filter” hooks.
  • 14. Question #1 Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them. Action are hooks that WordPress launches at specific intervals during execution. add_action  (  'hook_name',  'your_function_name',  [priority],  [accepted_args]  );
  • 15. Question #1 Tell me what a “hook” is, and talk about the two basic hooks in WordPress, and the difference between them. Filters are functions that WordPress passes data through, at certain points in execution, just before taking some action with the data. add_filter  (  'hook_name',  'your_filter',  [priority],  [accepted_args]  );
  • 16. Question #2 Explain what a “taxonomy” is.
  • 17. Question #2 Explain what a “taxonomy” is. A way to preserve unused (dead) code. wrong answer
  • 18. Question #2 Explain what a “taxonomy” is. The various types of content in WordPress: posts, pages, media, menus, etc. wrong answer
  • 19. Question #2 Explain what a “taxonomy” is. A taxonomy is a way to group things together.
  • 20. Question #2 Explain what a “taxonomy” is. WordPress posts have two default taxonomies: categories and tags.
  • 21. Question #2 Explain what a “taxonomy” is. Bonus - a couple of lesser known default taxonomies. Link Category Navigation Menu
  • 22. Question #3 Let’s say you see “wp_list_filter()” for the first time. How do you figure out what this does?
  • 23. Question #3 Let’s say you see “wp_list_pluck()” for the first time. How do you figure out what this does? not wrong... but not great
  • 24. Question #3 Let’s say you see “wp_list_pluck()” for the first time. How do you figure out what this does? not wrong... but not great
  • 25. Question #3 Let’s say you see “wp_list_pluck()” for the first time. How do you figure out what this does? It’s open source. I look at the source.
  • 26. Part 2: So... you think you’re good at this.
  • 27. Question #4 Explain what sanitizing and validating data means, and apply that to WordPress.
  • 28. Question #4 Explain what sanitizing and validating data means, and apply that to WordPress. Checking database integrity and ensuring nothing has been corrupted. wrong answer
  • 29. Question #4 Explain what sanitizing and validating data means, and apply that to WordPress. Testing data to make sure it’s what you expected. good layman explanation... tell me more
  • 30. Question #4 Explain what sanitizing and validating data means, and apply that to WordPress. Untrusted data comes from many sources (users, third party sites, your own database!, ...) and all of it needs to be validated both on input and output.
  • 31. Question #4 Explain what sanitizing and validating data means, and apply that to WordPress. WordPress includes a large number of helper functions and methods to ensure that output and input data is safe. HTML Fragments, e.g. wp_kses() Text nodes, e.g. esc_html() Attribute
  • 32. Question #4 Explain what sanitizing and validating data means, and apply that to WordPress. Examples of validation / sanitizing helpers: HTML: wp_kses( $string, $allowed_html, $allowed_protocols ) Text nodes & attributes: esc_html( $text ) URLs: esc_url( $url, (array) $protocols ) Database: wpdb->insert( $table, (array) $data ) Filesystem: validate_file( $filename, (array) $allowed_files )
  • 33. Question #5 Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that?
  • 34. Question #5 Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that? User approach: I would add a new category called “Exclude From Home” for the authors. not bad... but not great
  • 35. Question #5 Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that? User approach: I would add a new custom meta box with an “Exclude from home page” checkbox. good enough answer
  • 36. Question #5 Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that? User approach (bonus points): I would hook into post_submitbox_misc_actions to add a checkbox to the “publish” box with an “Exclude from home” option.
  • 37. Question #5 Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that? Technical approach: Inside the loop, I would write an “if” statement checking my criteria around the post output. very wrong answer
  • 38. Question #5 Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that? Technical approach: I would do a new post query at the top of my home.php template, excluding posts based on my criteria. wrong answer
  • 39. Question #5 Say a client needs to selectively exclude posts from their blog home. Specifically, how would you achieve that? Technical approach: I would use pre_get_posts to hook into the post query, check if the query is for the blog home, and alter the query to exclude posts based on my approach before it executes. function  exclude_category(  $query  )  {        if  (  $query-­‐>is_home()  &&  $query-­‐>is_main_query()  )  {                $query-­‐>set(  'cat',  '-­‐1,-­‐1347'  );        } } add_action(  'pre_get_posts',  'exclude_category'  );
  • 40. Question #6 Tell me about your favorite function in WordPress.
  • 41. Question #6 Tell me about your favorite function / class / API in WordPress. media_sideload_image($file,  $post_id,  $desc); Download an image from the specified URL and attach it to a post.
  • 42. Question #6 Tell me about your favorite function / class / API in WordPress. human_time_diff(  $from,  $to  ); Determines the difference between two timestamps. The difference is returned in a human readable format such as "1 hour", "5 mins", "2 days".
  • 43. Question #6 Tell me about your favorite function / class / API in WordPress. wp_list_pluck(  $list,  $field  ); Pluck a certain field out of each object in a list
  • 44. Question #6 Tell me about your favorite function / class / API in WordPress. _doing_it_wrong(  $function,  $message,  $version  ) Trigger a user error if WP_DEBUG is true. (technically internal only)
  • 45. Question #7 Say you needed to retrieve some data from a remote source once a day. Tell me about some of the WordPress APIs you’d use.
  • 46. Question #7 Say you needed to retrieve some data from a remote source once a day. Tell me about some of the WordPress APIs you’d use. I would use wp_schedule_event() (the WP-Cron APIs) to schedule the daily update. add_action('my_hourly_event',  'do_this_hourly'); function  my_activation()  {   if  (  !wp_next_scheduled(  'my_hourly_event'  )  )  {     wp_schedule_event(  time(),  'hourly',  'my_hourly_event');   } } add_action('wp',  'my_activation'); function  do_this_hourly()  {   //  do  something  every  hour }
  • 47. Question #7 Say you needed to retrieve some data from a remote source once a day. Tell me about some of the WordPress APIs you’d use. I would use wp_remote_post() (part of the WP HTTP API) to remotely fetch the data. $response  =  wp_remote_post(  $url,  array(   'method'  =>  'POST',   'timeout'  =>  45,   'redirection'  =>  5,   'httpversion'  =>  '1.0',   'blocking'  =>  true,   'headers'  =>  array(),   'body'  =>  array(  'username'  =>  'bob',  'password'  =>  '1234xyz'  ),   'cookies'  =>  array()        ) );
  • 48. Question #7 Say you needed to retrieve some data from a remote source once a day. Tell me about some of the WordPress APIs you’d use. Extra credit: I would use the set_transient() (the Transients API) to cache the remote data after processing it. set_transient(  'processed_remote_data',  $processed_data,  60*60*24  );
  • 49. Part 3: So you can code. But can you think?
  • 50. Question #8 Tell me what you the most interesting trend or “thing to watch” in our space is.
  • 51. Question #8 Tell me what you the most interesting trend or “thing to watch” in our space is. Mobile first & the evolution of responsive design. The idea of “progressive enhancement”, and what designing for mobile first really means. Image and advertising challenges in responsive technologies.
  • 52. Question #8 Tell me what you the most interesting trend or “thing to watch” in our space is. HiDPI (“retina”). We still need to solve technical hurdles (e.g. image uploads in WordPress), and at some point this is going to be a major requirements. It seems like Responsive Design circa 2009.
  • 53. Question #8 Tell me what you the most interesting trend or “thing to watch” in our space is. Meaningful social media integration. Really innovative social media integration with content, especially within in e- commerce, is still a relatively new frontier.
  • 54. Question #8 Tell me what you the most interesting trend or “thing to watch” in our space is. Explosion of devices. There are new challenges we haven’t fully wrapped our heads around as we have so many different screen sizes and types emerges, each with - potentially - their own browser quirks.
  • 55. Question #8 Tell me what you the most interesting trend or “thing to watch” in our space is. Typography. Foundries are maturing, @font-face has essentially been universally adopted.
  • 56. Question #9 What frustrates you about WordPress? What’s something that you think needs to change?
  • 57. Question #9 What frustrates you about WordPress? What’s something that you think needs to change? Taxonomy / term architecture could be improved. No term meta data, strange artifacts due to way tags and categories of the same name are linked.
  • 58. Question #9 What frustrates you about WordPress? What’s something that you think needs to change? There are no formal methods to create direct relationships between two content objects (post objects).
  • 59. Question #9 What frustrates you about WordPress? What’s something that you think needs to change? User interface for managing widgets and menus* can be clumsy. Awkward drag and scroll.
  • 60. Question #9 What frustrates you about WordPress? What’s something that you think needs to change? Some areas don’t handle conflicts in plug-in well - for example registering two custom menu items in the same spot.
  • 61. Question #10 Why do you want to work day in and out with WordPress?
  • 62. Question #10 Why do you want to work day in and out with WordPress? “It’s become the dominant CMS on the web. And growing.”
  • 63. Question #10 Why do you want to work day in and out with WordPress? “It’s the only platform where customers don’t call me back in every month asking for a retraining.”
  • 64. Question #10 Why do you want to work day in and out with WordPress? “Because I believe in the freedoms in open source, and WordPress is an awesome open source platform.”
  • 65. Question #10 Why do you want to work day in and out with WordPress? “The community.”
  • 66. 10 Questions I Ask Every Developer @jakemgold • @10up • 10up.com