Changeset 1666247
- Timestamp:
- 05/29/2017 06:32:04 AM (9 years ago)
- Location:
- bb-connect-for-give-donations
- Files:
-
- 8 edited
-
assets/screenshot-2.png (modified) (previous)
-
assets/screenshot-3.png (modified) (previous)
-
trunk/bb-connect-give.php (modified) (8 diffs)
-
trunk/modules/bbc-give-forms/bbc-give-forms.php (modified) (3 diffs)
-
trunk/modules/bbc-give-forms/includes/frontend.php (modified) (2 diffs)
-
trunk/modules/bbc-give-goal/bbc-give-goal.php (modified) (4 diffs)
-
trunk/modules/bbc-give-goal/includes/frontend.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bb-connect-for-give-donations/trunk/bb-connect-give.php
r1599407 r1666247 4 4 * Plugin URI: https://wordpress.org/plugins/bb-connect-for-give-donations/ 5 5 * Description: Easily integrate Give Donations with Beaver Builder. 6 * Version: 1.16 * Version: 2.0 7 7 * Author: PurposeWP 8 8 * Author URI: https://purposewp.com … … 14 14 */ 15 15 16 /**17 * WordPress resources for developers18 *19 * Codex: https://codex.wordpress.org/20 * Plugin Handbook: https://developer.wordpress.org/plugins/21 * Coding Standards: http://make.wordpress.org/core/handbook/coding-standards/22 * Contribute: https://make.wordpress.org/23 */24 25 16 // Exit if accessed directly. 26 17 if ( ! defined( 'ABSPATH' ) ) { … … 29 20 30 21 if ( ! class_exists( 'BBC_GiveWP' ) ) : 31 /**32 * Main BBC_GiveWP Class.33 *34 * @since 1.035 */36 22 final class BBC_GiveWP { 37 23 /** … … 58 44 59 45 /** 60 * Main BBC_GiveWP Instance. 61 * 62 * Insures that only one instance of BBC_GiveWP exists in memory at any one 63 * time. Also prevents needing to define globals all over the place. 46 * Main BBC_GiveWP Instance 64 47 * 65 48 * @since 1.0 66 49 * @static 67 * @staticvar array $instance68 * @uses BBC_GiveWP::define_constants() Setup the constants needed.69 * @uses BBC_GiveWP::load_modules() Include the required files.70 * @uses BBC_GiveWP::load_textdomain() load the language files.71 50 * @see BBC_GiveWP() 72 51 * @return object|BBC_GiveWP The one true BBC_GiveWP 73 52 */ 74 public function instance() {53 public static function instance() { 75 54 76 55 if ( ! isset( self::$instance ) && ! ( self::$instance instanceof BBC_GiveWP ) ) { … … 91 70 * Throw error on object clone. 92 71 * 93 * The whole idea of the singleton design pattern is that there is a single94 * object therefore, we don't want the object to be cloned.95 *96 72 * @since 1.0 97 73 * @access protected … … 141 117 142 118 /** 143 * Initiate the plugin s functions119 * Initiate the plugin 144 120 */ 145 121 public function init() { 146 122 add_action( 'plugins_loaded', array( $this, 'plugins_check' ) ); 147 123 add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) ); 148 add_action( 'init', array( $this, ' load_modules' ) );124 add_action( 'init', array( $this, 'includes' ) ); 149 125 } 150 126 … … 181 157 * @return void 182 158 */ 183 public function load_modules() { 184 // Modules 159 public function includes() { 185 160 if ( class_exists( 'FLBuilder' ) ) { 161 // Custom Fields 162 include_once BBC_GIVE_DIR . 'fields/bbc-toggle/bbc-toggle.php'; 163 164 // Modules 186 165 include_once BBC_GIVE_DIR . 'modules/bbc-give-forms/bbc-give-forms.php'; 187 166 include_once BBC_GIVE_DIR . 'modules/bbc-give-goal/bbc-give-goal.php'; 167 include_once BBC_GIVE_DIR . 'modules/bbc-give-account/bbc-give-account.php'; 188 168 } 189 169 } … … 254 234 * The main function that returns BBC_GiveWP 255 235 * 256 * The main function responsible for returning the one true BBC_GiveWP instance to functions everywhere. Use this257 * function like you would a global variable, except without needing to declare the global.258 *259 * Example: <?php $give = BBC_Give(); ?>260 *261 * @credit Pippin Williamson - This pattern is pretty much a direct copy of Easy Digital Downloads's main wrapper.262 236 * @since 1.0 263 * @return object|BBC_GiveWP one trueBBC_GiveWP instance.237 * @return object|BBC_GiveWP The main BBC_GiveWP instance. 264 238 */ 265 239 function BBC_Give() { -
bb-connect-for-give-donations/trunk/modules/bbc-give-forms/bbc-give-forms.php
r1596011 r1666247 5 5 * 6 6 * @class BBC_Give_Forms 7 * @since 1.0 7 8 */ 8 9 class BBC_Give_Forms extends FLBuilderModule { … … 31 32 */ 32 33 public static function list_forms() { 33 $list = array( '' => __( ' None', 'bbc-give' ) );34 $list = array( '' => __( 'Select a Form', 'bbc-give' ) ); 34 35 35 36 $forms = get_posts( array( … … 62 63 'options' => BBC_Give_Forms::list_forms() 63 64 ), 65 ) 66 ), 67 'form_settings' => array( // Section 68 'title' => '', // Section Title 69 'fields' => array( // Section Fields 64 70 'show_title' => array( 65 'type' => 'select', 66 'label' => __( 'Show Title', 'bbc-give' ), 67 'default' => 'true', 68 'options' => array( 69 'true' => 'Show', 70 'false' => 'Hide' 71 ) 71 'type' => 'bbc-toggle', 72 'label' => __( 'Show Title', 'bbc-give' ), 73 'default' => 'true', 74 'options' => array( 75 'true' => __( 'Show', 'bbc-give' ), 76 'false' => __( 'Hide', 'bbc-give' ), 77 ), 78 'help' => __( 'Show/hide the form title. Default is “show”', 'bbc-give' ) 72 79 ), 73 80 'show_goal' => array( 74 'type' => 'select', 75 'label' => __( 'Show Goal', 'bbc-give' ), 76 'default' => 'true', 77 'options' => array( 78 'true' => 'Show', 79 'false' => 'Hide' 80 ) 81 'type' => 'bbc-toggle', 82 'label' => __( 'Show Goal', 'bbc-give' ), 83 'default' => 'false', 84 'options' => array( 85 'true' => __( 'Show', 'bbc-give' ), 86 'false' => __( 'Hide', 'bbc-give' ), 87 ), 88 'help' => __( 'Show/hide the form goal. Default is “hide”', 'bbc-give' ) 81 89 ), 82 90 'show_content' => array( 83 91 'type' => 'select', 84 92 'label' => __( 'Show Content', 'bbc-give' ), 85 'default' => ' ',93 'default' => 'default', 86 94 'options' => array( 87 '' => ' - ', 88 'none' => 'No Content', 89 'above' => 'Display content ABOVE the fields.', 90 'below' => 'Display content BELOW the fields.' 91 ) 95 'default' => 'Use default setting', 96 'none' => 'No Content', 97 'above' => 'Display content ABOVE the fields.', 98 'below' => 'Display content BELOW the fields.' 99 ), 100 'help' => __( 'Show/hide the form content. You can choose from None, Below, or Above. This will override the default settings of the form. The Default value is whatever you chose when you created the form.', 'bbc-give' ) 92 101 ), 93 102 'display_style' => array( 94 103 'type' => 'select', 95 104 'label' => __( 'Display Style', 'bbc-give' ), 96 'default' => ' ',105 'default' => 'default', 97 106 'options' => array( 98 '' => ' - ', 99 'onpage' => 'Show on page.', 100 'reveal' => 'Reveal on click.', 101 'modal' => 'Popup on click', 102 'button' => 'Button Only', 103 ) 107 'default' => 'Use default setting', 108 'onpage' => 'Show on page.', 109 'reveal' => 'Reveal on click.', 110 'modal' => 'Popup on click', 111 'button' => 'Button Only', 112 ), 113 'help' => __( 'Override the setting you set when you created the form. You can choose from “Show on Page”, “Reveal on Click”, or “Modal Window on Click”, or “Button only”.', 'bbc-give' ) 104 114 ), 105 115 'float_labels' => array( 106 116 'type' => 'select', 107 117 'label' => __( 'Floating Labels', 'bbc-give' ), 108 'default' => ' ',118 'default' => 'default', 109 119 'options' => array( 110 ' ' => ' -',120 'default' => 'Use default setting', 111 121 'enabled' => 'Enabled', 112 122 'disabled' => 'Disabled', 113 ) 123 ), 124 'help' => __( 'Enable/disable Floating labels. The default is whatever you chose when you created the form. This setting overrides that default.', 'bbc-give' ) 114 125 ), 115 126 ) -
bb-connect-for-give-donations/trunk/modules/bbc-give-forms/includes/frontend.php
r1587907 r1666247 1 <div class=" fl-example-text">1 <div class="bbc-give-form"> 2 2 <?php 3 3 if ( $settings->select_form_field ) { 4 $show_content = isset( $settings->show_content )4 $show_content = 'default' !== $settings->show_content 5 5 ? $settings->show_content 6 6 : get_post_meta( $settings->select_form_field, '_give_content_option', true ); 7 7 8 $display_style = isset( $settings->display_style )8 $display_style = 'default' !== $settings->display_style 9 9 ? $settings->display_style 10 10 : get_post_meta( $settings->select_form_field, '_give_payment_display', true ); 11 11 12 $float_labels = isset( $settings->float_labels )12 $float_labels = 'default' !== $settings->float_labels 13 13 ? $settings->float_labels 14 14 : get_post_meta( $settings->select_form_field, '_give_form_floating_labels', true ); … … 19 19 $settings->show_goal, 20 20 $show_content, 21 $display_style,22 $float_labels21 $display_style, 22 $float_labels 23 23 ); 24 24 -
bb-connect-for-give-donations/trunk/modules/bbc-give-goal/bbc-give-goal.php
r1587907 r1666247 5 5 * 6 6 * @class BBC_Give_Goal 7 * @since 1.0 7 8 */ 8 9 class BBC_Give_Goal extends FLBuilderModule { … … 15 16 public function __construct() { 16 17 parent::__construct( array( 17 'name' => __( 'Donation Form Goal', 'bbc-give' ), 18 'description' => __( 'Add your Give Donation Form Goal to your page.', 'bbc-give' ), 19 'category' => __( 'Give Modules', 'bbc-give' ), 20 'dir' => BBC_GIVE_DIR . 'modules/bbc-give-goal/', 21 'url' => BBC_GIVE_DIR . 'modules/bbc-give-goal/', 22 'editor_export' => true, // Defaults to true and can be omitted. 23 'enabled' => true, // Defaults to true and can be omitted. 18 'name' => __( 'Donation Form Goal', 'bbc-give' ), 19 'description' => __( 'Add your Give Donation Form Goal to your page.', 'bbc-give' ), 20 'category' => __( 'Give Modules', 'bbc-give' ), 21 'dir' => BBC_GIVE_DIR . 'modules/bbc-give-goal/', 22 'url' => BBC_GIVE_DIR . 'modules/bbc-give-goal/', 24 23 ) ); 25 24 } … … 31 30 */ 32 31 public static function list_forms() { 33 $list = array( '' => __( ' None', 'bbc-give' ) );32 $list = array( '' => __( 'Select a Form', 'bbc-give' ) ); 34 33 35 34 $forms = get_posts( array( … … 62 61 'options' => BBC_Give_Goal::list_forms() 63 62 ), 64 'show_text' => array( 65 'type' => 'select', 66 'label' => __( 'Show Text', 'bbc-give' ), 67 'default' => 'true', 68 'options' => array( 69 'true' => 'Show', 70 'false' => 'Hide' 71 ) 63 ) 64 ), 65 'form_settings' => array( // Section 66 'title' => '', // Section Title 67 'fields' => array( // Section Fields 68 'show_text' => array( 69 'type' => 'bbc-toggle', 70 'label' => __( 'Show Text', 'bbc-give' ), 71 'default' => 'true', 72 'options' => array( 73 'true' => __( 'Show', 'bbc-give' ), 74 'false' => __( 'Hide', 'bbc-give' ), 75 ), 76 'help' => __( 'Displays the goal text. Default is “Show”', 'bbc-give' ) 72 77 ), 73 78 'show_bar' => array( 74 'type' => 'select', 75 'label' => __( 'Show Progress Bar', 'bbc-give' ), 76 'default' => 'true', 77 'options' => array( 78 'true' => 'Show', 79 'false' => 'Hide' 80 ) 79 'type' => 'bbc-toggle', 80 'label' => __( 'Show Progress Bar', 'bbc-give' ), 81 'default' => 'true', 82 'options' => array( 83 'true' => __( 'Show', 'bbc-give' ), 84 'false' => __( 'Hide', 'bbc-give' ), 85 ), 86 'help' => __( 'Shows the progress bar. Default is “Show”', 'bbc-give' ) 81 87 ), 82 88 ) 83 ) 89 ), 84 90 ) 85 91 ) -
bb-connect-for-give-donations/trunk/modules/bbc-give-goal/includes/frontend.php
r1587907 r1666247 1 <div class=" fl-example-text">1 <div class="bbc-give-goal"> 2 2 <?php 3 3 if ( $settings->select_form_field ) { -
bb-connect-for-give-donations/trunk/readme.txt
r1596027 r1666247 3 3 Tags: beaver builder, give, donations, nonprofits, fundraising 4 4 Requires at least: 4.4 5 Tested up to: 4.7. 26 Stable tag: 1.15 Tested up to: 4.7.5 6 Stable tag: 2.0 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 24 24 == Screenshots == 25 25 26 1. Give Modules 27 2. Donation Form Module 28 3. Donation Form Goal Module 26 1. Donation Form and Goal modules 27 2. Donation Form settings 28 3. Donation Form Goal settings 29 4. Account Details settings 30 5. Account Details module 29 31 30 32 == Installation == … … 54 56 == Changelog == 55 57 56 = [1.0] - 2017-01-27 = 57 * Initial release 58 = [2.0] - 2017-05-28 = 59 * New: Give Account Details module 60 * Enhancement: Added help tooltips 61 * Enhancement: Added Show/Hide toggles 62 * Fix: Non-static method called statically 58 63 59 64 = [1.1] - 2017-02-14 = 60 65 * Enhancement: Added new Button Only display style 66 67 = [1.0] - 2017-01-27 = 68 * Initial release
Note: See TracChangeset
for help on using the changeset viewer.