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 wpse27856_set_content_type(){ | |
return "text/html"; | |
} | |
add_filter( 'wp_mail_content_type','wpse27856_set_content_type' ); | |
function myprefix_custom_cron_schedule( $schedules ) | |
{ | |
$schedules['everysecond'] = array( | |
'interval' => 1, // everysecond | |
'display' => __( 'Every second' ), |
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
/** | |
* Get some data in facebook profile | |
*/ | |
$.ajaxSetup( { cache: true } ); | |
$.getScript( '//connect.facebook.net/en_US/sdk.js', function() { | |
FB.init( { | |
appId: '224429194748109', | |
version: 'v2.7' // or v2.1, v2.2, v2.3, ... | |
} ); | |
$( '#link-fb' ).removeClass('disabled'); |
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( $ ) { | |
/** | |
* Script On Document Ready | |
*/ | |
autoHeight( '[selector]' ); | |
/** | |
* Script On Resize | |
*/ | |
$( window ).resize( function() { |
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 | |
/** | |
* Disable Gravity Form Post Creation | |
*/ | |
function disable_post_creation( $is_disabled, $form, $entry ) { | |
return true; | |
} | |
add_filter( 'gform_disable_post_creation', 'disable_post_creation', 10, 3 ); |
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 | |
/* | |
* Enable Hidden Labels in form builder | |
* / | |
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' ); |
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 | |
/** | |
* Include all php inside the folder | |
* @param string $folder folder name | |
* @return void include all the php inside the folder that you enter. | |
*/ | |
if ( ! function_exists( 'include_all_php' ) ) | |
{ | |
function include_all_php( $folder ) | |
{ |
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 | |
/** | |
* Global checker | |
* @param string/array $var the function will check this variable | |
* @return boolean true if not empty, not null, is set, and not equal to ''. | |
*/ | |
if ( ! function_exists( 'checker' ) ) { | |
function checker( $var ) { | |
return ( $var && $var != '' && ! empty( $var ) && ! is_null( $var ) ); | |
} |
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
/* YouTube API */ | |
var tag = document.createElement( 'script' ); | |
tag.src = "//www.youtube.com/iframe_api"; | |
var firstScriptTag = document.getElementsByTagName( 'script' )[0]; | |
firstScriptTag.parentNode.insertBefore( tag, firstScriptTag ); | |
var player; | |
onYouTubeIframeAPIReady = function () { | |
player = new YT.Player( 'player', { |
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
add_filter( 'ajax_query_attachments_args', 'show_users_own_attachments', 1, 1 ); | |
function show_users_own_attachments( $query ) | |
{ | |
global $current_user; | |
if( in_array( 'merchant', $current_user->roles ) ) | |
$query['author'] = $current_user->ID; | |
return $query; | |
} |
OlderNewer