! is_admin() is triggered on dashboard page
-
I recently updated to latest version of WooCommerce 3.5.7 and whenever I use the function ! is_admin() on admin init. it is still triggered on backend. It doesn’t happen on old version like 3.4.5
Sample code below. The update_option is still triggered when I’m in the dashboard, whereas it should only be triggered on front-end.
add_action( 'init', 'theme_sample_init' ); function theme_sample_init() { $test_value = get_option( 'test_value' ); var_dump( $test_value ); if( ! is_admin() ) { update_option( 'test_value', 'dashboard is triggered' ); } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘! is_admin() is triggered on dashboard page’ is closed to new replies.