Exemple #1
0
/**
 * Login Shortcode.
 *
 * Shows a login form allowing users to users to log in. This function simply
 * calls the give_login_form function to display the login form.
 *
 * @since 1.0
 *
 * @param array  $atts     Shortcode attributes
 * @param string $content
 *
 * @uses  give_login_form()
 * @return string
 */
function give_login_form_shortcode($atts, $content = null)
{
    $atts = shortcode_atts(array('redirect' => '', 'login-redirect' => '', 'logout-redirect' => ''), $atts, 'give_login');
    // Check login-redirect attribute first, if it empty or not found then check for redirect attribute and add value of this to login-redirect attribute.
    $atts['login-redirect'] = !empty($atts['login-redirect']) ? $atts['login-redirect'] : (!empty($atts['redirect']) ? $atts['redirect'] : '');
    return give_login_form($atts['login-redirect'], $atts['logout-redirect']);
}
 /**
  * Test that the login form shortcode returns the expected string.
  */
 public function test_login_form()
 {
     $this->assertContains('<legend>Log into Your Account</legend>', give_login_form());
 }
			<?php 
    do_action('give_profile_editor_after_password');
    ?>

			<p id="give_profile_submit_wrap">
				<input type="hidden" name="give_profile_editor_nonce" value="<?php 
    echo wp_create_nonce('give-profile-editor-nonce');
    ?>
" />
				<input type="hidden" name="give_action" value="edit_user_profile" />
				<input type="hidden" name="give_redirect" value="<?php 
    echo esc_url(give_get_current_page_url());
    ?>
" />
				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php 
    _e('Save Changes', 'give');
    ?>
" />
			</p>
		</fieldset>
	</form><!-- #give_profile_editor_form -->

	<?php 
    do_action('give_profile_editor_after');
    ?>

<?php 
} else {
    echo __('You need to login to edit your profile.', 'give');
    echo give_login_form();
}
Exemple #4
0
/**
 * Login Shortcode
 *
 * Shows a login form allowing users to users to log in. This function simply
 * calls the give_login_form function to display the login form.
 *
 * @since 1.0
 *
 * @param array  $atts Shortcode attributes
 * @param string $content
 *
 * @uses  give_login_form()
 * @return string
 */
function give_login_form_shortcode($atts, $content = null)
{
    extract(shortcode_atts(array('redirect' => ''), $atts, 'give_login'));
    return give_login_form($redirect);
}
Exemple #5
0
/**
 * Login Shortcode
 *
 * Shows a login form allowing users to users to log in. This function simply
 * calls the give_login_form function to display the login form.
 *
 * @since 1.0
 *
 * @param array $atts Shortcode attributes
 * @param string $content
 *
 * @uses  give_login_form()
 * @return string
 */
function give_login_form_shortcode($atts, $content = null)
{
    $atts = shortcode_atts(array('redirect' => ''), $atts, 'give_login');
    return give_login_form($atts['redirect']);
}