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 | |
/** | |
Re-use some existing WordPress functions so you don't have to write a bunch of raw PHP to check for SSL, port numbers, etc | |
Place in your functions.php (or re-use in a plugin) | |
If you absolutely don't need or want any query string, use home_url(add_query_arg(array(),$wp->request)); | |
Hat tip to: | |
+ http://kovshenin.com/2012/current-url-in-wordpress/ |
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 | |
/* | |
* Replace-uploads.php | |
* This replaces all accents from your uploads | |
* you can run this with wp-cli: $ wp eval-file replace-uploads.php | |
*/ | |
/** | |
* cd to right path before changes | |
*/ |
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( d ) { | |
// Create a copy of this date object | |
var target = new Date(d.valueOf()); | |
// ISO week date weeks start on monday | |
// so correct the day number | |
var dayNr = (d.getDay() + 6) % 7; | |
// Set the target to the thursday of this week so the |
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 | |
/** | |
* Changes strings referencing Featured Images for a post type | |
* | |
* In this example, the post type in the filter name is "employee" | |
* and the new reference in the labels is "headshot". | |
* | |
* @see https://developer.wordpress.org/reference/hooks/post_type_labels_post_type/ | |
* | |
* @param object $labels Current post type labels |
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: PayPal Sandbox IPN Tester | |
* Description: Pings the IPN endpoint to see if your server can connect. Just head to <a href="/?ipn-test=1">yoursite.com/?ipn-test=1</a> whilst logged in as admin. | |
* Version: 1.0.0 | |
* Author: WooThemes | |
* Requires at least: 4.1 | |
* Tested up to: 4.3 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { |
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: WooCommerce Composite Products - WPML Cart Error Fix | |
* Plugin URI: http://www.woothemes.com/products/composite-products/ | |
* Description: If you are using WPML with WooCommerce Multilingual, WooCommerce & Composite Products and get an error when attempting to add a Composite to your cart, this snippet might fix the issue. | |
* Version: 1.1 | |
* Author: Manos Psychogyiopoulos | |
* Author URI: http://www.somewherewarm.net/ | |
* | |
* Requires at least: 3.8 |
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
@mixin box-shadow($top, $left, $blur, $color, $inset: false) { | |
@if $inset { | |
-webkit-box-shadow:inset $top $left $blur $color; | |
-moz-box-shadow:inset $top $left $blur $color; | |
box-shadow:inset $top $left $blur $color; | |
} @else { | |
-webkit-box-shadow: $top $left $blur $color; | |
-moz-box-shadow: $top $left $blur $color; | |
box-shadow: $top $left $blur $color; | |
} |
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
@-webkit-keyframes bgcolor { 0% { background-color: #ffccf2; } | |
50% { background-color: #ccffcc; } | |
100% { background-color: #ccffff; } } | |
@-moz-keyframes bgcolor { 0% { background-color: #ffccf2; } | |
50% { background-color: #ccffcc; } | |
100% { background-color: #ccffff; } } | |
@-ms-keyframes bgcolor { 0% { background-color: #ffccf2; } | |
50% { background-color: #ccffcc; } |
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 (!isset($_GET['url'])) { | |
?> | |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Youtube RSS creator</title> | |
<form> | |
<p>Create an RSS feed for the videos on the following page: | |
<p><input name="url" placeholder="E.g. https://www.youtube.com/user/scishow/videos" style="width: 30em"> |