wpcf7_link

The Contact Form 7 wpcf7 link function.

Description

wpcf7_link( $url, $anchor_text, (string) $args = '' ); 

Parameters (3)

0. $url
The url.
1. $anchor_text
The anchor text.
2. $args — Optional. (string) => ''
The args.

Usage

  1. if ( !function_exists( 'wpcf7_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/includes/functions.php'; 
  3.  
  4. // The url. 
  5. $url = null; 
  6.  
  7. // The anchor text. 
  8. $anchor_text = null; 
  9.  
  10. // The args. 
  11. $args = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = wpcf7_link($url, $anchor_text, $args); 
  15.  

Defined (1)

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

/includes/functions.php  
  1. function wpcf7_link( $url, $anchor_text, $args = '' ) { 
  2. $defaults = array( 
  3. 'id' => '',  
  4. 'class' => '',  
  5. ); 
  6.  
  7. $args = wp_parse_args( $args, $defaults ); 
  8. $args = array_intersect_key( $args, $defaults ); 
  9. $atts = wpcf7_format_atts( $args ); 
  10.  
  11. $link = sprintf( '<a href="%1$s"%3$s>%2$s</a>',  
  12. esc_url( $url ),  
  13. esc_html( $anchor_text ),  
  14. $atts ? ( ' ' . $atts ) : '' ); 
  15.  
  16. return $link;