WC_Admin_Setup_Wizard::display_recommended_item
Deprecated since 4.6.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Display recommended item.
Method of the class: WC_Admin_Setup_Wizard{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->display_recommended_item( $item_info );
- $item_info(array) (required)
- Item info array.
Changelog
| Deprecated since | 4.6.0 |
WC_Admin_Setup_Wizard::display_recommended_item() WC Admin Setup Wizard::display recommended item code WC 10.6.2
<?php
protected function display_recommended_item( $item_info ) {
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
$type = $item_info['type'];
$title = $item_info['title'];
$description = $item_info['description'];
$img_url = $item_info['img_url'];
$img_alt = $item_info['img_alt'];
?>
<li class="recommended-item checkbox">
<input
id="<?php echo esc_attr( 'wc_recommended_' . $type ); ?>"
type="checkbox"
name="<?php echo esc_attr( 'setup_' . $type ); ?>"
value="yes"
checked
data-plugins="<?php echo wc_esc_json( wp_json_encode( isset( $item_info['plugins'] ) ? $item_info['plugins'] : null ) ); ?>"
/>
<label for="<?php echo esc_attr( 'wc_recommended_' . $type ); ?>">
<img
src="<?php echo esc_url( $img_url ); ?>"
class="<?php echo esc_attr( 'recommended-item-icon-' . $type ); ?> recommended-item-icon"
alt="<?php echo esc_attr( $img_alt ); ?>" />
<div class="recommended-item-description-container">
<h3><?php echo esc_html( $title ); ?></h3>
<p><?php echo wp_kses( $description, array(
'a' => array(
'href' => array(),
'target' => array(),
'rel' => array(),
),
'em' => array(),
) ); ?></p>
</div>
</label>
</li>
<?php
}