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 | |
// Valid values: development, staging and production. To get this value use: wp_get_environment_type() | |
defined( 'WP_ENVIRONMENT_TYPE' ) or define( 'WP_ENVIRONMENT_TYPE', 'production' ); | |
define('DB_NAME', 'fill in db name'); | |
define('DB_USER', 'fill in username'); | |
define('DB_PASSWORD', 'fill in db password'); | |
define('DB_HOST', 'localhost'); |
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 classname .choicless-message to field in GF Admin | |
$('.choiceless-message').each(function() { | |
let $el = $(this) | |
let inputsWithChoice = $el.find('input').length | |
let inputsWithChoiceDisabled = $el.find('input:disabled').length | |
let waitlistHref = $el.data('waitlistHref') || '#' | |
if (inputsWithChoice === inputsWithChoiceDisabled) { | |
$('<div />').addClass('alert alert-warning').html('<p class="mb-0">There are no more open slots available<br /> <a href=".waitlistHref.">Join the waitlist</a></p>').appendTo($el) | |
} |
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 replace_vc_gitem_post_image_background($output){ | |
// Get the URL to replace in string background-image: url('https://yoursite.com/wp-content/plugins/js_composer/assets/vc/vc_gitem_image.png') !important; | |
$url = get_site_url(null, '/wp-content/plugins/js_composer/assets/vc/vc_gitem_image.png'); | |
// Full http(s) path to image | |
$new_url = 'full-uri-to-new-image.ext'; // 1024x1024 image | |
// String Replace | |
$new_output = str_replace($url, $new_url, $output); | |
// Return new string | |
return $new_output; | |
} |
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 the_date_range($args) { | |
global $post; | |
$default = array( | |
'start_field' => 'start_date', | |
'end_field' => null, | |
'base_format' => 'Ymd', | |
'post_id' => $post->ID, | |
'separator' => '<span class="date-separator">–</span>', | |
'month_format' => 'F', |
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 | |
// This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker | |
// somewhere in your theme. | |
?> | |
<header class="banner navbar navbar-default navbar-static-top" role="banner"> | |
<div class="container"> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse"> | |
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span> |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com', 'http://www.new-domain.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.old-domain.com', 'http://www.new-domain.com'); |
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 $to = '[email protected]'; $subject = 'Test email using PHP'; $message = 'This is a test email message'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers, '[email protected]'); |
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 THEMENAME_wrap_gumby_intrinsic($html, $url, $args){ | |
$provider = ''; | |
if (preg_match("#https?://youtu\.be/.*#i", $url) || preg_match("#https?://(www\.)?youtube\.com/watch.*#i", $url)) { | |
$provider = 'youtube'; | |
}elseif (preg_match("/vimeo.com\/([^&]+)/i", $url)) { | |
$provider = 'vimeo'; | |
} | |
//no oEmbed for Twich :< | |
//elseif (preg_match("/https?:\/\/(.*twitch\.tv\/.*|.*twitch\.tv\/.*\/b\/.*)/i", $url)){ | |
//$provider = 'twitch'; |
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
$('.modal').on(Gumby.click, function(e){ | |
var container = $('.content'); | |
if((!container.is(e.target) // if the target of the click isn't the container... | |
&& container.has(e.target).length === 0)) // ... nor a descendant of the container | |
{ | |
$('.modal .close').trigger('gumby.trigger'); | |
} | |
}); |
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
# node -v | |
v0.11.7 | |
# claymate build | |
/root/.nvm/v0.11.7/lib/node_modules/claymate/node_modules/uglify-js/lib/parse.js:53 | |
KEYWORDS = makePredicate(KEYWORDS); | |
^ | |
util.debug: Use console.error instead | |
DEBUG: ERROR in file: /root/.nvm/v0.11.7/lib/node_modules/claymate/node_modules/uglify-js/lib/parse.js / ReferenceError: KEYWORDS is not defined |
NewerOlder