Skip to content

Instantly share code, notes, and snippets.

@thadallender
Last active August 25, 2016 04:35
Show Gist options
  • Save thadallender/b6db016cd6917f21f05dc948f92e1784 to your computer and use it in GitHub Desktop.
Save thadallender/b6db016cd6917f21f05dc948f92e1784 to your computer and use it in GitHub Desktop.
Show a link to checkout below the buy button for Sell Media
<?php
/**
* Plugin Name: Sell Media Below Buy Button
* Plugin URI: http://graphpaperpress.com/plugins/sell-media/
* Description: An example below button code plugin for Sell Media.
* Version: 1.0
* Author: Graph Paper Press
* Author URI: http://graphpaperpress.com
* Author Email: support@graphpaperpress.com
* Text Domain: sell_media
* Domain Path: languages
* License: GPL2
*
* Copyright 2015 GRAPH PAPER PRESS (email: support@graphpaperpress.com)
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License or license.txt for more details.
*
* @package SellMedia
* @category Core
* @author Thad Allender
* @version 1.0
*/
function my_sell_media_below_buy_button( $post_id ) {
$settings = sell_media_get_plugin_options();
$checkout_page = $settings->checkout_page;
echo '<a href="' . esc_url( get_permalink( $checkout_page ) . '">' . __( 'Check Out Now', 'sell_media' ) . '</a>';
}
add_action( 'sell_media_below_buy_button', 'my_sell_media_below_buy_button', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment