Co delam spatne? Snazim se predelat to jakym zpusobem se zobrazuje WooCommerce 'my-account' stranka. Mam vlastni Class, ktera se prokazatelne inicializuje, pridam do constructoru 'add_acction' ale to co mam definovane v te funkci pro tento konstruktor uz se mi nezobrazi…
/**
* @path functions.php
*/
// Modify Avada WooCommerce
if ( class_exists( 'Woocommerce' ) ) {
include_once 'include/planx-woocommerce.class.php';
global $planx_woocommerce;
$planx_woocommerce = new Planx_Woocommerce();
}
<?php
/**
* Modifications for WooCommerce.
*
* @author crs1138
* @link http://planxdesign.eu
* @package Avada-Child
* @subpackage Avada
* @path include/planx-woocommerce.class.php
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
die;
}
/**
* Class to apply woocommerce templates.
*
* @since 1.0.0
*/
class Planx_Woocommerce {
/**
* Constructor
*
* @access public
*/
public function __construct() {
add_action( 'woocommerce_account_dashboard', array( $this, 'planx_account_dashboard' ), 4 );
}
/**
* Rewrite Acount Dashboard
*
* @access public
*/
public function planx_account_dashboard() {
echo "<h1>planXdesign Account Dashboard</h1>";
}
}