shortcode_button

The Evolved shortcode button function.

Description

shortcode_button( $atts, (constant) $content = null ); 

Parameters (2)

0. $atts
The atts.
1. $content — Optional. (constant) => null
The content.

Usage

  1. if ( !function_exists( 'shortcode_button' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The atts. 
  5. $atts = null; 
  6.  
  7. // The content. 
  8. $content = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = shortcode_button($atts, $content); 
  12.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function shortcode_button($atts, $content = null) { 
  2. $atts = shortcode_atts( 
  3. array( 
  4. 'color' => 'red',  
  5. 'url' => '#',  
  6. 'size' => '',  
  7. ), $atts); 
  8.  
  9. if($atts['size'] == 'default') { 
  10. $atts['size'] = ''; 
  11.  
  12. return '<a class="button ' . $atts['color'] .' '. $atts['size'] .'" href="' . $atts['url'] . '" >' .do_shortcode($content). '</a>';