This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_is_valid_domain( $url ) { | |
$whitelisted_domains = array( 'mydomain.com', 'mydomain.net' ); | |
$domain = parse_url( $url, PHP_URL_HOST ); | |
// Check if we match the domain exactly | |
if ( in_array( $domain, $whitelisted_domains ) ) | |
return true; | |
$valid = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function va_extended_user_search( $user_query ) | |
{ | |
// Make sure this is only applied to user search | |
if ( $user_query->query_vars['search'] ){ | |
$search = trim( $user_query->query_vars['search'], '*' ); | |
if ( $_REQUEST['s'] == $search ){ | |
global $wpdb; | |
$user_query->query_from .= " JOIN ".$wpdb->prefix ."usermeta MF ON MF.user_id = {$wpdb->users}.ID AND MF.meta_key = 'META_KEY_NAME'"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function load_mc_iris() { | |
if (wp_script_is( 'iris', 'enqueued' )) { | |
return; // if it's already enqueued, don't enqueue it again. | |
} else { // since it's NOT enqueued, let's enqueue it | |
wp_enqueue_script( | |
'iris', //iris.js handle | |
admin_url( 'js/iris.min.js' ), //path to wordpress iris file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function detectBrowserAndVersion() | |
{ | |
var user_agent = navigator.userAgent, user_agent_version, user_agent_match = user_agent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; | |
if(/trident/i.test(user_agent_match[1])) | |
{ | |
user_agent_version = /\brv[ :]+(\d+)/g.exec(user_agent) || []; | |
return 'IE '+(user_agent_version[1] || ''); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$('body').addClass(detectBrowserAndVersion); | |
}); | |
function detectBrowserAndVersion() | |
{ | |
var user_agent = navigator.userAgent, user_agent_version, user_agent_match = user_agent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; | |
if(/trident/i.test(user_agent_match[1])) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
outline: 0 !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_embed_video_html($url) { | |
$embed_link = '[embed]'.$url.'[/embed]'; | |
$embed_link = apply_filters('the_content', $embed_link); | |
$output = ''; | |
$output .= '<div class="responsive-video">'; | |
$output .= $embed_link; | |
$output .= '</div>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_filesize_string($path) | |
{ | |
$bytes = sprintf('%u', filesize($path)); | |
if ($bytes > 0) | |
{ | |
$unit = intval(log($bytes, 1024)); | |
$units = array('B', 'KB', 'MB', 'GB'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function yanco_StringIsNullOrEmpty( $string ) { | |
return ( !isset( $string ) || trim( $string ) === ''); | |
} | |
/** | |
* Advanced Custom Fields Get Image Tag From Image Object | |
* Dependencies: functions/function-common.php | |
* Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gform_upload_root_htaccess_rules', '__return_false' ); | |
?> |