gde_valid_link

The Google Doc Embedder gde valid link function.

Description

gde_valid_link( $link ); 

Parameters (1)

0. $link
The link.

Usage

  1. if ( !function_exists( 'gde_valid_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/functions.php'; 
  3.  
  4. // The link. 
  5. $link = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gde_valid_link($link); 
  9.  

Defined (1)

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

/functions.php  
  1. function gde_valid_link( $link ) { 
  2.  
  3. $urlregex = '/^(([\w]+:)?\/\/)(([\d\w]|%[a-fA-f\d]{2, 2})+(:([\d\w]|%[a-fA-f\d]{2, 2})+)?@)?([\d\w][-\d\w]{0, 253}[\d\w]\.)+[\w]{2, 4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2, 2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2, 2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2, 2})*)?$/i'; 
  4.  
  5. if ( preg_match( $urlregex, $link ) ) { 
  6. return true; 
  7. } else { 
  8. return false;