Advertisement
urosevic

Test WordPress Shortcode

Apr 7th, 2017
117
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. function test_shortcode_shortcode( $atts, $content = null ) {
  3.     extract( shortcode_atts( array(
  4.         'test' => '1',
  5.     ), $atts ) );
  6.     return sprintf( '<a href="#%1$s" class="button">%1$s</a>', $test );
  7. }
  8. add_shortcode( 'test_shortcode', 'test_shortcode_shortcode' );
Advertisement
RAW Paste Data Copied
Advertisement