Storefront support rewritten

parent 98d086fb
...@@ -21,46 +21,32 @@ ...@@ -21,46 +21,32 @@
namespace wp_SexHackMe; namespace wp_SexHackMe;
if(!class_exists('StorefrontMoveHeaderCart')) { // Exit if accessed directly
class StorefrontMoveHeaderCart if ( ! defined( 'ABSPATH' ) ) exit;
if(!class_exists('SH_StoreFront')) {
class SH_StoreFront
{ {
public function __construct() public static function init()
{ {
sexhack_log('StorefrontMoveHeaderCart() Instanced'); // Remove the cart and the product search
add_action( 'init', array($this, 'remove_header_cart' )); remove_action( 'storefront_header', 'storefront_header_cart', 60 );
remove_action( 'storefront_header', 'storefront_product_search', 40);
// Remove StoreFront credits
add_filter('storefront_credit_link', false); 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);
}
public function disclaimer() // 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?
<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() // Re add the cart in the right position
{ add_action( 'storefront_header', 'storefront_header_cart', 40);
remove_action( 'storefront_header', 'storefront_header_cart', 60 );
remove_action( 'storefront_header', 'storefront_product_search', 40); }
}
public function add_header_cart()
{
storefront_header_cart();
}
} }
} }
$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()) ...@@ -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='') function sh_hls_player($video_url, $posters='')
{ {
......
...@@ -229,6 +229,10 @@ if(!class_exists('SexHackMe_Plugin')) { ...@@ -229,6 +229,10 @@ if(!class_exists('SexHackMe_Plugin')) {
if( file_exists( SH_PLUGIN_DIR_PATH . 'includes/class-livecam-site-support.php') ) 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'; 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 */ /* Shortcodes */
if( file_exists( SH_PLUGIN_DIR_PATH . 'includes/class-shortcodes.php' ) ) if( file_exists( SH_PLUGIN_DIR_PATH . 'includes/class-shortcodes.php' ) )
include_once 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')) { ...@@ -298,6 +302,9 @@ if(!class_exists('SexHackMe_Plugin')) {
add_action( 'init', array( 'wp_SexHackMe\SH_Shortcodes', 'init' ) ); add_action( 'init', array( 'wp_SexHackMe\SH_Shortcodes', 'init' ) );
//add_action( 'init', array( $this, 'init_dependencies' ), 1 ); //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.). //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 ); 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