Automattic\WooCommerce\Admin\Notes
LearnMoreAboutVariableProducts::maybe_add_new_note() public WC 1.0
Maybe attempt to add a new note if product is published.
{} Это метод класса: LearnMoreAboutVariableProducts{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$LearnMoreAboutVariableProducts = new LearnMoreAboutVariableProducts(); $LearnMoreAboutVariableProducts->maybe_add_new_note( $new_status, $old_status, $post );
- $new_status(строка) (обязательный)
- new status.
- $old_status(строка) (обязательный)
- old status.
- $post(объект) (обязательный)
- post object.
Код LearnMoreAboutVariableProducts::maybe_add_new_note() LearnMoreAboutVariableProducts::maybe add new note WC 5.2.2
public function maybe_add_new_note( $new_status, $old_status, $post ) {
if ( 'publish' === $new_status && 'publish' !== $old_status && 'product' === $post->post_type ) {
$product = wc_get_product( $post->ID );
if ( ! $product ) {
return;
}
$product->is_type( 'simple' ) && static::possibly_add_note();
}
}