First, Lets find out what version of PHP we're running (To find out if it's the default version).
To do that, Within the terminal, Fire this command:
which php
<?php | |
add_filter( 'wpmu_signup_user_notification', 'dk_wpmu_signup_user_notification', 10, 4 ); | |
/** | |
* Problem: WordPress MultiSite sends user signup mails from the main site. This is a problem when using domain mapping functionality as the sender is not the same domain as expected when creating a new user from a blog with another domain. | |
* Solution: Change the default user notification mail from using the main network admin_email and site_name to the blog admin_email & blogname | |
* | |
* @author Daan Kortenbach | |
* @link http://daankortenbach.nl/wordpress/filter-wpmu_signup_user_notification/ | |
*/ | |
function dk_wpmu_signup_user_notification($user, $user_email, $key, $meta = '') { |
<?php | |
/* Modify the output of list items in the header navigation menu. | |
* | |
* Remove the whitespace between HTML tags. Required specifically for better | |
* behavior when list items are inline-block in our main nav menu and need | |
* the browsers to adhere to exact margins. | |
* | |
* NOTE: filter name changes depending on your menu - this one works for 'navigation_items' | |
*/ |
<?php | |
// filter the Gravity Forms button type | |
add_filter("gform_submit_button", "form_submit_button", 10, 2); | |
function form_submit_button($button, $form){ | |
// The following line is from the Gravity Forms documentation - it doesn't include your custom button text | |
// return "<button class='button' id='gform_submit_button_{$form["id"]}'>'Submit'</button>"; | |
// This includes your custom button text: | |
return "<button class='button' id='gform_submit_button_{$form["id"]}'>{$form['button']['text']}</button>"; | |
} | |
// Oops this strips important stuff |
/** | |
* Stop an iframe or HTML5 <video> from playing | |
* @param {Element} element The element that contains the video | |
*/ | |
var stopVideo = function ( element ) { | |
var iframe = element.querySelector( 'iframe'); | |
var video = element.querySelector( 'video' ); | |
if ( iframe ) { | |
var iframeSrc = iframe.src; | |
iframe.src = iframeSrc; |
<?php | |
/** | |
* Customise WordPress Vimeo oEmbed | |
* https://developer.vimeo.com/apis/oembed | |
*/ | |
function my_oembed_fetch_url( $provider, $url, $args ) { | |
if ( strpos( $provider, 'vimeo.com' ) !== false) { |
<?php | |
/** | |
* Quick hack to preview WooCommerce e-mails. | |
* Based on drrobotnik's answer from Stack Overflow: http://stackoverflow.com/a/27072101/186136 | |
* | |
* Add this to <yourtheme>/functions.php and then visit a url like: | |
* http://<site_url>/wp-admin/admin-ajax.php?action=previewemail | |
* | |
* @return null | |
*/ |
// Add on element with overflow | |
-webkit-mask-image: -webkit-radial-gradient(white, black); |
$wp_customize->add_setting( 'themeslug_media_setting_id', array( | |
'sanitize_callback' => 'absint', | |
'validate_callback' => 'themeslug_validate_image, | |
) ); | |
$wp_customize->add_control( | |
new WP_Customize_Media_Control( $wp_customize, 'themeslug_media_setting_id', array( | |
'label' => __( 'Custom Core Media Setting' ), | |
'section' => 'custom_section', // Add a default or your own section | |
'mime_type' => 'image', |