This file contains hidden or 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
/** | |
* Save the image on the server. | |
*/ | |
function save_image( $base64_img, $title ) { | |
// Upload dir. | |
$upload_dir = wp_upload_dir(); | |
$upload_path = str_replace( '/', DIRECTORY_SEPARATOR, $upload_dir['path'] ) . DIRECTORY_SEPARATOR; | |
$img = str_replace( 'data:image/jpeg;base64,', '', $base64_img ); |
This file contains hidden or 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_filter( 'bbp_get_reply_author_link', 'my_append_badges_via_filter', 10, 2 ); | |
function my_append_badges_via_filter($author_link = '', $args) { | |
# Needed to get the user ID of the person intended to be displayed. | |
$user_id = bbp_get_reply_author_id( $args['post_id'] ); | |
#Construct your output here. | |
$badge_output = ''; |
This file contains hidden or 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
/* - woo cat toggling elements, injected via jQuery - */ | |
/* make list item be relative, to be able to position toggle within this item, if desired */ | |
#sidebar .widget_product_categories ul.product-categories > li.cat-parent { | |
position: relative; | |
} | |
/* the new toggle element wrapper, which is added via jQuery */ | |
#sidebar .widget_product_categories ul.product-categories > li.cat-parent .woo-cat-toggle { | |
cursor: pointer; | |
display: inline-block; |
This file contains hidden or 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: Custom Fields for WooCommerce | |
* Description: Add custom fields to WooCommerce products | |
* Version: 1.0.0 | |
* Author: Gareth Harris | |
* Author URI: https://pluginrepublic.com/ | |
* Text Domain: cfwc | |
* WC requires at least: 3.4.0 | |
* WC tested up to: 3.4.2 |
This file contains hidden or 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 | |
$host = 'example.com'; | |
$password = 'pass'; | |
$username = 'username'; | |
try { | |
$result = checkFtp($host, $username, $password); | |
} catch(Exception $e) { | |
$result = $e->getMessage(); | |
} |
This file contains hidden or 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
jQuery( document ).ready(function() { | |
String.prototype.filename=function(extension){ | |
var s= this.replace(/\\/g, '/'); | |
s= s.substring(s.lastIndexOf('/')+ 1); | |
return extension? s.replace(/[?#].+$/, ''): s.split('.')[0]; | |
} | |
jQuery("img").each(function () { | |
var alt = jQuery(this).attr('alt'); | |
if(alt === ""){ | |
var namefile = jQuery(this).attr('src').filename(); |
This file contains hidden or 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> | |
<title>Adventskalender</title> | |
<link href='https://fonts.googleapis.com/css?family=Mountains+of+Christmas:400,700' rel='stylesheet' type='text/css'> | |
<link href="style.css" rel="stylesheet" type="text/css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="script.js" type="text/javascript"></script> | |
</head> | |
<body> |
This file contains hidden or 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_filter( 'get_product_search_form' , 'me_custom_product_searchform' ); | |
/** | |
* Filter WooCommerce Search Field | |
* | |
*/ | |
function me_custom_product_searchform( $form ) { |
This file contains hidden or 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
<style> | |
/* customizable snowflake styling */ | |
.snowflake { | |
color: #fff; | |
font-size: 1em; | |
font-family: Arial, sans-serif; | |
text-shadow: 0 0 5px #000; | |
} | |
@-webkit-keyframes snowflakes-fall{0%{top:-10%}100%{top:100%}}@-webkit-keyframes snowflakes-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}50%{-webkit-transform:translateX(80px);transform:translateX(80px)}}@keyframes snowflakes-fall{0%{top:-10%}100%{top:100%}}@keyframes snowflakes-shake{0%,100%{transform:translateX(0)}50%{transform:translateX(80px)}}.snowflake{position:fixed;top:-10%;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default;-webkit-animation-name:snowflakes-fall,snowflakes-shake;-webkit-animation-duration:10s,3s;-webkit-animation-timing-function:linear,ease-in-out;-webkit-animation-iteration-count:infinite,infinite;-webkit-animation-play-state:running,running;animation-name:snowflakes-fall,snowflakes-shake;animation-duration:10s,3s;animation-timing-function:line |