gde_valid_link
The Google Doc Embedder gde valid link function.
Description
gde_valid_link( $link );
Parameters (1)
- 0. $link
- The link.
Usage
if ( !function_exists( 'gde_valid_link' ) ) { require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/functions.php'; } // The link. $link = null; // NOTICE! Understand what this does before running. $result = gde_valid_link($link);
Defined (1)
The function is defined in the following location(s).
- /functions.php
- function gde_valid_link( $link ) {
- $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';
- if ( preg_match( $urlregex, $link ) ) {
- return true;
- } else {
- return false;
- }
- }