Changeset 2607977
- Timestamp:
- 10/01/2021 05:28:19 PM (5 years ago)
- Location:
- philantro/trunk
- Files:
-
- 3 edited
-
options.php (modified) (1 diff)
-
philantro.php (modified) (6 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
philantro/trunk/options.php
r2542775 r2607977 128 128 129 129 130 <hr/> 131 <b>Donation Bar Shortcode</b> 132 <p class="muted">This will create a donation bar widget that allows your donors to select from up-to 4 suggested donation amounts or an open-ended amount. You can also designate a specific campaign, modify the button text and area headline. If you want to designate a specific campaign, access your Campaign IDs via your Philantro® dashboard.</p> 133 <br/><br/> 134 <p class="muted">Campaign ID is optional</p> 135 <p class="muted">Add up-to four suggested amounts, separated by a hyphen. i.e. (10-250-1,000-2,000).</p> 130 136 137 <code> 138 [donatebar button="<span class="highlighted">Donate</span>" amounts="<span class="highlighted">number</span>" id="<span class="highlighted">campaign_ID</span>"] 139 </code> 140 141 <br/> 142 <br/> 143 <p class="muted">For example:</p> 144 <code> 145 [donatebar button="Give" amounts="10-20-50-100"] 146 </code> 131 147 132 148 <hr/> -
philantro/trunk/philantro.php
r2603291 r2607977 4 4 * Plugin URI: http://www.philantro.com 5 5 * Description: Welcome to the better way of accepting donations. <strong>Official plugin for the Philantro® platform.</strong><br/> To get started: Activate and then go to your Philantro® settings page on the Wordpress dashboard to set up your Organization ID. 6 * Version: 5.1 1.26 * Version: 5.12 7 7 * Author: Philantro Inc. 8 8 * Author URI: http://www.philantro.com … … 43 43 $currentScreen = get_current_screen(); 44 44 45 46 45 if( $currentScreen->id === "toplevel_page_philantro" ) { 47 46 48 47 add_action( 'admin_head', 'admin_css' ); 48 add_action('admin_print_footer_scripts', 'philantro' ); 49 49 50 50 wp_enqueue_style( 'color-code-style', plugin_dir_url( __FILE__ ) . '/css/philantro.css' ); … … 224 224 endif; 225 225 } 226 227 226 227 228 // Add Shortcode 229 function donation_bar_shortcode( $atts ) { 230 231 $id = null; 232 $button = 'Donate'; 233 $color = null; 234 $amounts = null; 235 $amount_variable = ''; 236 237 // Attributes 238 extract( shortcode_atts( 239 array( 240 'id' => null, 241 'button' => null, 242 'color' => null, 243 'amounts' => null, 244 ), $atts ) 245 ); 246 247 if(!empty($amounts)){ 248 249 $amounts = explode("-", $amounts); 250 $i = 0; 251 252 if(is_array($amounts)){ 253 254 foreach($amounts as $amount){ 255 $raw_amount = filter_var(trim($amount), FILTER_SANITIZE_NUMBER_INT,FILTER_FLAG_ALLOW_THOUSAND); 256 $amount_variable .= !empty($raw_amount)?$raw_amount . '-':''; 257 $i++; 258 } 259 $amount_variable = rtrim($amount_variable,'-'); 260 261 } 262 263 if($amount_variable != null): 264 return '<div class="philantro-bar" data-amount="'. $amount_variable .'" data-campaign="'. $id .'" data-button="'. $button .'" data-color="'. $color .'"></div>'; 265 endif; 266 } 267 } 228 268 229 269 … … 264 304 endif; 265 305 266 306 $currentScreen = get_current_screen(); 267 307 $current_user = wp_get_current_user(); 268 308 $plugin_data = get_plugin_data(plugin_dir_path( __FILE__ ) . '/philantro.php'); 269 $currentScreen = get_current_screen();270 271 309 272 310 if($currentScreen->parent_file == 'philantro'): … … 382 420 add_action('admin_menu', 'admin_menu_philantro'); 383 421 add_action('admin_print_footer_scripts', 'load_campaigns' ); 384 add_action('admin_print_footer_scripts', 'philantro' );385 422 add_shortcode( 'donate', 'donate_shortcode' ); 386 423 add_shortcode( 'donateform', 'donate_form_shortcode' ); 387 424 add_shortcode( 'event', 'event_shortcode' ); 388 425 add_shortcode( 'fundraise', 'fundraise_shortcode' ); 426 add_shortcode( 'donatebar', 'donation_bar_shortcode' ); 389 427 add_shortcode( 'twobutton', 'two_button_shortcode' ); 390 428 add_action('enqueue_block_editor_assets', 'philantro_button_block'); … … 400 438 add_shortcode( 'donateform', 'donate_form_shortcode' ); 401 439 add_shortcode( 'event', 'event_shortcode' ); 440 add_shortcode( 'donatebar', 'donation_bar_shortcode' ); 402 441 add_shortcode( 'fundraise', 'fundraise_shortcode' ); 403 442 add_shortcode( 'twobutton', 'two_button_shortcode' ); -
philantro/trunk/readme.txt
r2603291 r2607977 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html 9 Stable tag: 5.1 1.29 Stable tag: 5.12 10 10 11 11 Securely accept one-time/recurring donations with automated donor records, analytics and more on the perfect dashboard. … … 68 68 = Secure Processing Powered By Stripe = 69 69 70 > We've partnered with [Stripe](https://stripe.com /gallery), the payment processor behind Twitter, FourSquare and Pinterest to offer nonprofits secure PCI compliant processing, two-day desposits + fraud protection.70 > We've partnered with [Stripe](https://stripe.com), the payment processor behind Twitter, FourSquare and Pinterest to offer nonprofits secure PCI compliant processing, two-day desposits + fraud protection. 71 71 72 72 … … 96 96 >[donate label="Donate"] 97 97 >[donateform] 98 >[event id="XXXXXX"] 99 >[fundraise id="XXXXXX"] 98 >[event id="X"] 99 >[fundraise id="X"] 100 >[donatebar button="X" amounts="X" id="X"] 100 101 101 102
Note: See TracChangeset
for help on using the changeset viewer.