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 | |
/** | |
* Gets Gravity Forms via form title. | |
* | |
* @access public | |
* @param string $title (default: null) - Form title to search for | |
* @param bool $return_form (default: false) - Return form object or form ID | |
* @return array - Array of form IDs or form objects (based on $return_form value) | |
*/ |
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_action('admin_init', function () { | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ($pagenow === 'edit-comments.php') { | |
wp_redirect(admin_url()); | |
exit; | |
} |
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
Adyen Test Card Numbers | |
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform. | |
For all cards use the following expiration and CVV2/CVC2/or CID for Amex. | |
For all cards: | |
Expiration Dates CVV2 / CVC3 CID (American Express) | |
08/2018 OR 10/2020 737 7373 |
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
//Parse the GA Cookie | |
function gaParseCookie() { | |
if (isset($_COOKIE['_ga'])) { | |
list($version, $domainDepth, $cid1, $cid2) = explode('.', $_COOKIE["_ga"], 4); | |
$contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1 . '.' . $cid2); | |
$cid = $contents['cid']; | |
} else { | |
$cid = gaGenerateUUID(); | |
} | |
return $cid; |
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 | |
//* Do NOT include the opening php tag | |
//* Activate the use of Dashicons | |
add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' ); | |
function load_dashicons_front_end() { | |
wp_enqueue_style( 'dashicons' ); | |
} | |
//* Enqueue scripts for Responsive menu |
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 | |
// Source: http://goo.gl/qyLFbg | |
$html = '<img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />'; | |
preg_match( '@src="([^"]+)"@' , $html, $match ); | |
$src = array_pop($match); | |
// will return /images/image.jpg |
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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress | |
# Bare Minimum Git | |
# http://ironco.de/bare-minimum-git/ | |
# ver 20150227 | |
# | |
# This file is tailored for a WordPress project | |
# using the default directory structure | |
# | |
# This file specifies intentionally untracked files to ignore |
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 | |
/** | |
* Plugin Name: Gravity Forms - Notification Extras | |
* Author: Richard Wawrzyniak | |
* Description: Adds new settings to Gravity Forms Notifications enabling file uploads to be attached to notifications and the notification format to be changed to text. | |
* Version: 1.0 | |
* | |
* Last Modified: 17/10/2014 | |
* Updated attach_file() to allow for possibility that uploads folder was changed | |
* Added suppot for post_image fields |
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_page_by_template( $template ){ | |
$page = get_posts(array( | |
'post_type' => 'page', | |
'meta_query' => array( | |
array( | |
'key' => '_wp_page_template', | |
'value' => $template, | |
'compare' => '=', | |
), |
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 | |
// If you can edit pages, you can edit widgets | |
add_filter( 'user_has_cap', | |
function( $caps ) { | |
if ( ! empty( $caps['edit_pages'] ) ) | |
$caps['edit_theme_options'] = true; | |
return $caps; | |
} ); |