Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction To WordPress Plugin Development

Introduction To WordPress Plugin Development

WordPress Mumbai Meetup

C50127bc268f96d5ffa72f47d72bf799?s=128

Ajit Bohra

May 06, 2017
Tweet

Transcript

  1. WordPress Mumbai

  2. Introduction To Plugin Development

  3. EXPECTATIONS & TAKEAWAYS

  4. PLUGINS

  5. Why Plugins ?

  6. Types Of Plugins ?

  7. Types Of Plugins ? Functionality Enhancement Site Specific Plugin

  8. Plugin vs Theme Territory !

  9. LICENSING

  10. Why its important?

  11. Why its important ? Permissions Conditions Limitations

  12. Resources

  13. Resources https://choosealicense.com/licenses/

  14. Resources https://opensource.org/licenses

  15. Resources https://en.wikipedia.org/wiki/Comparison_of_free_and_open-source_software_licenses

  16. DEVELOPMENT ENVIRONMENT

  17. Development Stack

  18. WAMP XAMPP MAMP Varying Vagrant Vagrants

  19. Code Editor

  20. SublimeText Atom Brackets NotePad++ TextWrangler

  21. Source Control

  22. Local Git GitHub GitLab

  23. RESOURCES

  24. Developer Handbook https://developer.wordpress.org/plugins/

  25. WordPress TV http://wordpress.tv/?s=plugin

  26. Developer Reference https://developer.wordpress.org/reference/

  27. Generate WP http://generatewp.com

  28. Patterns https://github.com/0aveRyan/patterns

  29. Custom Meta Boxes https://github.com/humanmade/Custom-Meta-Boxes

  30. GETTING STARTED

  31. Procedural? Oops? Boilerplate?

  32. Plan & Move Accordingly

  33. BASIC PLUGIN

  34. Basic Structure my-plugin my-plugin.php readme.txt license.txt

  35. Plugin Header

  36. Plugin Header my-plugin.php

  37. Hooks Activation Deactivation Uninstall

  38. Hooks Activation/Deactivation/Uninstall

  39. BEST PRACTICES

  40. File Organization

  41. Follow WordPress Design

  42. Coding Standards

  43. Avoid Naming Collisions

  44. o Prefix everything o Check for Existing Implementations o Variables:

    isset() (includes arrays, objects, etc.) o Functions: function_exists() o Classes: class_exists() o Constants: defined()
  45. Conditional Loading

  46. Plugin Architecture

  47. Boilerplate Starting Points

  48. Components Of Plugin Development

  49. SECURITY

  50. Checking User Capabilities

  51. Data Validation

  52. Securing Input & Output

  53. Nonces

  54. HOOKS

  55. What are hooks ?

  56. Types Of Hooks

  57. Action Filter

  58. Custom Hooks

  59. Why Custom Hooks?

  60. ADMIN MENU

  61. Top Level Menu

  62. Sub Menu

  63. SHORTCODES

  64. Why Shortcodes?

  65. Default Shortcodes

  66. [caption] – shortcode that allows you to wrap captions around

    content [gallery] – shortcode that allows you to show image galleries [audio] – shortcode that allows you to embed and play audio files [video] – shortcode that allows you to embed and play video files [playlist] – shortcode that allows you to display collection of audio or video files [embed] – shortcode that allows you to wrap embedded items
  67. Basic Shortcodes [wporg] is your new shortcode. The use of

    the shortcode will trigger the wporg_shortcode callback function.
  68. Enclosing Shortcodes [wporg]content to manipulate[/wporg]

  69. Shortcodes With Parameters [wporg title="WordPress.org"]content to manipulate[/wporg]

  70. SETTINGS

  71. Settings

  72. Settings API

  73. Options API

  74. Why we need settings API?

  75. METADATA

  76. What is Metadata?

  77. Managing MetaData add_post_meta() update_post_meta() delete_post_meta() get_post_meta()

  78. Meta Boxes

  79. Custom Meta Boxes

  80. CUSTOM POSTTYPES

  81. What is posttype?

  82. Default PostTypes Post Page Attachment Revision Menu

  83. What is custom posttypes?

  84. Custom PostType

  85. TAXANOMIES

  86. What is Taxonomy?

  87. Default Taxonomies

  88. Custom Taxonomies

  89. WORDPRESS.ORG

  90. Hosting not source control

  91. Important things to consider

  92. readme.txt

  93. Readme.txt > WordPress.org

  94. Plugin Submission https://wordpress.org/plugins/developers/add/

  95. What next ?

  96. Advanced Topics ACL (Access Control List) HTTP API WP Cron

    Internationalisation & Localisation
  97. Thank You