I take advantage of a theme which has a public static operate to show part of a web page like:
trait SomeTrait {
public static operate some_function() {
?>
<div class="some_class">Some content material</div>
<?
}
}
and the helper file appears to be like like:
class Helper {
use SomeTrait;
// ...
}
I must override the operate in my plugin.
Within the plugin I strive the code:
/*
Plugin Identify: MyPlugin
Description: -
Model: 1.0
Writer: -
*/
if ( ! outlined( 'ABSPATH' ) ) exit;
class Further extends Helper {
trait SomeTrait{
operate some_function() {
?>
<div>Check</div>
<?php
}
}
}
However I obtain the deadly error: Class ‘Helper’ not present in …
UPDATE
If I strive:
operate my_function() {
class Further extends Helper {
public static operate some_function() {
?>
<div>Check</div>
<?php
}
}
}
add_action( 'init', 'my_function' ); // with the 'after_theme_setup' the end result is identical
I do not obtain any errors, however my operate does not override the prevailing one