'yes', 'get_help_url' => '#', 'get_help_label' => __( 'GET HELP', 'aa-condition' ), 'show_give_back' => 'yes', 'give_back_url' => '#', 'give_back_label' => __( 'GIVE BACK', 'aa-condition' ), 'button_target_blank' => 'no', 'button_class' => 'button-medium', 'show_login_msg' => 'yes', 'login_url' => wp_login_url(), 'register_url' => wp_registration_url(), ), $atts, 'aa_condition_button' ); $target = ( strtolower( $atts['button_target_blank'] ) === 'yes' ) ? ' target="_blank" rel="noopener noreferrer"' : ''; ob_start(); if ( is_user_logged_in() && strtolower( $atts['show_get_help'] ) === 'yes' ) { ?>

>

>

Log in or Register below.', 'aa-condition' ), esc_url( $atts['login_url'] ), esc_url( $atts['register_url'] ) ) ); ?>

'yes', 'get_help_url' => '#', 'get_help_label' => __( 'GET HELP', 'aa-condition' ), 'show_give_back' => 'yes', 'give_back_url' => '#', 'give_back_label' => __( 'GIVE BACK', 'aa-condition' ), 'button_target_blank' => 'no', 'button_class' => 'button-medium', 'show_login_msg' => 'yes', 'login_url' => wp_login_url(), 'register_url' => wp_registration_url(), ); $input = $defaults; $message = ''; // Check if form submitted if ( isset( $_POST['aa_condition_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['aa_condition_nonce'] ) ), 'aa_condition_save' ) ) { foreach ( $defaults as $key => $default ) { if ( isset( $_POST[ $key ] ) ) { $input[ $key ] = sanitize_text_field( wp_unslash( $_POST[ $key ] ) ); } } $message = __( 'Shortcode generated successfully.', 'aa-condition' ); } elseif ( isset( $_POST['aa_condition_nonce'] ) ) { $message = __( 'Security check failed. Please try again.', 'aa-condition' ); } // Premium check $is_premium = AA_CONDITION_PREMIUM; // Disable premium fields if not premium $disabled_attr = $is_premium ? '' : 'disabled'; // Build shortcode string $shortcode = '[aa_condition_button'; foreach ( $input as $key => $value ) { // Always include URLs and labels, others only if changed from default if ( in_array( $key, array( 'get_help_url', 'get_help_label', 'give_back_url', 'give_back_label', 'login_url', 'register_url' ), true ) || strtolower( $value ) !== strtolower( $defaults[ $key ] ) ) { $shortcode .= sprintf( ' %1$s="%2$s"', esc_attr( $key ), esc_attr( $value ) ); } } $shortcode .= ']'; ?>

[aa_condition_button show_get_help="yes" get_help_url="https://yourhelpurl.com" get_help_label="Help Now" show_give_back="no"]