• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP give_get_forms_label_singular函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: forms_dropdown

 /**
  * Renders an HTML Dropdown of all the Give Forms
  *
  * @access public
  * @since  1.0
  *
  * @param array $args Arguments for the dropdown
  *
  * @return string $output Give forms dropdown
  */
 public function forms_dropdown($args = array())
 {
     $defaults = array('name' => 'forms', 'id' => 'forms', 'class' => '', 'multiple' => false, 'selected' => 0, 'chosen' => false, 'number' => 30, 'placeholder' => sprintf(__('Select a %s', 'give'), give_get_forms_label_singular()));
     $args = wp_parse_args($args, $defaults);
     $forms = get_posts(array('post_type' => 'give_forms', 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => $args['number']));
     $options = array();
     if ($forms) {
         $options[0] = sprintf(__('Select a %s', 'give'), give_get_forms_label_singular());
         foreach ($forms as $form) {
             $options[absint($form->ID)] = esc_html($form->post_title);
         }
     } else {
         $options[0] = __('No Give Forms Found', 'give');
     }
     // This ensures that any selected forms are included in the drop down
     if (is_array($args['selected'])) {
         foreach ($args['selected'] as $item) {
             if (!in_array($item, $options)) {
                 $options[$item] = get_the_title($item);
             }
         }
     } elseif (is_numeric($args['selected']) && $args['selected'] !== 0) {
         if (!in_array($args['selected'], $options)) {
             $options[$args['selected']] = get_the_title($args['selected']);
         }
     }
     $output = $this->select(array('name' => $args['name'], 'selected' => $args['selected'], 'id' => $args['id'], 'class' => $args['class'], 'options' => $options, 'chosen' => $args['chosen'], 'multiple' => $args['multiple'], 'placeholder' => $args['placeholder'], 'show_option_all' => false, 'show_option_none' => false));
     return $output;
 }
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:39,代码来源:class-give-html-elements.php


示例2: give_updated_messages

/**
 * Updated Messages
 *
 * Returns an array of with all updated messages.
 *
 * @since 1.0
 *
 * @param array $messages Post updated message
 *
 * @return array $messages New post updated messages
 */
