This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpdesk_info_notice_for_administrator() { | |
$user = wp_get current_user(); | |
if ( in_array( 'administrator', $user->roles ) ) { | |
?> | |
<div class="notice notice-info"> | |
<p>Info notice for administrator.</p> | |
</div> | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpdesk_info_notice() { | |
?> | |
<div class="notice notice-info"> | |
<p>Info notice.</p> | |
</div> | |
<?php | |
} | |
add_action( 'admin_notices', 'wpdesk_info_notice' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="notice notice-success is-dismissible"> | |
<p>Success notice.</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="notice notice-error"> | |
<p>Error notice.</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="notice notice-warning"> | |
<p>Warning notice.</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="notice notice-info"> | |
<p>Info notice.</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="notice notice-success"> | |
<p>Success notice.</p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpdesk_info_notice() { | |
?> | |
<div class="notice notice-info"> | |
<p>Info notice.</p> | |
</div> | |
<?php | |
} | |
add_action( 'admin_notices', 'wpdesk_info_notice' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'pmxi_saved_post', 'wpdesk_pmxi_saved_post_trigger_set_stock' ); | |
/** | |
* Trigger set stock for product. | |
* | |
* @param int $post_id Post id. | |
*/ | |
function wpdesk_pmxi_saved_post_trigger_set_stock( $post_id ) { | |
if ( function_exists( 'wc_get_product' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_order_status_completed', 'test_woocommerce_order_status_completed'); | |
function test_woocommerce_order_status_completed( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
$order->add_order_note( print_r( debug_backtrace(), true ) ); | |
$order->save(); | |
} |