Skip to content

Instantly share code, notes, and snippets.

<?php
/*
* Resize images dynamically using wp built in functions
* Based on the script by Victor Teixeira
* - Updated to use wp_get_image_editor()
* - Moves resized files to uploadpath/resized/
* Joe Swann
*
* php 5.2+
*
@nikolov-tmw
nikolov-tmw / shipping-awd.php
Created March 13, 2014 23:31
AWD Weight/Country WooCommerce add-on plugin fix. Props to @PozHonks(http://wordpress.org/support/profile/pozhonks) - just keeping the code safe here.
<?php
/**
* Plugin Name: AWD Weight/Country Shipping
* Plugin URI: http://www.andyswebdesign.ie/blog/free-woocommerce-weight-and-country-based-shipping-extension-plugin/
* Description: Unofficial update for WooCommerce 2.1. Weight and Country based shipping method for Woocommerce.
* Version: 1.0.2b
* Author: Andy_P
/* Copyright 2012 andyswebdesign.ie
This program is free software; you can redistribute it and/or modify
@nikolov-tmw
nikolov-tmw / README
Last active August 29, 2015 13:56
Switchable Content WordPress plugin
This is a simple plugin that allows you to create "switchable" content blocks.
A "switchable" block is a block of content that can be placed inside of a post/page/widget via a shortcode and be turned on/off globally from a single page in the admin.
After activating the plugin, just go to "Switchable Contents > Add New" and enter your title and content(the title is generally used for organizational purposes only).
The content of each block is wrapped in <div class="switchable-content switchable-content-visible">, but if you want to customize the output, simply copy the "switchable-content-template.php" file in your theme's root directory and do any changes there.
You can easily have a default message that will be displayed when a block is disabled, or you can add some text before/after the content. You have no limitations in how to use the template :)
@nikolov-tmw
nikolov-tmw / gsmg-media.php
Created February 16, 2014 12:17
Extension to the Google XML Sitemaps plugin(version 4.0+) that lists all media attachments in the sitemap
<?php
/*
Plugin Name: Google XML Sitemaps - Media support
Description: This plugin will display all of your media in the automatically generated sitemap created by the Google XML Sitemaps plugin v 4.0+
Version: 1
Author: Nikola Nikolov
Author URI: http://paiyakdev.com/
*/
if ( ! defined( 'ABSPATH' ) ) {
@nikolov-tmw
nikolov-tmw / projects-restriction.php
Created February 4, 2014 12:25
Simple plugin that requires users to be logged-in to see any posts from a "projects" custom post type.
<?php
/**
* Plugin Name: Project Access Control
* Description: When a post of post type "project" is displayed and the current user is not logged-in, they are redirected to the login form.
* Version: 1
* Author: nikolov.tmw
* Author URI: http://paiyakdev.com/
* License: GPL2
*/
/*