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 | |
/** | |
* Get the attachment absolute path from its url | |
* | |
* @param string $url the attachment url to get its absolute path | |
* | |
* @return bool|string It returns the absolute path of an attachment | |
*/ | |
function attachment_url_to_path( $url ) |
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
/** | |
* Filter the cart template path to use our cart.php template instead of the theme's | |
*/ | |
function csp_locate_template( $template, $template_name, $template_path ) { | |
$basename = basename( $template ); | |
if( $basename == 'cart.php' ) { | |
$template = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'templates/cart.php'; | |
} | |
return $template; | |
} |
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
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.6.0/slick.css"/> | |
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.6.0/slick-theme.css"/> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.0.min.js"></script> | |
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js"></script> | |
<style> | |
#s { | |
border: solid 1px red; | |
width: 640px; |
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
/** | |
* Prevent update notification for plugin | |
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/ | |
* Place in theme functions.php or at bottom of wp-config.php | |
*/ | |
function disable_plugin_updates( $value ) { | |
if ( isset($value) && is_object($value) ) { | |
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) { | |
unset( $value->response['plugin-folder/plugin.php'] ); | |
} |
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
Validator::extend('slug', function($attribute, $value, $parameters, $validator) { | |
return preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/', $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
.rounded-corners-gradient-borders { | |
width: 300px; | |
height: 80px; | |
border: double 4px transparent; | |
border-radius: 80px; | |
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff); | |
background-origin: border-box; | |
background-clip: padding-box, border-box; | |
} |
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
[ | |
{ | |
"id": 1, | |
"name": "Adana", | |
"latitude": "37.0000", | |
"longitude": "35.3213", | |
"population": 2183167, | |
"region": "Akdeniz" | |
}, | |
{ |
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 get this to work, you need to tinker with the acf/settings/ filter and reset the default language | |
* so that the get_field() function returns the correct results even when not on the default language. | |
* | |
* You can add the filter before you call the get_field() function and then call it again with the current | |
* language to reset it again, so it will affect other pages. | |
* | |
* answer courtesy of James of ACF Support | |
*/ |
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
Afghanistan | |
Albania | |
Algeria | |
Andorra | |
Angola | |
Antigua & Deps | |
Argentina | |
Armenia | |
Australia | |
Austria |
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
/////////////////////////////////////////////////////////// | |
// Plain SASS Trigonometry Algorithm in Taylor Expansion // | |
// // | |
// Based on // | |
// http://japborst.net/posts/sass-sines-and-cosines // | |
/////////////////////////////////////////////////////////// | |
$pi: 3.14159265359; | |
$_precision: 10; |
NewerOlder