How to read and write session data?

Assuming you are using WooCommerce (but equivalent to the WC()->cart->is_empty() check can be found for all major well-designed e-commerce plugins): add_action(‘woocommerce_before_checkout_form’,function(){ if (is_user_logged_in()){ $user = wp_get_current_user(); if ( bpprocn_has_incomplete_profile($user->id) ) { // check user’s profile completed or not if ( ! WC()->cart->is_empty() ) { if (wp_redirect(bp_core_get_user_domain( $user->id ) . bp_get_profile_slug() . ‘/edit/group/2’)) exit; } } … Read more

How to stop execution of a function via add_action hook?

The usual way to add an action hook is more like this: // … some other code do_action( ‘my_action’, $post_id ); // …elsewhere add_action( ‘my_action’, ‘wpse405965_function’ ); /** * Function hooked to my_action * * @param int $post_id The post ID. */ function wpse405965_function( $post_id ) { if ( 2 !== $post_id ) { echo … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)