本文整理汇总了PHP中charitable_get_permalink函数的典型用法代码示例。如果您正苦于以下问题:PHP charitable_get_permalink函数的具体用法?PHP charitable_get_permalink怎么用?PHP charitable_get_permalink使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了charitable_get_permalink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* The callback method for the campaigns shortcode.
*
* This receives the user-defined attributes and passes the logic off to the class.
*
* @param array $atts User-defined shortcode attributes.
* @return string
* @access public
* @static
* @since 1.0.0
*/
public static function display($atts = array())
{
$defaults = array('logged_in_message' => __('You are already logged in!', 'charitable'), 'redirect' => esc_url(charitable_get_login_redirect_url()), 'registration_link_text' => __('Register', 'charitable'));
$args = shortcode_atts($defaults, $atts, 'charitable_login');
$args['login_form_args'] = self::get_login_form_args($args);
if (is_user_logged_in()) {
ob_start();
charitable_template('shortcodes/logged-in.php', $args);
return ob_get_clean();
}
if (false == $args['registration_link_text'] || 'false' == $args['registration_link_text']) {
$args['registration_link'] = false;
} else {
$registration_link = charitable_get_permalink('registration_page');
if (charitable_get_permalink('login_page') === $registration_link) {
$args['registration_link'] = false;
} else {
if (isset($_GET['redirect_to'])) {
$registration_link = add_query_arg('redirect_to', $_GET['redirect_to'], $registration_link);
}
$args['registration_link'] = $registration_link;
}
}
ob_start();
charitable_template('shortcodes/login.php', $args);
return apply_filters('charitable_login_shortcode', ob_get_clean());
}
示例2: charitable_get_current_campaign
* @version 1.0.0
*/
/**
* @var Charitable_Campaign
*/
$campaign = charitable_get_current_campaign();
/**
* This will be the value from the post_status column,
* or, if the campaign is published, 'active' or 'finished'.
*
* @var string
*/
$status = $campaign->get_status();
?>
<div class="charitable-ambassadors-campaign-creator-toolbar">
<div class="layout-wrapper">
<span class="campaign-status"><?php
printf(_x('Status: %s', 'status for campaign', 'reach'), '<span class="status status-' . esc_attr($status) . '">' . ucwords($status) . '</span>');
?>
</span>
<a href="<?php
echo esc_url(charitable_get_permalink('campaign_editing_page'));
?>
" class="edit-link">
<?php
_e('Edit campaign', 'reach');
?>
</a>
</div><!-- .layout-wrapper -->
</div><!-- .charitable-ambassadors-campaign-creator-toolbar -->
示例3: maybe_redirect_to_charitable_login
/**
* Redirect the user to the Charitable login page.
*
* @return void
* @access public
* @since 1.4.0
*/
public function maybe_redirect_to_charitable_login()
{
if (!apply_filters('charitable_disable_wp_login', false)) {
return;
}
if ('wp' == charitable_get_option('login_page', 'wp')) {
return;
}
/* Don't prevent logging out. */
if ($_SERVER['REQUEST_METHOD'] != 'GET') {
return;
}
wp_safe_redirect(esc_url_raw(charitable_get_permalink('login_page')));
exit;
}
示例4: reach_author_edit_profile_link
/**
* Display a link to edit your profile when you are logged in and viewing your author profile.
*
* @param int $author_id
* @return string
* @since 1.0.0
*/
function reach_author_edit_profile_link($author_id)
{
if (!reach_has_charitable()) {
return '';
}
if (get_current_user_id() != $author_id) {
return '';
}
$profile_page = charitable_get_permalink('profile_page');
if (!$profile_page) {
return '';
}
return sprintf('<a href="%s" title="%s" class="button">%s</a>', esc_url($profile_page), esc_attr__('Edit your profile', 'reach'), __('Edit Profile', 'reach'));
}
示例5: get_error_url
public function get_error_url()
{
$cancel_url = charitable_get_permalink('donation_cancel_page', array('donation_id' => $this->donation_id));
if (!$cancel_url) {
$cancel_url = esc_url_raw(add_query_arg(array('donation_id' => $this->donation_id, 'cancel' => true), wp_get_referer()));
}
return $cancel_url;
}
示例6: esc_url
<?php
/**
* Account links
*
* @package Reach
*/
if (!reach_has_charitable()) {
return;
}
$profile_page = esc_url(charitable_get_permalink('profile_page'));
$submit_page = esc_url(charitable_get_permalink('campaign_submission_page'));
$login_page = esc_url(charitable_get_permalink('login_page'));
?>
<div class="account-links">
<?php
if ($submit_page) {
?>
<a class="user-campaign button with-icon button-alt button-small" href="<?php
echo $submit_page;
?>
" data-icon=""><?php
_e('Create a campaign', 'reach');
?>
</a>
<?php
}
?>
示例7: mysql2date
?>
<tr>
<td><?php
echo mysql2date('F j, Y', get_post_field('post_date', $donation->ID));
?>
</td>
<td><?php
echo $donation->campaigns;
?>
</td>
<td><?php
echo charitable_format_money($donation->amount);
?>
</td>
<td><a href="<?php
echo esc_attr(charitable_get_permalink('donation_receipt_page', array('donation_id' => $donation->ID)));
?>
"><?php
_e('View Receipt', 'charitable');
?>
</a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
/**
示例8: process_donation
/**
* Process the donation with PayPal.
*
* @param int $donation_id
* @param Charitable_Donation_Processor $processor
* @return void
* @access public
* @static
* @since 1.0.0
*/
public static function process_donation($donation_id, $processor)
{
$gateway = new Charitable_Gateway_Paypal();
$user_data = $processor->get_donation_data_value('user');
$donation = new Charitable_Donation($donation_id);
$transaction_mode = $gateway->get_value('transaction_mode');
$paypal_args = apply_filters('charitable_paypal_redirect_args', array('business' => $gateway->get_value('paypal_email'), 'email' => $user_data['email'], 'first_name' => $user_data['first_name'], 'last_name' => $user_data['last_name'], 'address1' => $user_data['address'], 'address2' => $user_data['address_2'], 'city' => $user_data['city'], 'country' => $user_data['country'], 'zip' => $user_data['postcode'], 'invoice' => $processor->get_donation_data_value('donation_key'), 'amount' => $donation->get_total_donation_amount(), 'item_name' => html_entity_decode($donation->get_campaigns_donated_to(), ENT_COMPAT, 'UTF-8'), 'no_shipping' => '1', 'shipping' => '0', 'no_note' => '1', 'currency_code' => charitable_get_currency(), 'charset' => get_bloginfo('charset'), 'custom' => $donation_id, 'rm' => '2', 'return' => charitable_get_permalink('donation_receipt_page', array('donation_id' => $donation_id)), 'cancel_return' => home_url(), 'notify_url' => $processor->get_ipn_url(self::ID), 'cbt' => get_bloginfo('name'), 'bn' => 'Charitable_SP', 'cmd' => $transaction_mode == 'donations' ? '_donations' : '_xclick'), $donation_id, $processor);
/**
* Set up the PayPal redirect URL
*/
$paypal_redirect = trailingslashit($gateway->get_redirect_url()) . '?';
$paypal_redirect .= http_build_query($paypal_args);
$paypal_redirect = str_replace('&', '&', $paypal_redirect);
/**
* Redirect to PayPal
*/
wp_redirect($paypal_redirect);
exit;
}
示例9: redirect_url
/**
* Payment redirect URL filter.
*
* @param string $url
* @param Pronamic_WP_Pay_Payment $payment
* @return string
*/
public static function redirect_url($url, $payment)
{
$donation_id = $payment->get_source_id();
$donation = new Charitable_Donation($donation_id);
$url = self::get_return_url($donation);
switch ($payment->get_status()) {
case Pronamic_WP_Pay_Statuses::SUCCESS:
$url = charitable_get_permalink('donation_receipt_page', array('donation_id' => $donation_id));
break;
}
return $url;
}
示例10: reset_password
/**
* Reset the password.
*
* @return bool|WP_Error True: when finish. WP_Error on error
* @access public
* @static
* @since 1.4.0
*/
public static function reset_password()
{
$form = new Charitable_Reset_Password_Form();
if (!$form->validate_nonce() || !$form->validate_honeypot()) {
charitable_get_notices()->add_error(__('There was an error with processing your form submission. Please reload the page and try again.', 'charitable'));
return;
}
/* The key and login must be set. */
if (!isset($_POST['key']) || !isset($_POST['login'])) {
charitable_get_notices()->add_error('<strong>ERROR:</strong> Invalid reset key.', 'charitable');
return;
}
$user = check_password_reset_key($_POST['key'], $_POST['login']);
if (is_wp_error($user)) {
charitable_get_notices()->add_errors_from_wp_error($user);
return;
}
/* One of the passwords was not set. */
if (!isset($_POST['pass1']) || !isset($_POST['pass2'])) {
charitable_get_notices()->add_error('<strong>ERROR:</strong> You must enter both passwords.', 'charitable');
return;
}
/* The passwords do not match. */
if ($_POST['pass1'] != $_POST['pass2']) {
charitable_get_notices()->add_error(__('<strong>ERROR:</strong> The two passwords you entered don\'t match.', 'charitable'));
return;
}
/* Parameter checks OK, reset password */
reset_password($user, $_POST['pass1']);
charitable_get_notices()->add_success(__('Your password was successfully changed.', 'charitable'));
charitable_get_session()->add_notices();
wp_safe_redirect(charitable_get_permalink('login_page'));
exit;
}
示例11: esc_url
?>
<p>
<?php
if (array_key_exists('registration_link', $view_args) && $view_args['registration_link']) {
?>
<a href="<?php
echo esc_url($view_args['registration_link']);
?>
"><?php
echo $view_args['registration_link_text'];
?>
</a> |
<?php
}
?>
<a href="<?php
echo esc_url(charitable_get_permalink('forgot_password_page'));
?>
"><?php
_e('Forgot Password', 'charitable');
?>
</a>
</p>
<?php
/**
* @hook charitable_login_form_after
*/
do_action('charitable_login_form_after');
?>
</div>
示例12: ed_redirect_logged_out_campaign_form_to_registration
/**
* By default, users are redirected to the login page if they try to access
* the campaign form without being logged in.
*
* This example shows how to change the redirection to the registration page.
*
* NOTE: The redirection back to the campaign form will not work correctly on
* versions of Charitable prior to 1.4.2.
*
* @param string $redirect_url
* @return string
*/
function ed_redirect_logged_out_campaign_form_to_registration($redirect_url)
{
$url = charitable_get_permalink('registration_page');
$url = add_query_arg(array('redirect_to' => charitable_get_permalink('campaign_submission_page')), $url);
return $url;
}
示例13: get_redirection_after_gateway_processing
/**
* Return the URL that the donor should be redirected to.
*
* @param mixed $gateway_processing
* @param int $donation_id
* @return string
* @access private
* @since 1.3.0
*/
private function get_redirection_after_gateway_processing($gateway_processing)
{
if (false == $gateway_processing) {
$redirect_url = esc_url(add_query_arg(array('donation_id' => $this->donation_id), wp_get_referer()));
} elseif (is_array($gateway_processing) && isset($gateway_processing['redirect'])) {
$redirect_url = $gateway_processing['redirect'];
} else {
/* Fall back to returning the donation receipt URL. */
$redirect_url = charitable_get_permalink('donation_receipt_page', array('donation_id' => $this->donation_id));
}
return $redirect_url;
}
示例14: charitable_get_login_redirect_url
/**
* Returns the URL to which the user should be redirected after signing on or registering an account.
*
* @return string
* @since 1.0.0
*/
function charitable_get_login_redirect_url()
{
if (isset($_REQUEST['redirect_to'])) {
$redirect = $_REQUEST['redirect_to'];
} elseif (charitable_get_permalink('profile_page')) {
$redirect = charitable_get_permalink('profile_page');
} else {
$redirect = home_url();
}
return apply_filters('charitable_signon_redirect_url', $redirect);
}
示例15: get_login_link
/**
* Return the link to the login page, or false if we are not going to display it.
*
* @return false|string
* @access public
* @since 1.4.2
*/
public function get_login_link()
{
if (false == $this->shortcode_args['login_link_text'] || 'false' == $this->shortcode_args['login_link_text']) {
return false;
}
$login_link = charitable_get_permalink('login_page');
if (charitable_get_permalink('registration_page') === $login_link) {
return false;
}
if (isset($_GET['redirect_to'])) {
$login_link = add_query_arg('redirect_to', $_GET['redirect_to'], $login_link);
}
return sprintf('<a href="%1$s" title="%2$s">%3$s</a>', esc_url($login_link), esc_attr($this->shortcode_args['login_link_text']), $this->shortcode_args['login_link_text']);
}