function give_updated_messages($messages)
{
    global $post, $post_ID;
    $url1 = '<a href="' . get_permalink($post_ID) . '">';
    $url2 = give_get_forms_label_singular();
    $url3 = '</a>';
    $messages['give_forms'] = array(1 => sprintf(__('%2$s updated. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3), 4 => sprintf(__('%2$s updated. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3), 6 => sprintf(__('%2$s published. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3), 7 => sprintf(__('%2$s saved. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3), 8 => sprintf(__('%2$s submitted. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3));
    return $messages;
}
开发者ID:helgatheviking,项目名称:Give,代码行数:20,代码来源:post-types.php


示例3: give_load_admin_scripts

/**
 * Load Admin Scripts
 *
 * Enqueues the required admin scripts.
 *
 * @since 1.0
 * @global       $post
 *
 * @param string $hook Page hook
 *
 * @return void
 */
function give_load_admin_scripts($hook)
{
    global $wp_version, $post, $post_type;
    //Directories of assets
    $js_dir = GIVE_PLUGIN_URL . 'assets/js/admin/';
    $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/';
    $css_dir = GIVE_PLUGIN_URL . 'assets/css/';
    // Use minified libraries if SCRIPT_DEBUG is turned off
    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    //Global Admin:
    wp_register_style('give-admin-bar-notification', $css_dir . 'adminbar-style.css');
    wp_enqueue_style('give-admin-bar-notification');
    //Give Admin Only:
    if (!apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
        return;
    }
    //CSS
    wp_register_style('jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css');
    wp_enqueue_style('jquery-ui-css');
    wp_register_style('give-admin', $css_dir . 'give-admin' . $suffix . '.css', GIVE_VERSION);
    wp_enqueue_style('give-admin');
    wp_register_style('jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION);
    wp_enqueue_style('jquery-chosen');
    wp_enqueue_style('thickbox');
    //JS
    wp_register_script('jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array('jquery'), GIVE_VERSION);
    wp_enqueue_script('jquery-chosen');
    wp_register_script('give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array('jquery'), GIVE_VERSION, false);
    wp_enqueue_script('give-admin-scripts');
    wp_register_script('jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js');
    wp_enqueue_script('jquery-flot');
    wp_register_script('give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array('jquery'), GIVE_VERSION, false);
    wp_enqueue_script('give-qtip');
    wp_enqueue_script('jquery-ui-datepicker');
    wp_enqueue_script('thickbox');
    //Forms CPT Script
    if ($post_type === 'give_forms') {
        wp_register_script('give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array('jquery'), GIVE_VERSION, false);
        wp_enqueue_script('give-admin-forms-scripts');
    }
    //Localize strings & variables for JS
    wp_localize_script('give-admin-scripts', 'give_vars', array('post_id' => isset($post->ID) ? $post->ID : null, 'give_version' => GIVE_VERSION, 'quick_edit_warning' => __('Sorry, not available for variable priced forms.', 'give'), 'delete_payment' => __('Are you sure you wish to delete this payment?', 'give'), 'delete_payment_note' => __('Are you sure you wish to delete this note?', 'give'), 'delete_tax_rate' => __('Are you sure you wish to delete this tax rate?', 'give'), 'revoke_api_key' => __('Are you sure you wish to revoke this API key?', 'give'), 'regenerate_api_key' => __('Are you sure you wish to regenerate this API key?', 'give'), 'resend_receipt' => __('Are you sure you wish to resend the donation receipt?', 'give'), 'copy_download_link_text' => __('Copy these links to your clipboard and give them to your donor', 'give'), 'delete_payment_download' => sprintf(__('Are you sure you wish to delete this %s?', 'give'), give_get_forms_label_singular()), 'one_price_min' => __('You must have at least one price', 'give'), 'one_file_min' => __('You must have at least one file', 'give'), 'one_field_min' => __('You must have at least one field', 'give'), 'one_option' => sprintf(__('Choose a %s', 'give'), give_get_forms_label_singular()), 'one_or_more_option' => sprintf(__('Choose one or more %s', 'give'), give_get_forms_label_plural()), 'numeric_item_price' => __('Item price must be numeric', 'give'), 'numeric_quantity' => __('Quantity must be numeric', 'give'), 'currency_sign' => give_currency_filter(''), 'currency_pos' => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before', 'currency_decimals' => give_currency_decimal_filter(), 'new_media_ui' => apply_filters('give_use_35_media_ui', 1), 'remove_text' => __('Remove', 'give'), 'type_to_search' => sprintf(__('Type to search %s', 'give'), give_get_forms_label_plural())));
    if (function_exists('wp_enqueue_media') && version_compare($wp_version, '3.5', '>=')) {
        //call for new media manager
        wp_enqueue_media();
    }
}
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:59,代码来源:scripts.php


示例4: get_columns

 /**
  * Retrieve the table columns
  *
  * @access public
  * @since  1.0
  * @return array $columns Array of all the list table columns
  */
 public function get_columns()
 {
     $columns = array('title' => give_get_forms_label_singular(), 'sales' => __('Donations', 'give'), 'earnings' => __('Income', 'give'), 'average_sales' => __('Monthly Average Donations', 'give'), 'average_earnings' => __('Monthly Average Income', 'give'), 'details' => __('Detailed Report', 'give'));
     return $columns;
 }
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:12,代码来源:class-form-reports-table.php


示例5: __construct

 /**
  * Get things started
  *
  * @since 1.0
  * @uses  Give_Payment_History_Table::get_payment_counts()
  * @see   WP_List_Table::__construct()
  */
 public function __construct()
 {
     global $status, $page;
     // Set parent defaults
     parent::__construct(array('singular' => give_get_forms_label_singular(), 'plural' => give_get_forms_label_plural(), 'ajax' => false));
     $this->get_payment_counts();
     $this->process_bulk_action();
     $this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
 }
开发者ID:helgatheviking,项目名称:Give,代码行数:16,代码来源:class-payments-table.php


示例6: get_columns

 /**
  * Retrieve the table columns
  *
  * @access public
  * @since  1.0
  * @return array $columns Array of all the list table columns
  */
 public function get_columns()
 {
     $columns = array('ID' => esc_html__('Log ID', 'give'), 'user_id' => esc_html__('Donor', 'give'), 'form' => give_get_forms_label_singular(), 'amount' => esc_html__('Donation Amount', 'give'), 'status' => esc_html__('Status', 'give'), 'payment_id' => esc_html__('Transaction ID', 'give'), 'date' => esc_html__('Date', 'give'));
     return $columns;
 }
开发者ID:wordimpress,项目名称:give,代码行数:12,代码来源:class-sales-logs-list-table.php


示例7: __construct

 /**
  * Widget constructor
  *
  * @since  1.0
  * @access public
  *
  * @return void
  */
 public function __construct()
 {
     $give_label_singular = function_exists('give_get_forms_label_singular') ? strtolower(give_get_forms_label_singular()) : null;
     // widget settings
     $widget_ops = array('classname' => 'give-donators-gravatars', 'description' => sprintf(esc_html__('Displays gravatars of people who have donated using your your %1$s. Will only show on the single %2$s page.', 'give'), $give_label_singular, $give_label_singular));
     // widget control settings
     $control_ops = array('width' => 250, 'height' => 350, 'id_base' => 'give_gravatars_widget');
     // create the widget
     parent::__construct('give_donators_gravatars_widget', esc_html__('Give Donators Gravatars', 'give'), $widget_ops, $control_ops);
 }
开发者ID:wordimpress,项目名称:give,代码行数:18,代码来源:class-give-gravatars.php


示例8: give_load_admin_scripts

/**
 * Load Admin Scripts
 *
 * Enqueues the required admin scripts.
 *
 * @since 1.0
 *
 * @global       $post
 * @global       $give_options
 *
 * @param string $hook Page hook
 *
 * @return void
 */
function give_load_admin_scripts($hook)
{
    global $wp_version, $post, $post_type, $give_options;
    //Directories of assets
    $js_dir = GIVE_PLUGIN_URL . 'assets/js/admin/';
    $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/';
    $css_dir = GIVE_PLUGIN_URL . 'assets/css/';
    // Use minified libraries if SCRIPT_DEBUG is turned off
    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    //Global Admin:
    wp_register_style('give-admin-bar-notification', $css_dir . 'adminbar-style.css');
    wp_enqueue_style('give-admin-bar-notification');
    //Give Admin Only:
    if (!apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
        return;
    }
    //CSS
    wp_register_style('jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css');
    wp_enqueue_style('jquery-ui-css');
    wp_register_style('give-admin', $css_dir . 'give-admin' . $suffix . '.css', GIVE_VERSION);
    wp_enqueue_style('give-admin');
    wp_register_style('jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION);
    wp_enqueue_style('jquery-chosen');
    wp_enqueue_style('thickbox');
    //JS
    wp_register_script('jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array('jquery'), GIVE_VERSION);
    wp_enqueue_script('jquery-chosen');
    wp_register_script('give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array('jquery'), GIVE_VERSION, false);
    wp_enqueue_script('give-accounting');
    wp_register_script('give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array('jquery'), GIVE_VERSION, false);
    wp_enqueue_script('give-admin-scripts');
    wp_register_script('jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js');
    wp_enqueue_script('jquery-flot');
    wp_register_script('give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array('jquery'), GIVE_VERSION, false);
    wp_enqueue_script('give-qtip');
    wp_enqueue_script('jquery-ui-datepicker');
    wp_enqueue_script('thickbox');
    // Forms CPT Script.
    if ($post_type === 'give_forms') {
        wp_register_script('give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array('jquery'), GIVE_VERSION, false);
        wp_enqueue_script('give-admin-forms-scripts');
    }
    //Settings Scripts
    if (isset($_GET['page']) && $_GET['page'] == 'give-settings') {
        wp_register_script('give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array('jquery'), GIVE_VERSION, false);
        wp_enqueue_script('give-admin-settings-scripts');
    }
    // Price Separators.
    $thousand_separator = give_get_price_thousand_separator();
    $decimal_separator = give_get_price_decimal_separator();
    //Localize strings & variables for JS
    wp_localize_script('give-admin-scripts', 'give_vars', array('post_id' => isset($post->ID) ? $post->ID : null, 'give_version' => GIVE_VERSION, 'thousands_separator' => $thousand_separator, 'decimal_separator' => $decimal_separator, 'quick_edit_warning' => esc_html__('Sorry, not available for variable priced forms.', 'give'), 'delete_payment' => esc_html__('Are you sure you wish to delete this payment?', 'give'), 'delete_payment_note' => esc_html__('Are you sure you wish to delete this note?', 'give'), 'revoke_api_key' => esc_html__('Are you sure you wish to revoke this API key?', 'give'), 'regenerate_api_key' => esc_html__('Are you sure you wish to regenerate this API key?', 'give'), 'resend_receipt' => esc_html__('Are you sure you wish to resend the donation receipt?', 'give'), 'copy_download_link_text' => esc_html__('Copy these links to your clipboard and give them to your donor.', 'give'), 'delete_payment_download' => sprintf(esc_html__('Are you sure you wish to delete this %s?', 'give'), give_get_forms_label_singular()), 'one_price_min' => esc_html__('You must have at least one price.', 'give'), 'one_file_min' => esc_html__('You must have at least one file.', 'give'), 'one_field_min' => esc_html__('You must have at least one field.', 'give'), 'one_option' => sprintf(esc_html__('Choose a %s', 'give'), give_get_forms_label_singular()), 'one_or_more_option' => sprintf(esc_html__('Choose one or more %s', 'give'), give_get_forms_label_plural()), 'numeric_item_price' => esc_html__('Item price must be numeric.', 'give'), 'numeric_quantity' => esc_html__('Quantity must be numeric.', 'give'), 'currency_sign' => give_currency_filter(''), 'currency_pos' => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before', 'currency_decimals' => give_currency_decimal_filter(give_get_price_decimals()), 'new_media_ui' => apply_filters('give_use_35_media_ui', 1), 'remove_text' => esc_html__('Remove', 'give'), 'type_to_search' => sprintf(esc_html__('Type to search %s', 'give'), give_get_forms_label_plural()), 'batch_export_no_class' => esc_html__('You must choose a method.', 'give'), 'batch_export_no_reqs' => esc_html__('Required fields not completed.', 'give'), 'reset_stats_warn' => __('Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give'), 'price_format_guide' => sprintf(esc_html__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator)));
    if (function_exists('wp_enqueue_media') && version_compare($wp_version, '3.5', '>=')) {
        //call for new media manager
        wp_enqueue_media();
    }
}
开发者ID:wordimpress,项目名称:give,代码行数:71,代码来源:scripts.php


示例9: form

    /**
     * Output the settings update form.
     *
     * @param array $instance Current settings.
     *
     * @return string
     */
    public function form($instance)
    {
        $defaults = array('title' => '', 'id' => '', 'float_labels' => '');
        $instance = wp_parse_args((array) $instance, $defaults);
        extract($instance);
        // Query Give Forms
        $args = array('post_type' => 'give_forms', 'posts_per_page' => -1, 'post_status' => 'publish');
        $give_forms = get_posts($args);
        // Widget: Title
        ?>
<p>
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:', 'give');
        ?>
</label>
			<input type="text" class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" value="<?php 
        echo esc_attr($title);
        ?>
" /><br>
			<small><?php 
        _e('Leave blank to hide the widget title.', 'give');
        ?>
</small>
		</p><?php 
        // Widget: Give Form
        ?>
<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('id'));
        ?>
"><?php 
        printf(__('Give %s:', 'give'), give_get_forms_label_singular());
        ?>
</label>
			<select class="widefat" name="<?php 
        echo esc_attr($this->get_field_name('id'));
        ?>
" id="<?php 
        echo esc_attr($this->get_field_id('id'));
        ?>
">
				<option value="current"><?php 
        _e('— Select —', 'give');
        ?>
</option>
				<?php 
        foreach ($give_forms as $give_form) {
            ?>
					<option <?php 
            selected(absint($id), $give_form->ID);
            ?>
 value="<?php 
            echo esc_attr($give_form->ID);
            ?>
"><?php 
            echo $give_form->post_title;
            ?>
</option>
				<?php 
        }
        ?>
			</select><br>
			<small><?php 
        _e('Select a Give Form to embed in this widget.', 'give');
        ?>
</small>
		</p><?php 
        // Widget: Floating Labels
        ?>
<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('float_labels'));
        ?>
"><?php 
        _e('Floating Labels (optional):', 'give');
        ?>
</label>
			<select class="widefat" name="<?php 
        echo esc_attr($this->get_field_name('float_labels'));
        ?>
" id="<?php 
        echo esc_attr($this->get_field_id('float_labels'));
        ?>
">
//.........这里部分代码省略.........
开发者ID:lots0logs,项目名称:Give,代码行数:101,代码来源:widget.php


示例10: give_price_field_quick_edit

/**
 * Adds price field to Quick Edit options
 *
 * @since 1.0
 *
 * @param string $column_name Name of the column
 * @param string $post_type   Current Post Type (i.e. forms)
 *
 * @return void
 */
function give_price_field_quick_edit($column_name, $post_type)
{
    if ($column_name != 'price' || $post_type != 'give_forms') {
        return;
    }
    ?>
	<fieldset class="inline-edit-col-left">
		<div id="give-give-data" class="inline-edit-col">
			<h4><?php 
    echo sprintf(__('%s Configuration', 'give'), give_get_forms_label_singular());
    ?>
</h4>
			<label>
				<span class="title"><?php 
    _e('Price', 'give');
    ?>
</span>
				<span class="input-text-wrap">
					<input type="text" name="_give_regprice" class="text regprice" />
				</span>
			</label>
			<br class="clear" />
		</div>
	</fieldset>
	<?php 
}
开发者ID:lots0logs,项目名称:Give,代码行数:36,代码来源:dashboard-columns.php


示例11: get_columns

 /**
  * Retrieve the table columns
  *
  * @access public
  * @since  1.0
  * @return array $columns Array of all the list table columns
  */
 public function get_columns()
 {
     $columns = array('ID' => __('Log ID', 'give'), 'user_id' => __('User', 'give'), 'form' => give_get_forms_label_singular(), 'amount' => __('Item Amount', 'give'), 'payment_id' => __('Payment ID', 'give'), 'date' => __('Date', 'give'));
     return $columns;
 }
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:12,代码来源:class-sales-logs-list-table.php


示例12: form

    /**
     * Back-end widget form.
     *
     * @param array $instance
     *
     * @return null
     * @see WP_Widget::form()
     */
    public function form($instance)
    {
        $instance = wp_parse_args((array) $instance, $this->widget_defaults);
        ?>

		<!-- Title -->
		<p>
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Widget Title', 'gpr');
        ?>
</label>
			<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
"
			       name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo $instance['title'];
        ?>
" />
		</p>


		<?php 
        //Query Give Forms
        $args = array('post_type' => 'give_forms', 'posts_per_page' => -1, 'post_status' => 'publish');
        $give_forms = get_posts($args);
        ?>
		<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('id'));
        ?>
"><?php 
        printf(__('Give %s', 'give'), give_get_forms_label_singular());
        ?>
				<span class="dashicons dashicons-editor-help give-tooltip" style="opacity:0.6" data-tooltip="<?php 
        _e('Select a Give Form that you would like to embed in this widget area.', 'give');
        ?>
"></span>
			</label>
			<select class="widefat" name="<?php 
        echo esc_attr($this->get_field_name('id'));
        ?>
" id="<?php 
        echo esc_attr($this->get_field_id('id'));
        ?>
">
				<option value="current"><?php 
        _e('Please select...', 'give');
        ?>
</option>
				<?php 
        foreach ($give_forms as $give_form) {
            ?>
					<option <?php 
            selected(absint($instance['id']), $give_form->ID);
            ?>
 value="<?php 
            echo esc_attr($give_form->ID);
            ?>
"><?php 
            echo $give_form->post_title;
            ?>
</option>
				<?php 
        }
        ?>
			</select>
		</p>
		<!-- Give Form Field -->

		<?php 
    }
开发者ID:helgatheviking,项目名称:Give,代码行数:86,代码来源:widget.php


示例13: give_admin_footer_for_thickbox

/**
 * Admin Footer For Thickbox
 *
 * Prints the footer code needed for the Insert Download
 * TinyMCE button.
 *
 * @since 1.0
 * @global $pagenow
 * @global $typenow
 * @return void
 */
function give_admin_footer_for_thickbox()
{
    global $pagenow, $typenow;
    // Only run in post/page creation and edit screens
    if (in_array($pagenow, array('post.php', 'page.php', 'post-new.php', 'post-edit.php')) && $typenow != 'give_forms' && $typenow != 'give_campaigns') {
        ?>
		<script type="text/javascript">
			function insertGiveForm() {
				var id = jQuery( '.give-select#forms' ).val();

				// Return early if no form  is selected
				if ( id === '' ) {
					alert( '<?php 
        _e("You must choose a form", "give");
        ?>
' );
					return;
				}

				// Send the shortcode to the editor
				window.send_to_editor( '[give_form id="' + id + '"]' );
			}
			jQuery( document ).ready( function ( $ ) {
				$( '#select-give-style' ).change( function () {
					if ( $( this ).val() === 'button' ) {
						$( '#give-color-choice' ).slideDown();
					} else {
						$( '#give-color-choice' ).slideUp();
					}
				} );
			} );
		</script>

		<div id="choose-give-form" style="display: none;">
			<div class="wrap" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;">
				<div>
					<p><?php 
        echo sprintf(__('Use the form below to insert the shortcode for a %s', 'give'), give_get_forms_label_singular());
        ?>
</p>
					<?php 
        echo Give()->html->forms_dropdown(array('chosen' => true));
        ?>
				</div>
				<p class="submit">
					<input type="button" id="give-insert-download" class="button-primary" value="<?php 
        echo sprintf(__('Insert %s', 'give'), give_get_forms_label_singular());
        ?>
" onclick="insertGiveForm();" />
					<a id="give-cancel-download-insert" class="button-secondary" onclick="tb_remove();" title="<?php 
        _e('Cancel', 'give');
        ?>
"><?php 
        _e('Cancel', 'give');
        ?>
</a>
				</p>
			</div>
		</div>
	<?php 
    }
}
开发者ID:pantelicnevena,项目名称:newhanan,代码行数:73,代码来源:shortcode.php


示例14: form

    /**
     * Output the settings update form.
     *
     * @param array $instance Current settings.
     *
     * @return string
     */
    public function form($instance)
    {
        $defaults = array('title' => '', 'id' => '', 'float_labels' => 'global', 'display_style' => 'modal');
        $instance = wp_parse_args((array) $instance, $defaults);
        // Backward compatibility: Set float labels as default if, it was set as empty previous.
        $instance['float_labels'] = empty($instance['float_labels']) ? 'global' : $instance['float_labels'];
        // Query Give Forms
        $args = array('post_type' => 'give_forms', 'posts_per_page' => -1, 'post_status' => 'publish');
        $give_forms = get_posts($args);
        // Widget: Title
        ?>
<p>
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        esc_html_e('Title:', 'give');
        ?>
</label>
			<input type="text" class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" value="<?php 
        esc_attr_e($instance['title']);
        ?>
" /><br>
			<small class="give-field-description"><?php 
        esc_html_e('Leave blank to hide the widget title.', 'give');
        ?>
</small>
		</p><?php 
        // Widget: Give Form
        ?>
<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('id'));
        ?>
"><?php 
        printf(esc_html__('Give %s:', 'give'), give_get_forms_label_singular());
        ?>
</label>
			<select class="widefat" name="<?php 
        echo esc_attr($this->get_field_name('id'));
        ?>
" id="<?php 
        echo esc_attr($this->get_field_id('id'));
        ?>
">
				<option value="current"><?php 
        esc_html_e('— Select —', 'give');
        ?>
</option>
				<?php 
        foreach ($give_forms as $give_form) {
            ?>
					<option <?php 
            selected(absint($instance['id']), $give_form->ID);
            ?>
 value="<?php 
            echo esc_attr($give_form->ID);
            ?>
"><?php 
            echo $give_form->post_title;
            ?>
</option>
				<?php 
        }
        ?>
			</select><br>
			<small class="give-field-description"><?php 
        esc_html_e('Select a Give Form to embed in this widget.', 'give');
        ?>
</small>
		</p>

		<?php 
        // Widget: Display Style
        ?>
		<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('display_style'));
        ?>
"><?php 
        esc_html_e('Display style:', 'give');
        ?>
</label><br>
			<label for="<?php 
        echo $this->get_field_id('display_style');
        ?>
-onpage"><input type="radio" class="widefat" id="<?php 
//.........这里部分代码省略.........
开发者ID:wordimpress,项目名称:give,代码行数:101,代码来源:widget.php


示例15: __construct

 /**
  * Get things started.
  *
  * @since 1.0
  * @see   WP_List_Table::__construct()
  */
 public function __construct()
 {
     // Set parent defaults.
     parent::__construct(array('singular' => give_get_forms_label_singular(), 'plural' => give_get_forms_label_plural(), 'ajax' => false));
 }
开发者ID:wordimpress,项目名称:give,代码行数:11,代码来源:class-gateway-error-logs-list-table.php


示例16: give_dashboard_at_a_glance_widget

/**
 * Add download count to At a glance widget
 *
 * @since  1.0
 * @return void
 */
function give_dashboard_at_a_glance_widget($items)
{
    $num_posts = wp_count_posts('give_forms');
    if ($num_posts && $num_posts->publish) {
        $text = _n('%s Give ' . give_get_forms_label_singular(), '%s Give ' . give_get_forms_label_plural(), $num_posts->publish);
        $text = sprintf($text, number_format_i18n($num_posts->publish));
        if (current_user_can('edit_give_forms', get_the_ID())) {
            $text = sprintf('<a class="give-forms-count" href="edit.php?post_type=give_forms">%1$s</a>', $text);
        } else {
            $text = sprintf('<span class="give-forms-count">%1$s</span>', $text);
        }
        $items[] = $text;
    }
    return $items;
}
开发者ID:helgatheviking,项目名称:Give,代码行数:21,代码来源:dashboard-widgets.php


示例17: give_customers_view


//.........这里部分代码省略.........
							</a>
							<?php 
            do_action('give_donor_recent_purchases_actions', $customer, $payment);
            ?>
						</td>
					</tr>
				<?php 
        }
        ?>
			<?php 
    } else {
        ?>
				<tr>
					<td colspan="5"><?php 
        _e('No Donations Found', 'give');
        ?>
</td>
				</tr>
			<?php 
    }
    ?>
			</tbody>
		</table>

		<h3><?php 
    _e('Completed Donations', 'give');
    ?>
</h3>
		<?php 
    $donations = give_get_users_completed_donations($customer->email);
    ?>
		<table class="wp-list-table widefat striped downloads">
			<thead>
			<tr>
				<th><?php 
    echo give_get_forms_label_singular();
    ?>
</th>
				<th width="120px"><?php 
    _e('Actions', 'give');
    ?>
</th>
			</tr>
			</thead>
			<tbody>
			<?php 
    if (!empty($donations)) {
        ?>
				<?php 
        foreach ($donations as $donation) {
            ?>
					<tr>
						<td><?php 
            echo $donation->post_title;
            ?>
</td>
						<td>
							<a title="<?php 
            echo esc_attr(sprintf(__('View %s', 'give'), $donation->post_title));
            ?>
" href="<?php 
            echo esc_url(admin_url('post.php?action=edit&post=' . $donation->ID));
            ?>
">
								<?php 
            printf(__('View %s', 'give'), give_get_forms_label_singular());
            ?>
							</a>
						</td>
					</tr>
				<?php 
        }
        ?>
			<?php 
    } else {
        ?>
				<tr>
					<td colspan="2"><?php 
        _e('No Completed Donations Found', 'give');
        ?>
</td>
				</tr>
			<?php 
    }
    ?>
			</tbody>
		</table>

		<?php 
    do_action('give_donor_after_tables', $customer);
    ?>

	</div>

	<?php 
    do_action('give_donor_card_bottom', $customer);
    ?>

<?php 
}
开发者ID:pantelicnevena,项目名称:newhanan,代码行数:101,代码来源:customers.php


示例18: give_tools_recount_stats_display

/**
 * Display the recount stats tools
 *
 * @since       1.5
 * @return      void
 */
function give_tools_recount_stats_display()
{
    if (!current_user_can('manage_give_settings')) {
        return;
    }
    do_action('give_tools_recount_stats_before');
    ?>
	<div id="poststuff">
		<div class="postbox">

			<h2 class="hndle ui-sortable-handle"><span><?php 
    esc_html_e('Recount Stats', 'give');
    ?>
</span></h2>

			<div class="inside recount-stats-controls">
				<p><?php 
    esc_html_e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give');
    ?>
</p>
				<form method="post" id="give-tools-recount-form" class="give-export-form">

					<?php 
    wp_nonce_field('give_ajax_export', 'give_ajax_export');
    ?>

					<select name="give-export-class" id="recount-stats-type">
						<option value="0" selected="selected" disabled="disabled"><?php 
    esc_html_e('Please select an option', 'give');
    ?>
</option>
						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php 
    esc_html_e('Recalculate Total Donation Income Amount', 'give');
    ?>
</option>
						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php 
    esc_html_e('Recalculate Income Amount and Donation Counts for a Form', 'give');
    ?>
</option>
						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php 
    esc_html_e('Recalculate Income Amount and Donation Counts for All Forms', 'give');
    ?>
</option>
						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php 
    esc_html_e('Recalculate Donor Statistics', 'give');
    ?>
</option>
						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php 
    esc_html_e('Delete Test Transactions', 'give');
    ?>
</option>
						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php 
    esc_html_e('Delete All Data', 'give');
    ?>
</option>
						<?php 
    do_action('give_recount_tool_options');
    ?>
					</select>

					<span id="tools-form-dropdown" style="display: none">
						<?php 
    $args = array('name' => 'form_id', 'number' => -1, 'chosen' => true);
    echo Give()->html->forms_dropdown($args);
    ?>
					</span>

					<input type="submit" id="recount-stats-submit" value="<?php 
    esc_attr_e('Submit', 'give');
    ?>
" class="button-secondary"/>

					<br/>

					<span class="give-recount-stats-descriptions">
						<span id="recount-stats"><?php 
    esc_html_e('Recalculates the overall donation income amount.', 'give');
    ?>
</span>
						<span id="recount-form"><?php 
    printf(esc_html__('Recalculates the donation and income stats for a specific %s.', 'give'), give_get_forms_label_singular(true));
    ?>
</span>
						<span id="recount-all"><?php 
    printf(esc_html__('Recalculates the earnings and sales stats for all %s.', 'give'), give_get_forms_label_plural(true));
    ?>
</span>
						<span id="recount-customer-stats"><?php 
    esc_html_e('Recalculates the lifetime value and donation counts for all donors.', 'give');
    ?>
</span>
						<?php 
    do_action('give_recount_tool_descriptions');
    ?>
//.........这里部分代码省略.........
开发者ID:wordimpress,项目名称:give,代码行数:101,代码来源:tools.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP give_get_option函数代码示例发布时间:2022-05-15
下一篇:
PHP give_get_forms_label_plural函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap