Skip to content

Instantly share code, notes, and snippets.

View samikeijonen's full-sized avatar
🏠
Working from home

Sami Keijonen samikeijonen

🏠
Working from home
View GitHub Profile
@samikeijonen
samikeijonen / edd_license_functions_admin.php
Created December 19, 2012 11:28
EDD license in functions-admin.php
<?php
/*
* Theme Settings
*
* @package Kultalusikka
* @subpackage Template
* @since 0.1.0
*/
/* Theme setting page setup. */
@samikeijonen
samikeijonen / post_in_front_page.php
Created January 3, 2013 09:42
Show posts, mot downloads in front page template.
<?php
/* Show posts, not downloads in front page template. */
add_filter( 'kultalusikka_front_page_download_arguments', 'my_front_page_arguments' );
function my_front_page_arguments( $download_args ) {
$download_args['post_type'] = 'post';
return $download_args;
@samikeijonen
samikeijonen / limit.php
Created March 14, 2013 06:55
Limit the number of license activations permitted based on variable prices
<?php
/*
Plugin Name: Easy Digital Downloads - Variable Pricing License Activation Limits
Plugin URL: http://easydigitaldownloads.com/extension/
Description: Limit the number of license activations permitted based on variable prices
Version: 1.0
Author: Pippin Williamson
Author URI: http://pippinsplugins.com
Contributors: mordauk
*/
@samikeijonen
samikeijonen / path-slider.php
Last active December 19, 2015 22:29
Path theme modified slider page template.
<?php
/**
* Template Name: Slider
*
* Displays sticky posts in slider.
*
* @package Path
* @subpackage Template
* @since 0.1.0
*/
@samikeijonen
samikeijonen / licence-limit.php
Created July 31, 2013 07:10
Add license limit UI for variable prices and show license key limit in [purchase_history] shortcode.
<?php
/**
* Show license key limit in [purchase_history] shortcode.
*
* @since 0.1.0
*/
function edd_site_count_downloads_license_limit_th() {
echo '<th class="edd-site-count-site-count">' . __( 'Site Count', 'edd-site-count' ) . '</th>';
@samikeijonen
samikeijonen / expire_date.php
Created August 4, 2013 08:50
Show expire date in [purchase_history] shortcode.
<?php
/* Show expire date in [purchase_history] table. */
add_action( 'edd_purchase_history_header_after', 'my_edd_stuff_downloads_expire_th', 12 );
add_action( 'edd_purchase_history_row_end', 'my_edd_stuff_downloads_expire_td', 12, 2 );
/**
* Show expire date in [purchase_history] shortcode.
*
* @since 0.1.2
*/
@samikeijonen
samikeijonen / content-wpseo_locations.php
Created September 4, 2013 12:57
WP Seo locations template file.
<article <?php hybrid_post_attributes(); ?>>
<?php if ( is_singular( get_post_type() ) ) { ?>
<header class="entry-header">
<h1 class="entry-title"><?php single_post_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
/**
* Add textarea in theme customizer screen.
*
* @package Webdento
* @subpackage Includes
* @since 0.1.0
*/
/* Load custom control classes. */
@samikeijonen
samikeijonen / address-fields.php
Created November 9, 2013 10:08
How to remove and add own address fields in checkout for EDD.
function edd_paytrail_address_fields() {
$logged_in = is_user_logged_in();
if( $logged_in ) {
$user_address = get_user_meta( get_current_user_id(), '_edd_user_address', true );
}
$line1 = $logged_in && ! empty( $user_address['line1'] ) ? $user_address['line1'] : '';
$city = $logged_in && ! empty( $user_address['city'] ) ? $user_address['city'] : '';
$zip = $logged_in && ! empty( $user_address['zip'] ) ? $user_address['zip'] : '';
<?php
get_header(); // Loads the header.php template. ?>
<?php
if ( is_tax( 'post_format', 'post-format-video' ) ) {
if ( isset( $_GET['video_id'] ) ) {
$video_id = absint( $_GET['video_id'] );
} else {