Storefront support rewritten

parent 98d086fb
......@@ -21,46 +21,32 @@
namespace wp_SexHackMe;
if(!class_exists('StorefrontMoveHeaderCart')) {
class StorefrontMoveHeaderCart
{
public function __construct()
{
sexhack_log('StorefrontMoveHeaderCart() Instanced');
add_action( 'init', array($this, 'remove_header_cart' ));
add_filter('storefront_credit_link', false);
//add_action('storefront_footer', array($this, 'disclaimer')); // XXX I don't like positioning this way. Fix in CSS or sobstitute footer theme file?
add_action( 'storefront_header', array($this, 'add_header_cart'), 40);
}
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
public function disclaimer()
{ ?>
<div class="site-info">
All pictures and videos are property of the respective models. Please copy them for personal use but do not republish any without permission.
</div>
<?php
}
public function remove_header_cart()
if(!class_exists('SH_StoreFront')) {
class SH_StoreFront
{
public static function init()
{
// Remove the cart and the product search
remove_action( 'storefront_header', 'storefront_header_cart', 60 );
remove_action( 'storefront_header', 'storefront_product_search', 40);
}
public function add_header_cart()
{
storefront_header_cart();
}
}
}
// Remove StoreFront credits
add_filter('storefront_credit_link', false);
// add footer disclaimer
//add_action('storefront_footer', 'wp_SexHackMe\sh_get_disclaimer')); // XXX I don't like positioning this way. Fix in CSS or sobstitute footer theme file?
// Re add the cart in the right position
add_action( 'storefront_header', 'storefront_header_cart', 40);
}
}
}
$SEXHACK_SECTION = array(
'class' => 'StorefrontMoveHeaderCart',
'description' => 'Move storefront header cart and remove find products and credits',
'name' => 'sexhackme_sf_headercart'
);
?>
......@@ -48,7 +48,10 @@ function sh_get_template($tmpl, $args=array())
}
function sh_disclaimer()
{
echo sh_get_template("blocks/disclaimer.php");
}
function sh_hls_player($video_url, $posters='')
{
......
......@@ -229,6 +229,10 @@ if(!class_exists('SexHackMe_Plugin')) {
if( file_exists( SH_PLUGIN_DIR_PATH . 'includes/class-livecam-site-support.php') )
include_once SH_PLUGIN_DIR_PATH . 'includes/class-livecam-site-support.php';
/* Storefront customization support */
if( file_exists( SH_PLUGIN_DIR_PATH . 'includes/class-storefront.php') )
include_once SH_PLUGIN_DIR_PATH . 'includes/class-storefront.php';
/* Shortcodes */
if( file_exists( SH_PLUGIN_DIR_PATH . 'includes/class-shortcodes.php' ) )
include_once SH_PLUGIN_DIR_PATH . 'includes/class-shortcodes.php';
......@@ -298,6 +302,9 @@ if(!class_exists('SexHackMe_Plugin')) {
add_action( 'init', array( 'wp_SexHackMe\SH_Shortcodes', 'init' ) );
//add_action( 'init', array( $this, 'init_dependencies' ), 1 );
// Initialize storefront fixes/personalizations
add_action( 'init', array( 'wp_SexHackMe\SH_StoreFront', 'init' ) );
//Show row meta on the plugin screen (used to add links like Documentation, Support etc.).
add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment