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.

WordPress as an Application Framework

751 views

Published on

This presentation discusses WTF is an Application Framework, and a few ways in which we have used WordPress as an Application Framework.

Published in: Education
  • Be the first to comment

WordPress as an Application Framework

  1. 1. W O R D P R E S S A S A N A P P L I C AT I O N F R A M E W O R K @nathansmonk W O R D C A M P, B I R M I N G H A M 2 0 1 5 www.wearesmile.com
  2. 2. 1. Who am I? 2. "Application framework", WTF? 3. Why WordPress? 4. Examples
  3. 3. Last login: Tue Dec 30 12:06:45 on ttys001 Nathans-Air:nathansmonk$ whoami Name Nathan Monk Twitter @nathansmonk Company SMILE Website http://www.wearesmile.com
  4. 4. SMILE
 www.wearesmile.com
  5. 5. Who creates quotes based on the time it takes to do something?
  6. 6. Who creates quotes based on the time it takes to do something?
  7. 7. Service is hard!
  8. 8. “Websites”
  9. 9. “Websites”
  10. 10. Question: What would you call Facebook? Like as a thing. Errrm, a social network I guess. Why? What about Buzzfeed? You’re stupid I dunno Nath, a website? What’s with all the stupid questions?
  11. 11. Websites are where you consume information
  12. 12. “Web Apps”
  13. 13. Selling time is a tough sell
  14. 14. Selling a web app that already exists, is easier
  15. 15. “What is an 
 Application Framework?”
  16. 16. “... an application framework consists of a software framework used by software developers to implement the standard structure of an application” - Wikipedia
  17. 17. User Management / Template Engine / Error Logging / Localisation / Form & Data Validation / File Uploading & media management / Image manipulation / Session Management / APIs / Hooks / Classes / Plugins / Automated code execution scheduling / Caching
  18. 18. W H Y W O R D P R E S S ? 1. In-house Skills 2. Easy On-boarding 3. Hooks
  19. 19. W H Y W O R D P R E S S ? 1. In-house Skills
 We knew WordPress, so we were able to move quickly without any learning curve.
  20. 20. W H Y W O R D P R E S S ? 1. In-house Skills 2. Easy On-boarding
 Thanks to the GUI, it’s super easy to manage, update and maintain.
  21. 21. W H Y W O R D P R E S S ? 1. In-house Skills 2. Easy On-boarding 3. Hooks
 We’re extending WordPress, then building what doesn’t exist.
  22. 22. W H Y W O R D P R E S S ? <?php wp_mail( $to, $subject, $message, $headers, $attachments ); ?>
  23. 23. W H Y W O R D P R E S S ? function email_approved($ID, $post) { $author = get_userdata( $post->post_author ); $email = $author->user_email; wp_mail($email, 'Thing Approved!', ‘Shut the front door, your thing has been approved!’); }
  24. 24. W H Y W O R D P R E S S ? function email_approved($ID, $post) { $author = get_userdata( $post->post_author ); $email = $author->user_email; wp_mail($email, 'Thing Approved!', ‘Shut the front door, your thing has been approved!’); }
  25. 25. W H Y W O R D P R E S S ? add_action('init', 'custom_user_roles'); function custom_user_roles() { // Let’s set some default perms yo $perms = array( 'delete_posts' => true, 'delete_private_posts' => true, 'delete_published_posts' => true, 'edit_posts' => true, 'edit_pages' => false, 'edit_published_posts' => true, 'publish_posts' => true, 'read' => true, 'read_private_posts' => true, 'upload_files' => true, ‘export' => false ); // Now some additional perms for managers $site_manager_perms = array ( ‘delete_others_posts’ => true, ‘edit_others_posts' => true, 'edit_private_pages' => true, W H Y W O R D P R E S S ?
  26. 26. W H Y W O R D P R E S S ? 'delete_published_posts' => true, 'edit_posts' => true, 'edit_pages' => false, 'edit_published_posts' => true, 'publish_posts' => true, 'read' => true, 'read_private_posts' => true, 'upload_files' => true, ‘export' => false ); // Now some additional perms for managers $site_manager_perms = array ( ‘delete_others_posts’ => true, ‘edit_others_posts' => true, 'edit_private_pages' => true, 'edit_private_posts' => true, ‘create_users' => true, ‘delete_users' => true, ‘list_users' => true, ‘edit_users' => true ); // Now add the roles add_role('employee', 'Employee', $perms ); add_role('manager', 'Manager', $perms + $site_manager_perms ); W H Y W O R D P R E S S ?
  27. 27. W H Y W O R D P R E S S ? <?php get_post_status( $ID ) ?>
  28. 28. W H Y W O R D P R E S S ? H T T P : / / M A I L B U I L D E R A P P. C O M / E D I T O R ? V I E W = 1 8 8 <?php if ( get_post_status ( $_GET['view'] ) == 'draft' || get_post_status ( $_GET['view'] ) == 'declined') { $allowEdit = true; } else { $allowEdit = false; } ?> <?php if($allowEdit): ?> <!-- Do this PLZZZZZZ --> <?php endif; ?> P O S T I D E X P E C T E D
  29. 29. M Y S T O RY
  30. 30. Mailbuilder.
  31. 31. Mailbuilder.
  32. 32. Mailbuilder.
  33. 33. Mailbuilder. - Multisite - User Roles - wp_mail - Custom Statuses - Custom Fields - Custom Post Types
  34. 34. WordPress can be an Application Framework.
  35. 35. Any Questions?
  36. 36. W E ’ R E H I R I N G @ S M I L E U P D AT E

×