Easy Extensible Plugins

Easy Extensible Plugins

Extensible plugins are often the ones the WordPress community consider to be the best as they take advantage of the WordPress license and allow developers to build on and edit them.

In this talk I will outline some of the methods which can be used to make your plugins extensible, allowing others to edit and build upon them.

31af50af29856a3e6734bdae0a0d68cf?s=128

Mark Wilkinson

June 28, 2014
Tweet

Transcript

  1. 4.
  2. 8.

    One that can be modified or extended without changing the

    plugin code itself AN EXTENSIBLE PLUGIN is
  3. 9.
  4. 13.
  5. 17.
  6. 19.
  7. 21.

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus malesuada

    sem at sapien rutrum, eu…   Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus malesuada sem at sapien rutrum, eu…  
  8. 23.

    function wpmark_twitter( $content ) { /* get the twitter url

    from site options */ $url = get_option( ‘twitter_url' ); $content = '<a href="' . esc_url( $url ) . '">@' . basename( $url ) . '</a>'; return $content; } add_filter( 'latest_tweets_render_before', ’wpmark_twitter' );  
  9. 28.

    $query = new WP_Query( $query_args ); while( $query->have_posts() ) :

    $query->the_post(); ?> <!-- // post output here --> <?php endwhile;
  10. 29.

    $query = new WP_Query( $query_args ); while( $query->have_posts() ) :

    $query->the_post(); do_action( ‘wpmark_before_post’, get_the_ID() ); ?> <!-- // post output here --> <?php endwhile;
  11. 30.

    $query = new WP_Query( $query_args ); while( $query->have_posts() ) :

    $query->the_post(); do_action( ‘wpmark_before_post’, get_the_ID() ); ?> <!-- // post output here --> <?php do_action( ‘wpmark_after_post’, get_the_ID() ); endwhile;
  12. 31.
  13. 32.
  14. 35.
  15. 36.

    function wpmark_product_wrapper() { echo '<div class="products-wrapper">Something before the loop.</div>'; }

    add_action( 'woocommerce_before_shop_loop', 'wpmark_product_wrapper’ );
  16. 40.