SO YOU WANT TO
BUILD AND RELEASE
A PLUGIN…

Ryan Duff
WordCamp Lancaster 2014
ABOUT ME
•

Long time WordPress user

•

Plugin Developer

•

Meetup Organizer
A BIT OF PLUGIN
HISTORY
my-hacks.php
VERSION 1.2
(May 22, 2004)
Plugin API
THINGS TO
CONSIDER
YOUR CODE
FILTERS
apply_filters( $tag, $value, $var ... )

http://codex.wordpress.org/Function_Reference/apply_filters
EXAMPLE
$query_args = array(
'post_type' => 'books',
'posts_per_page' => 5,
'author' => 3
);
$books = new WP_Query( apply_...
ACTIONS
do_action( $tag, $arg_a, $arg_b, $etc );

http://codex.wordpress.org/Function_Reference/do_action
EXAMPLE
do_action( 'wclanc_books_before' );
echo '<div class="wclanc_books">';
while( $books->have_posts() ) : $books->the...
INTERNATIONALIZATION
EXAMPLE
/*
* Plugin Name: i18n Test
* Author: Ryan Duff
* Text Domain: wclanc-i18n
*/
$text = __( ‘This is a test', ‘wclan...
PLUGIN SETTINGS
http://themeoptions.wordpress.com/
OTHER CONSIDERATIONS
•

Code style

•

Documentation

•

Errors
PLUGIN LICENSE
COMMON LICENSES
•

GPL v2/v3

•

MIT (X11)

•

Apache License v2

•

WTFPL v2
1) http://wordpress.org/plugins/about/
2) ht...
PLUGIN HOSTING
•

WordPress.org

•

GitHub

•

Both?
QUESTIONS?
RYAN DUFF
RYAN@FUSIONIZED.COM
@RYANCDUFF
Upcoming SlideShare
Loading in...5
×

So You Want to Build and Release a Plugin? WordCamp Lancaster 2014

517

Published on

My talk from WordCamp Lancaster 2014. Things to implement when preparing a plugin for public release.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
517
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

So You Want to Build and Release a Plugin? WordCamp Lancaster 2014

  1. 1. SO YOU WANT TO BUILD AND RELEASE A PLUGIN… Ryan Duff WordCamp Lancaster 2014
  2. 2. ABOUT ME • Long time WordPress user • Plugin Developer • Meetup Organizer
  3. 3. A BIT OF PLUGIN HISTORY
  4. 4. my-hacks.php
  5. 5. VERSION 1.2 (May 22, 2004)
  6. 6. Plugin API
  7. 7. THINGS TO CONSIDER
  8. 8. YOUR CODE
  9. 9. FILTERS
  10. 10. apply_filters( $tag, $value, $var ... ) http://codex.wordpress.org/Function_Reference/apply_filters
  11. 11. EXAMPLE $query_args = array( 'post_type' => 'books', 'posts_per_page' => 5, 'author' => 3 ); $books = new WP_Query( apply_filters( 'wclanc_books_query', $query_args ) );
  12. 12. ACTIONS
  13. 13. do_action( $tag, $arg_a, $arg_b, $etc ); http://codex.wordpress.org/Function_Reference/do_action
  14. 14. EXAMPLE do_action( 'wclanc_books_before' ); echo '<div class="wclanc_books">'; while( $books->have_posts() ) : $books->the_post() echo '<div class="wclanc_book">'; do_action( 'wclanc_before_book_title', get_the_ID() ); echo '<h3 class="wclanc_book_title">' . get_the_title() . '</h3>'; do_action( 'wclanc_after_book_title', get_the_ID() ); echo '</div>'; endwhile; echo '</div>'; do_action( 'wclanc_books_after' );
  15. 15. INTERNATIONALIZATION
  16. 16. EXAMPLE /* * Plugin Name: i18n Test * Author: Ryan Duff * Text Domain: wclanc-i18n */ $text = __( ‘This is a test', ‘wclanc-i18n' ); _e( ‘This test will echo', ‘wclanc-i18n' ); https://codex.wordpress.org/I18n_for_WordPress_Developers
  17. 17. PLUGIN SETTINGS http://themeoptions.wordpress.com/
  18. 18. OTHER CONSIDERATIONS • Code style • Documentation • Errors
  19. 19. PLUGIN LICENSE
  20. 20. COMMON LICENSES • GPL v2/v3 • MIT (X11) • Apache License v2 • WTFPL v2 1) http://wordpress.org/plugins/about/ 2) http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses
  21. 21. PLUGIN HOSTING
  22. 22. • WordPress.org • GitHub • Both?
  23. 23. QUESTIONS?
  24. 24. RYAN DUFF RYAN@FUSIONIZED.COM @RYANCDUFF
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×