Plugin Directory

Changeset 2607977


Ignore:
Timestamp:
10/01/2021 05:28:19 PM (5 years ago)
Author:
Philantro
Message:

Update description, block editors and settings page for BETA program integration.

Location:
philantro/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • philantro/trunk/options.php

    r2542775 r2607977  
    128128
    129129
     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&reg; 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>
    130136
     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>
    131147
    132148        <hr/>
  • philantro/trunk/philantro.php

    r2603291 r2607977  
    44     * Plugin URI: http://www.philantro.com
    55     * Description: Welcome to the better way of accepting donations. <strong>Official plugin for the Philantro&reg; platform.</strong><br/> To get started: Activate and then go to your Philantro&reg; settings page on the Wordpress dashboard to set up your Organization ID.
    6      * Version: 5.11.2
     6     * Version: 5.12
    77     * Author: Philantro Inc.
    88     * Author URI: http://www.philantro.com
     
    4343        $currentScreen = get_current_screen();
    4444       
    45        
    4645        if( $currentScreen->id === "toplevel_page_philantro" ) {
    4746           
    4847            add_action( 'admin_head', 'admin_css' );
     48            add_action('admin_print_footer_scripts', 'philantro' );
    4949           
    5050            wp_enqueue_style( 'color-code-style', plugin_dir_url( __FILE__ ) . '/css/philantro.css' );
     
    224224        endif;
    225225    }
    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    }
    228268   
    229269   
     
    264304        endif;
    265305       
    266        
     306        $currentScreen = get_current_screen();
    267307        $current_user =  wp_get_current_user();
    268308        $plugin_data = get_plugin_data(plugin_dir_path( __FILE__ ) . '/philantro.php');
    269         $currentScreen = get_current_screen();
    270        
    271309       
    272310        if($currentScreen->parent_file == 'philantro'):
     
    382420        add_action('admin_menu', 'admin_menu_philantro');
    383421        add_action('admin_print_footer_scripts', 'load_campaigns' );
    384         add_action('admin_print_footer_scripts', 'philantro' );
    385422        add_shortcode( 'donate', 'donate_shortcode' );
    386423        add_shortcode( 'donateform', 'donate_form_shortcode' );
    387424        add_shortcode( 'event', 'event_shortcode' );
    388425        add_shortcode( 'fundraise', 'fundraise_shortcode' );
     426        add_shortcode( 'donatebar', 'donation_bar_shortcode' );
    389427        add_shortcode( 'twobutton', 'two_button_shortcode' );
    390428        add_action('enqueue_block_editor_assets', 'philantro_button_block');
     
    400438        add_shortcode( 'donateform', 'donate_form_shortcode' );
    401439        add_shortcode( 'event', 'event_shortcode' );
     440        add_shortcode( 'donatebar', 'donation_bar_shortcode' );
    402441        add_shortcode( 'fundraise', 'fundraise_shortcode' );
    403442        add_shortcode( 'twobutton', 'two_button_shortcode' );
  • philantro/trunk/readme.txt

    r2603291 r2607977  
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
    9 Stable tag: 5.11.2
     9Stable tag: 5.12
    1010
    1111Securely accept one-time/recurring donations with automated donor records, analytics and more on the perfect dashboard.
     
    6868= Secure Processing Powered By Stripe =
    6969
    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.
    7171
    7272
     
    9696>[donate label="Donate"]
    9797>[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"]
    100101
    101102
Note: See TracChangeset for help on using the changeset viewer.