: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace WPForms\Admin\Education;
* Base class for all "addon item" type Education features.
abstract class AddonsItemBase implements EducationInterface {
* Instance of the Education\Core class.
* @var \WPForms\Admin\Education\Core
* Instance of the Education\Addons class.
* @var \WPForms\Admin\Addons\Addons
* Template name for rendering single addon item.
protected $single_addon_template;
* Indicate if current Education feature is allowed to load.
* Should be called from the child feature class.
abstract public function allow_load();
if ( ! $this->allow_load() ) {
// Store the instance of the Education core class.
$this->education = wpforms()->get( 'education' );
// Store the instance of the Education\Addons class.
$this->addons = wpforms()->get( 'addons' );
abstract public function hooks();
* Display single addon item.
* @param array $addon Addon data.
protected function display_single_addon( $addon ) {
* Filter to disallow addons to be displayed in the Education feature.
* @param bool $display Whether to hide the addon.
* @param array $slug Addon data.
$is_disallowed = (bool) apply_filters( 'wpforms_admin_education_addons_item_base_display_single_addon_hide', false, $addon );
if ( empty( $addon ) || $is_disallowed ) {
echo wpforms_render( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$this->single_addon_template,