当前位置: 首页>>代码示例>>PHP>>正文


PHP give_get_option函数代码示例

本文整理汇总了PHP中give_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP give_get_option函数的具体用法?PHP give_get_option怎么用?PHP give_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了give_get_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: give_single_forms_cmb2_metaboxes

/**
 * Define the metabox and field configurations.
 *
 * @param  array $meta_boxes
 *
 * @return array
 */
function give_single_forms_cmb2_metaboxes(array $meta_boxes)
{
    $post_id = give_get_admin_post_id();
    $price = give_get_form_price($post_id);
    $goal = give_get_form_goal($post_id);
    $variable_pricing = give_has_variable_prices($post_id);
    $prices = give_get_variable_prices($post_id);
    //No empty prices - min. 1.00 for new forms
    if (empty($price)) {
        $price = esc_attr(give_format_amount('1.00'));
    }
    // Start with an underscore to hide fields from custom fields list
    $prefix = '_give_';
    /**
     * Repeatable Field Groups
     */
    $meta_boxes['form_field_options'] = apply_filters('give_forms_field_options', array('id' => 'form_field_options', 'title' => __('Donation Options', 'give'), 'object_types' => array('give_forms'), 'context' => 'normal', 'priority' => 'high', 'fields' => apply_filters('give_forms_donation_form_metabox_fields', array(array('name' => __('Donation Option', 'give'), 'description' => __('Would you like this form to have one set donation price or multiple levels (for example, $10 silver, $20 gold, $50 platinum)?', 'give'), 'id' => $prefix . 'price_option', 'type' => 'radio_inline', 'default' => 'set', 'options' => apply_filters('give_forms_price_options', array('set' => __('Set Donation', 'give'), 'multi' => __('Multi-level Donation', 'give')))), array('name' => __('Set Donation', 'give'), 'description' => __('This is the set donation amount for this form.', 'give'), 'id' => $prefix . 'set_price', 'type' => 'text_small', 'row_classes' => 'give-subfield', 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', 'attributes' => array('placeholder' => give_format_amount('1.00'), 'value' => $price, 'class' => 'cmb-type-text-small give-money-field')), array('id' => $prefix . 'levels_header', 'type' => 'levels_repeater_header'), array('id' => $prefix . 'donation_levels', 'type' => 'group', 'row_classes' => 'give-subfield', 'options' => array('add_button' => __('Add Level', 'give'), 'remove_button' => __('<span class="dashicons dashicons-no"></span>', 'give'), 'sortable' => true), 'fields' => apply_filters('give_donation_levels_table_row', array(array('name' => __('ID', 'give'), 'id' => $prefix . 'id', 'type' => 'levels_id'), array('name' => __('Amount', 'give'), 'id' => $prefix . 'amount', 'type' => 'text_small', 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol  give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol  give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', 'attributes' => array('placeholder' => give_format_amount('1.00'), 'class' => 'cmb-type-text-small give-money-field'), 'before' => 'give_format_admin_multilevel_amount'), array('name' => __('Text', 'give'), 'id' => $prefix . 'text', 'type' => 'text', 'attributes' => array('placeholder' => __('Donation Level', 'give'), 'rows' => 3)), array('name' => __('Default', 'give'), 'id' => $prefix . 'default', 'type' => 'give_default_radio_inline')))), array('name' => __('Display Style', 'give'), 'description' => __('Set how the donations levels will display on the form.', 'give'), 'id' => $prefix . 'display_style', 'type' => 'radio_inline', 'default' => 'buttons', 'options' => array('buttons' => __('Buttons', 'give'), 'radios' => __('Radios', 'give'), 'dropdown' => __('Dropdown', 'give'))), array('name' => __('Custom Amount', 'give'), 'description' => __('Do you want the user to be able to input their own donation amount?', 'give'), 'id' => $prefix . 'custom_amount', 'type' => 'radio_inline', 'default' => 'no', 'options' => array('yes' => __('Yes', 'give'), 'no' => __('No', 'give'))), array('name' => __('Custom Amount Text', 'give'), 'description' => __('This text appears as a label next to the custom amount field for single level forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option). Add your own message or leave this field blank to prevent it from displaying within your form.', 'give'), 'id' => $prefix . 'custom_amount_text', 'type' => 'text', 'row_classes' => 'give-subfield', 'attributes' => array('rows' => 3, 'placeholder' => __('Give a Custom Amount', 'give'))), array('name' => __('Set Goal?', 'give'), 'description' => __('Do you want to set a donation goal for this form?', 'give'), 'id' => $prefix . 'goal_option', 'type' => 'radio_inline', 'default' => 'no', 'options' => array('yes' => __('Yes', 'give'), 'no' => __('No', 'give'))), array('name' => __('Set Goal', 'give'), 'description' => __('This is the goal you want to achieve for this form.', 'give'), 'id' => $prefix . 'set_goal', 'type' => 'text_small', 'row_classes' => 'give-subfield', 'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '', 'after_field' => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '', 'attributes' => array('placeholder' => give_format_amount('0.00'), 'value' => isset($goal) ? esc_attr(give_format_amount($goal)) : '', 'class' => 'cmb-type-text-small give-money-field')), array('name' => __('Goal Progress Bar Color', 'give'), 'id' => $prefix . 'goal_color', 'type' => 'colorpicker', 'row_classes' => 'give-subfield', 'default' => '#2bc253')))));
    /**
     * Content Field
     */
    $meta_boxes['form_content_options'] = apply_filters('give_forms_content_options', array('id' => 'form_content_options', 'title' => __('Form Content', 'give'), 'object_types' => array('give_forms'), 'context' => 'normal', 'priority' => 'high', 'fields' => apply_filters('give_forms_content_options_metabox_fields', array(array('name' => __('Display Content', 'give'), 'description' => __('Do you want to display content? If you select "Yes" a WYSIWYG editor will appear which you will be able to enter content to display above or below the form.', 'give'), 'id' => $prefix . 'content_option', 'type' => 'select', 'options' => apply_filters('give_forms_content_options_select', array('none' => __('No content', 'give'), 'give_pre_form' => __('Yes, display content ABOVE the form fields', 'give'), 'give_post_form' => __('Yes, display content BELOW the form fields', 'give'))), 'default' => 'none'), array('name' => __('Content', 'give'), 'description' => __('This content will display on the single give form page.', 'give'), 'id' => $prefix . 'form_content', 'row_classes' => 'give-subfield', 'type' => 'wysiwyg')))));
    /**
     * Display Options
     */
    $meta_boxes['form_display_options'] = apply_filters('give_form_display_options', array('id' => 'form_display_options', 'title' => __('Form Display Options', 'give'), 'object_types' => array('give_forms'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => apply_filters('give_forms_display_options_metabox_fields', array(array('name' => __('Payment Fields', 'give'), 'desc' => __('How would you like to display payment information for this form? The "Show on Page" option will display the entire form when the page loads. "Reveal Upon Click" places a button below the donation fields and upon clicks slides into view the rest of the fields. "Modal Window Upon Click" is a similar option, rather than sliding into view the fields they will open in a shadow box or "modal" window.', 'give'), 'id' => $prefix . 'payment_display', 'type' => 'select', 'options' => array('onpage' => __('Show on Page', 'give'), 'reveal' => __('Reveal Upon Click', 'give'), 'modal' => __('Modal Window Upon Click', 'give')), 'default' => 'onpage'), array('id' => $prefix . 'reveal_label', 'name' => __('Reveal / Modal Open Text', 'give'), 'desc' => __('The button label for completing the donation.', 'give'), 'type' => 'text_small', 'row_classes' => 'give-subfield', 'attributes' => array('placeholder' => __('Donate Now', 'give'))), array('id' => $prefix . 'checkout_label', 'name' => __('Complete Donation Text', 'give'), 'desc' => __('The button label for completing a donation.', 'give'), 'type' => 'text_small', 'attributes' => array('placeholder' => __('Donate Now', 'give'))), array('name' => __('Default Gateway', 'give'), 'desc' => __('By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give'), 'id' => $prefix . 'default_gateway', 'type' => 'default_gateway'), array('name' => __('Disable Guest Donations', 'give'), 'desc' => __('Do you want to require users be logged-in to make donations?', 'give'), 'id' => $prefix . 'logged_in_only', 'type' => 'checkbox'), array('name' => __('Register / Login Form', 'give'), 'desc' => __('Display the registration and login forms in the checkout section for non-logged-in users. Note: this option will not require users to register or log in prior to completing a donation. It simply determines whether the login and/or registration form are displayed on the checkout page.', 'give'), 'id' => $prefix . 'show_register_form', 'type' => 'select', 'options' => array('both' => __('Registration and Login Forms', 'give'), 'registration' => __('Registration Form Only', 'give'), 'login' => __('Login Form Only', 'give'), 'none' => __('None', 'give')), 'default' => 'none'), array('name' => __('Floating Labels', 'give'), 'desc' => sprintf(__('Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), esc_url("http://bradfrost.com/blog/post/float-label-pattern/")), 'id' => $prefix . 'form_floating_labels', 'type' => 'select', 'options' => array('' => __('Use the global setting', 'give'), 'enabled' => __('Enabled', 'give'), 'disabled' => __('Disabled', 'give')), 'default' => 'none')))));
    /**
     * Terms & Conditions
     */
    $meta_boxes['form_terms_options'] = apply_filters('give_forms_terms_options', array('id' => 'form_terms_options', 'title' => __('Terms and Conditions', 'give'), 'object_types' => array('give_forms'), 'context' => 'normal', 'priority' => 'high', 'fields' => apply_filters('give_forms_terms_options_metabox_fields', array(array('name' => __('Terms and Conditions', 'give'), 'description' => __('Do you want to require the user to agree to terms and conditions prior to being able to complete their donation?', 'give'), 'id' => $prefix . 'terms_option', 'type' => 'select', 'options' => apply_filters('give_forms_content_options_select', array('none' => __('No', 'give'), 'yes' => __('Yes', 'give'))), 'default' => 'none'), array('id' => $prefix . 'agree_label', 'name' => __('Agree to Terms Label', 'give'), 'desc' => __('The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give'), 'type' => 'text', 'row_classes' => 'give-subfield', 'size' => 'regular', 'attributes' => array('placeholder' => __('Agree to Terms?', 'give'))), array('id' => $prefix . 'agree_text', 'row_classes' => 'give-subfield', 'name' => __('Agreement Text', 'give'), 'desc' => __('This is the actual text which the user will have to agree to in order to make a donation.', 'give'), 'type' => 'wysiwyg')))));
    return $meta_boxes;
}
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:38,代码来源:metabox.php

示例2: give_register_styles

/**
 * Register Styles
 *
 * Checks the styles option and hooks the required filter.
 *
 * @since 1.0
 * @return void
 */
function give_register_styles()
{
    if (give_get_option('disable_css', false)) {
        return;
    }
    // Use minified libraries if SCRIPT_DEBUG is turned off
    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    $file = 'give' . $suffix . '.css';
    $templates_dir = give_get_theme_template_dir_name();
    $child_theme_style_sheet = trailingslashit(get_stylesheet_directory()) . $templates_dir . $file;
    $child_theme_style_sheet_2 = trailingslashit(get_stylesheet_directory()) . $templates_dir . 'give.css';
    $parent_theme_style_sheet = trailingslashit(get_template_directory()) . $templates_dir . $file;
    $parent_theme_style_sheet_2 = trailingslashit(get_template_directory()) . $templates_dir . 'give.css';
    $give_plugin_style_sheet = trailingslashit(give_get_templates_dir()) . $file;
    // Look in the child theme directory first, followed by the parent theme, followed by the Give core templates directory
    // Also look for the min version first, followed by non minified version, even if SCRIPT_DEBUG is not enabled.
    // This allows users to copy just give.css to their theme
    if (file_exists($child_theme_style_sheet) || !empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2))) {
        if (!empty($nonmin)) {
            $url = trailingslashit(get_stylesheet_directory_uri()) . $templates_dir . 'give.css';
        } else {
            $url = trailingslashit(get_stylesheet_directory_uri()) . $templates_dir . $file;
        }
    } elseif (file_exists($parent_theme_style_sheet) || !empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2))) {
        if (!empty($nonmin)) {
            $url = trailingslashit(get_template_directory_uri()) . $templates_dir . 'give.css';
        } else {
            $url = trailingslashit(get_template_directory_uri()) . $templates_dir . $file;
        }
    } elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) {
        $url = trailingslashit(give_get_templates_url()) . $file;
    }
    wp_register_style('give-styles', $url, array(), GIVE_VERSION, 'all');
    wp_enqueue_style('give-styles');
}
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:43,代码来源:scripts.php

示例3: __construct

 /**
  * Get things started
  *
  * Defines our WP_Session constants, includes the necessary libraries and
  * retrieves the WP Session instance
  *
  * @since 1.0
  */
 public function __construct()
 {
     $this->use_php_sessions = $this->use_php_sessions();
     $this->exp_option = give_get_option('session_lifetime');
     if ($this->use_php_sessions) {
         if (is_multisite()) {
             $this->prefix = '_' . get_current_blog_id();
         }
         // Use PHP SESSION (must be enabled via the GIVE_USE_PHP_SESSIONS constant)
         add_action('init', array($this, 'maybe_start_session'), -2);
     } else {
         // Use WP_Session (default)
         if (!defined('WP_SESSION_COOKIE')) {
             define('WP_SESSION_COOKIE', 'give_wp_session');
         }
         if (!class_exists('Recursive_ArrayAccess')) {
             require_once GIVE_PLUGIN_DIR . 'includes/libraries/class-recursive-arrayaccess.php';
         }
         if (!class_exists('WP_Session')) {
             require_once GIVE_PLUGIN_DIR . 'includes/libraries/class-wp-session.php';
             require_once GIVE_PLUGIN_DIR . 'includes/libraries/wp-session.php';
         }
         add_filter('wp_session_expiration_variant', array($this, 'set_expiration_variant_time'), 99999);
         add_filter('wp_session_expiration', array($this, 'set_expiration_time'), 99999);
     }
     if (empty($this->session) && !$this->use_php_sessions) {
         add_action('plugins_loaded', array($this, 'init'), -1);
     } else {
         add_action('init', array($this, 'init'), -1);
     }
 }
开发者ID:pantelicnevena,项目名称:newhanan,代码行数:39,代码来源:class-give-session.php

示例4: give_register_styles

/**
 * Register styles.
 *
 * Checks the styles option and hooks the required filter.
 *
 * @since 1.0
 * @return void
 */
function give_register_styles()
{
    if (give_get_option('disable_css', false)) {
        return;
    }
    wp_register_style('give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all');
    wp_enqueue_style('give-styles');
}
开发者ID:wordimpress,项目名称:give,代码行数:16,代码来源:scripts.php

示例5: csv_cols

 /**
  * Set the CSV columns.
  *
  * @access public
  * @since 1.5
  * @return array $cols All the columns.
  */
 public function csv_cols()
 {
     $cols = array('id' => esc_html__('ID', 'give'), 'seq_id' => esc_html__('Payment Number', 'give'), 'email' => esc_html__('Email', 'give'), 'first' => esc_html__('First Name', 'give'), 'last' => esc_html__('Last Name', 'give'), 'address1' => esc_html__('Address', 'give'), 'address2' => esc_html__('Address (Line 2)', 'give'), 'city' => esc_html__('City', 'give'), 'state' => esc_html__('State', 'give'), 'country' => esc_html__('Country', 'give'), 'zip' => esc_html__('Zip / Postal Code', 'give'), 'form_id' => esc_html__('Form ID', 'give'), 'form_name' => esc_html__('Form Name', 'give'), 'amount' => esc_html__('Amount', 'give') . ' (' . html_entity_decode(give_currency_filter('')) . ')', 'gateway' => esc_html__('Payment Method', 'give'), 'trans_id' => esc_html__('Transaction ID', 'give'), 'key' => esc_html__('Purchase Key', 'give'), 'date' => esc_html__('Date', 'give'), 'user' => esc_html__('User', 'give'), 'status' => esc_html__('Status', 'give'));
     if (!give_get_option('enable_sequential')) {
         unset($cols['seq_id']);
     }
     return $cols;
 }
开发者ID:wordimpress,项目名称:give,代码行数:15,代码来源:class-batch-export-payments.php

示例6: test_register_styles_bail_option

 /**
  * Test that the give_register_styles() function will bail when the 'disable_css'
  * option is set to true.
  *
  * @since 1.0
  */
 public function test_register_styles_bail_option()
 {
     // Prepare test
     $origin_disable_css = give_get_option('disable_css', false);
     give_update_option('disable_css', true);
     // Assert
     $this->assertNull(give_register_styles());
     // Reset to origin
     give_update_option('disable_css', $origin_disable_css);
 }
开发者ID:wordimpress,项目名称:give,代码行数:16,代码来源:tests-scripts.php

示例7: give_output_sidebar_option

 /**
  * Output sidebar option
  * @description Determines whether the user has enabled or disabled the sidebar for Single Give forms
  * @since       1.3
  *
  */
 public function give_output_sidebar_option()
 {
     $sidebar_option = give_get_option('disable_form_sidebar');
     //Add full width class when feature image is disabled AND no widgets are present
     if ($sidebar_option !== 'on') {
         add_action('give_before_single_form_summary', 'give_left_sidebar_pre_wrap', 5);
         add_action('give_before_single_form_summary', 'give_show_form_images', 10);
         add_action('give_before_single_form_summary', 'give_get_forms_sidebar', 20);
         add_action('give_before_single_form_summary', 'give_left_sidebar_post_wrap', 30);
     }
 }
开发者ID:lots0logs,项目名称:Give,代码行数:17,代码来源:class-give-template-loader.php

示例8: give_form_columns

/**
 * Give Forms Columns
 *
 * Defines the custom columns and their order
 *
 * @since 1.0
 *
 * @param array $give_form_columns Array of forms columns
 *
 * @return array $form_columns Updated array of forms columns
 *  Post Type List Table
 */
function give_form_columns($give_form_columns)
{
    //Standard columns
    $give_form_columns = array('cb' => '<input type="checkbox"/>', 'title' => __('Name', 'give'), 'form_category' => __('Categories', 'give'), 'form_tag' => __('Tags', 'give'), 'price' => __('Price', 'give'), 'goal' => __('Goal', 'give'), 'donations' => __('Donations', 'give'), 'earnings' => __('Income', 'give'), 'shortcode' => __('Shortcode', 'give'), 'date' => __('Date', 'give'));
    //Does the user want categories / tags?
    if (give_get_option('enable_categories') !== 'on') {
        unset($give_form_columns['form_category']);
    }
    if (give_get_option('enable_tags') !== 'on') {
        unset($give_form_columns['form_tag']);
    }
    return apply_filters('give_forms_columns', $give_form_columns);
}
开发者ID:lots0logs,项目名称:Give,代码行数:25,代码来源:dashboard-columns.php

示例9: widget

 /**
  * Echo the widget content.
  *
  * @param array $args     Display arguments including before_title, after_title,
  *                        before_widget, and after_widget.
  * @param array $instance The settings for the particular instance of the widget.
  */
 public function widget($args, $instance)
 {
     $title = !empty($instance['title']) ? $instance['title'] : '';
     $title = apply_filters('widget_title', $title, $instance, $this->id_base);
     // If user set float labels to global then check global float label setting and update donation form widget accordingly.
     if ('global' === $instance['float_labels']) {
         $instance['float_labels'] = 'on' === give_get_option('enable_floatlabels', '') ? 'enabled' : 'disabled';
     }
     echo $args['before_widget'];
     do_action('give_before_forms_widget');
     echo $title ? $args['before_title'] . $title . $args['after_title'] : '';
     give_get_donation_form($instance);
     echo $args['after_widget'];
     do_action('give_after_forms_widget');
 }
开发者ID:wordimpress,项目名称:give,代码行数:22,代码来源:widget.php

示例10: __construct

 /**
  * Class Constructor
  *
  * Defines our session constants, includes the necessary libraries and retrieves the session instance.
  *
  * @since  1.0
  * @access public
  *
  * @return void
  */
 public function __construct()
 {
     $this->use_php_sessions = $this->use_php_sessions();
     $this->exp_option = give_get_option('session_lifetime');
     //PHP Sessions
     if ($this->use_php_sessions) {
         if (is_multisite()) {
             $this->prefix = '_' . get_current_blog_id();
         }
         add_action('init', array($this, 'maybe_start_session'), -2);
     } else {
         if (!$this->should_start_session()) {
             return;
         }
         // Use WP_Session
         if (!defined('WP_SESSION_COOKIE')) {
             define('WP_SESSION_COOKIE', 'give_wp_session');
         }
         if (!class_exists('Recursive_ArrayAccess')) {
             require_once GIVE_PLUGIN_DIR . 'includes/libraries/sessions/class-recursive-arrayaccess.php';
         }
         if (!class_exists('WP_Session')) {
             require_once GIVE_PLUGIN_DIR . 'includes/libraries/sessions/class-wp-session.php';
             require_once GIVE_PLUGIN_DIR . 'includes/libraries/sessions/wp-session.php';
         }
         add_filter('wp_session_expiration_variant', array($this, 'set_expiration_variant_time'), 99999);
         add_filter('wp_session_expiration', array($this, 'set_expiration_time'), 99999);
     }
     //Init Session
     if (empty($this->session) && !$this->use_php_sessions) {
         add_action('plugins_loaded', array($this, 'init'), -1);
     } else {
         add_action('init', array($this, 'init'), -1);
     }
     //Set cookie on Donation Completion page
     add_action('give_pre_process_purchase', array($this, 'set_session_cookies'));
 }
开发者ID:wordimpress,项目名称:give,代码行数:47,代码来源:class-give-session.php

示例11: give_offline_send_donor_instructions

/**
 * Send Offline Donation Instructions
 *
 * @description Sends a notice to the donor with offline instructions; can be customized per form
 *
 * @param int $payment_id
 *
 * @since       1.0
 * @return void
 */
function give_offline_send_donor_instructions($payment_id = 0)
{
    $payment_data = give_get_payment_meta($payment_id);
    $post_offline_customization_option = get_post_meta($payment_data['form_id'], '_give_customize_offline_donations', true);
    //Customize email content depending on whether the single form has been customized
    $email_content = give_get_option('global_offline_donation_email');
    if ($post_offline_customization_option === 'yes') {
        $email_content = get_post_meta($payment_data['form_id'], '_give_offline_donation_email', true);
    }
    $from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
    $from_name = apply_filters('give_purchase_from_name', $from_name, $payment_id, $payment_data);
    $from_email = give_get_option('from_email', get_bloginfo('admin_email'));
    $from_email = apply_filters('give_purchase_from_address', $from_email, $payment_id, $payment_data);
    $to_email = give_get_payment_user_email($payment_id);
    $subject = give_get_option('offline_donation_subject', __('Offline Donation Instructions', 'give'));
    if ($post_offline_customization_option === 'yes') {
        $subject = get_post_meta($payment_data['form_id'], '_give_offline_donation_subject', true);
    }
    $subject = apply_filters('give_offline_donation_subject', wp_strip_all_tags($subject), $payment_id);
    $subject = give_do_email_tags($subject, $payment_id);
    $attachments = apply_filters('give_offline_donation_attachments', array(), $payment_id, $payment_data);
    $message = give_do_email_tags($email_content, $payment_id);
    $emails = Give()->emails;
    $emails->__set('from_name', $from_name);
    $emails->__set('from_email', $from_email);
    $emails->__set('heading', __('Offline Donation Instructions', 'give'));
    $headers = apply_filters('give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data);
    $emails->__set('headers', $headers);
    $emails->send($to_email, $subject, $message, $attachments);
}
开发者ID:joedolson,项目名称:Give,代码行数:40,代码来源:offline-donations.php

示例12: give_is_ssl_enforced

/**
 * Determines if secure checkout pages are enforced
 *
 * @since       1.0
 * @return      bool True if enforce SSL is enabled, false otherwise
 */
function give_is_ssl_enforced()
{
    $ssl_enforced = give_get_option('enforce_ssl', false);
    return (bool) apply_filters('give_is_ssl_enforced', $ssl_enforced);
}
开发者ID:helgatheviking,项目名称:Give,代码行数:11,代码来源:functions.php

示例13: send_email

 /**
  * Send the user's token
  *
  * @since  1.0
  * @access public
  *
  * @param  $customer_id Customer id.
  * @param  $email       Customer email.
  *
  * @return void
  */
 public function send_email($customer_id, $email)
 {
     $verify_key = wp_generate_password(20, false);
     // Generate a new verify key
     $this->set_verify_key($customer_id, $email, $verify_key);
     // Get the purchase history URL
     $page_id = give_get_option('history_page');
     $access_url = add_query_arg(array('give_nl' => $verify_key), get_permalink($page_id));
     //Nice subject and message
     $subject = apply_filters('give_email_access_token_subject', sprintf(esc_html__('Your Access Link to %s', 'give'), get_bloginfo('name')));
     $message = esc_html__('You or someone in your organization requested an access link be sent to this email address. This is a temporary access link for you to view your donation information. Click on the link below to view:', 'give') . "\n\n";
     $message .= '<a href="' . esc_url($access_url) . '" target="_blank">' . esc_html__('Access My Donation Details &raquo;', 'give') . '</a>' . "\n\n";
     $message .= "\n\n";
     $message .= esc_html__('Sincerely,', 'give') . "\n";
     $message .= get_bloginfo('name') . "\n";
     $message = apply_filters('give_email_access_token_message', $message);
     // Send the email
     Give()->emails->__set('heading', apply_filters('give_email_access_token_heading', esc_html__('Your Access Link', 'give')));
     Give()->emails->send($email, $subject, $message);
 }
开发者ID:wordimpress,项目名称:give,代码行数:31,代码来源:class-give-email-access.php

示例14: give_test_mode_frontend_warning

/**
 * Test Mode Frontend Warning
 *
 * @description Displays a notice on the frontend for donation forms
 * @since 1.1
 */
function give_test_mode_frontend_warning()
{
    $test_mode = give_get_option('test_mode');
    if ($test_mode == 'on') {
        echo '<div class="give_error give_warning" id="give_error_test_mode"><p><strong>' . __('Notice', 'give') . '</strong>: ' . __('Test mode is enabled. While in test mode no live transactions are processed.', 'give') . '</p></div>';
    }
}
开发者ID:pantelicnevena,项目名称:hanan,代码行数:13,代码来源:template.php

示例15: give_install

/**
 * Install
 *
 * Runs on plugin install by setting up the post types, custom taxonomies, flushing rewrite rules to initiate the new 'donations' slug and also creates the plugin and populates the settings fields for those plugin pages. After successful install, the user is redirected to the Give Welcome screen.
 *
 * @since 1.0
 * @global $wpdb
 * @global $wp_version
 * @return void
 */
function give_install()
{
    global $give_options;
    // Setup the Give Custom Post Types
    give_setup_post_types();
    // Clear the permalinks
    flush_rewrite_rules(false);
    // Add Upgraded From Option
    $current_version = get_option('give_version');
    if ($current_version) {
        update_option('give_version_upgraded_from', $current_version);
    }
    // Setup some default options
    $options = array();
    // Checks if the Success Page option exists AND that the page exists
    if (!get_post(give_get_option('success_page'))) {
        // Purchase Confirmation (Success) Page
        $success = wp_insert_post(array('post_title' => __('Donation Confirmation', 'give'), 'post_content' => __('Thank you for your donation! [give_receipt]', 'give'), 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'comment_status' => 'closed'));
        // Store our page IDs
        $options['success_page'] = $success;
    }
    // Checks if the Failure Page option exists AND that the page exists
    if (!get_post(give_get_option('failure_page'))) {
        // Failed Purchase Page
        $failed = wp_insert_post(array('post_title' => __('Transaction Failed', 'give'), 'post_content' => __('Your transaction failed, please try again or contact site support.', 'give'), 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'comment_status' => 'closed'));
        $options['failure_page'] = $failed;
    }
    // Checks if the History Page option exists AND that the page exists
    if (!get_post(give_get_option('history_page'))) {
        // Purchase History (History) Page
        $history = wp_insert_post(array('post_title' => __('Donation History', 'give'), 'post_content' => '[donation_history]', 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'comment_status' => 'closed'));
        $options['history_page'] = $history;
    }
    //Fresh Install? Setup Test Mode, Base Country (US), Test Gateway, Currency
    if (empty($current_version)) {
        $options['base_country'] = 'US';
        $options['test_mode'] = 1;
        $options['currency'] = 'USD';
        $options['session_lifetime'] = '604800';
        $options['gateways']['manual'] = 1;
        $options['default_gateway'] = 'manual';
        //default is manual
        //Offline Gateway Setup
        $options['gateways']['offline'] = 1;
        $options['global_offline_donation_content'] = give_get_default_offline_donation_content();
        //Emails
        $options['donation_notification'] = give_get_default_donation_notification_email();
    }
    // Populate some default values
    update_option('give_settings', array_merge($give_options, $options));
    update_option('give_version', GIVE_VERSION);
    //Update Version Number
    if ($current_version) {
        update_option('give_version_upgraded_from', $current_version);
    }
    // Create Give roles
    $roles = new Give_Roles();
    $roles->add_roles();
    $roles->add_caps();
    $api = new Give_API();
    update_option('give_default_api_version', 'v' . $api->get_version());
    // Create the customers database
    @Give()->customers->create_table();
    // Check for PHP Session support, and enable if available
    Give()->session->use_php_sessions();
    // Add a temporary option to note that Give pages have been created
    set_transient('_give_installed', $options, 30);
    // Bail if activating from network, or bulk
    if (is_network_admin() || isset($_GET['activate-multi'])) {
        return;
    }
    if (!$current_version) {
        require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
        // When new upgrade routines are added, mark them as complete on fresh install
        $upgrade_routines = array('upgrade_give_payment_customer_id', 'upgrade_give_offline_status');
        foreach ($upgrade_routines as $upgrade) {
            give_set_upgrade_complete($upgrade);
        }
    }
    // Add the transient to redirect
    set_transient('_give_activation_redirect', true, 30);
}
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:92,代码来源:install.php


注:本文中的give_get_option函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。