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

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.

Mark Wilkinson

June 28, 2014
Tweet

More Decks by Mark Wilkinson

Other Decks in Technology

Transcript

  1. One that can be modified or extended without changing the

    plugin code itself AN EXTENSIBLE PLUGIN is
  2. 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…  
  3. 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' );  
  4. $query = new WP_Query( $query_args ); while( $query->have_posts() ) :

    $query->the_post(); ?> <!-- // post output here --> <?php endwhile;
  5. $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;
  6. $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;
  7. function wpmark_product_wrapper() { echo '<div class="products-wrapper">Something before the loop.</div>'; }

    add_action( 'woocommerce_before_shop_loop', 'wpmark_product_wrapper’ );