Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter code3creative

    (@igniswebdesign)

    Yah I see those but they seem to all be ones that pull from the WP media library or the WP root install – not a local file drive like a company’s shared drive or something like that.

    Plus the functionality needs to be there to email as an attachment without downloading the file.

    Thread Starter code3creative

    (@igniswebdesign)

    Yea I didn’t realize Paypal was a pro feature. I have since transitioned to another plugin. Thank you.

    Thread Starter code3creative

    (@igniswebdesign)

    It’s back up after calling the host and they worked magic. Still waiting for a call back explaining what happened. I don’t have any security plugins installed. What’s even more wierd is that another site that I manage went down the exact same time with a 403 Forbidden error. It came back online the same time this site I was working on came back up…

    Thread Starter code3creative

    (@igniswebdesign)

    AWESOME!!!

    Thank you so much! I am still learning of course but this was super helpful. Thank you!

    • This reply was modified 8 years, 3 months ago by code3creative.
    Thread Starter code3creative

    (@igniswebdesign)

    Sounds great, thanks Matt!

    Thread Starter code3creative

    (@igniswebdesign)

    So I got the updated code from you guys and I added it in. It works and sends the correct tag in the confirmation email, but I needed to change it to a dropdown, not text area.

    I changed it and it displays properly on page but when I click the “Donate” button to submit it gives me an error “Error: Please enter a message for your engraving”

    Below is how I changed the code you gave me. Where am I going wrong?

    /**
     * Plugin Name: Give - Example Custom Field Integration
     * Plugin URI: https://givewp.com/documentation/developers/how-to-create-custom-form-fields/
     * Description: This plugin demonstrates adds custom fields to your Give give forms with validation, email functionality, and field data output on the payment record within wp-admin.
     * Version: 1.0
     * Author: WordImpress
     * Author URI: https://givewp.com
     *
     * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
     * General Public License version 2, as published by the Free Software Foundation.  You may NOT assume
     * that you can use any other version of the GPL.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
     * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     *
     * NOTE: This is not a "snippet" but a plugin that you can install and activate. You can put it in a
     * folder in your /plugins/ directory, or even just drop it directly into the /plugins/ directory
     * and it will activate like any other plugin.
     *
     * DISCLAIMER: This is provided as an EXAMPLE of how to do custom fields for Give. We provide no
     * guarantees if you put this on a live site. And we do not offer Support for this code at all.
     * It is simply a free resource for your purposes.
     */
    /**
     * Custom Form Fields
     *
     * @param $form_id
     */
    function myprefix123_give_donations_custom_form_fields( $form_id ) {
    	// Only display for forms with the IDs "415";
    	// Remove "If" statement to display on all forms
    	// For a single form, use this instead:
    	// if ( $form_id == 415) {
    	$forms = array( 415 );
    	if ( in_array( $form_id, $forms ) ) {
    		?>
    		<div id="give-message-wrap" class="form-row form-row-wide">
    			<label class="give-label"
    				   for="give-engraving-message"><?php _e( 'What would you like your donation to support?', 'give' ); ?><?php if ( give_field_is_required( 'give_engraving_message', $form_id ) ) : ?>
    					<span class="give-required-indicator">*</span>
    				<?php endif ?><span class="give-tooltip give-icon give-icon-question"
    									data-tooltip="<?php _e( 'Please provide the names that should be engraved on the plaque.', 'give' ) ?>"></span></label>
    
    			<select><option value="">Select...</option><option value="T-Shirts/Sweatshirts/Hats">T-Shirts/Sweatshirts/Hats</option><option value="Africa">Africa</option><option value="Armenia">Armenia</option><option value="Bolivia">Bolivia</option><option value="Columbia">Columbia</option><option value="Dominican Republic">Dominica Republic</option><option value="Peru">Peru</option><option value="No Preference">No Preference</option> class="give-textarea" name="give_engraving_message" id="give-engraving-message"></select>
    		</div>
    		<?php
    	}
    }
    add_action( 'give_after_donation_levels', 'myprefix123_give_donations_custom_form_fields', 10, 1 );
    /**
     * Require custom field "Engraving message" field.
     *
     * @param $required_fields
     * @param $form_id
     *
     * @return array
     */
    function myprefix123_give_donations_require_fields( $required_fields, $form_id ) {
    	// Only validate the form with the IDs "415";
    	// Remove "If" statement to display on all forms
    	// For a single form, use this instead:
    	// if ( $form_id == 415) {
    	$forms = array( 415 );
    	if ( in_array( $form_id, $forms ) ) {
    		$required_fields['give_engraving_message'] = array(
    			'error_id'      => 'invalid_give_engraving_message',
    			'error_message' => __( 'Please enter a message for your engraving', 'give' ),
    		);
    	}
    	return $required_fields;
    }
    add_filter( 'give_donation_form_required_fields', 'myprefix123_give_donations_require_fields', 10, 2 );
    /**
     * Add Field to Payment Meta
     *
     * Store the custom field data custom post meta attached to the <code>give_payment</code> CPT.
     *
     * @param $payment_id
     * @param $payment_data
     *
     * @return mixed
     */
    function myprefix123_give_donations_save_custom_fields( $payment_id, $payment_data ) {
    	if ( isset( $_POST['give_engraving_message'] ) ) {
    		$message = wp_strip_all_tags( $_POST['give_engraving_message'], true );
    		add_post_meta( $payment_id, 'give_engraving_message', $message );
    	}
    }
    add_action( 'give_insert_payment', 'myprefix123_give_donations_save_custom_fields', 10, 2 );
    /**
     * Show Data in Transaction Details
     *
     * Show the custom field(s) on the transaction page.
     *
     * @param $payment_id
     */
    function myprefix123_give_donations_purchase_details( $payment_id ) {
    	$engraving_message = get_post_meta( $payment_id, 'give_engraving_message', true );
    	if ( $engraving_message ) : ?>
    
    		<div id="give-engraving-details" class="postbox">
    			<h3 class="hndle"><?php esc_html_e( 'Engraving Message', 'give' ); ?></h3>
    			<div class="inside" style="padding-bottom:10px;">
    				<?php echo wpautop( $engraving_message ); ?>
    			</div>
    		</div>
    
    	<?php endif;
    }
    add_action( 'give_view_order_details_billing_before', 'myprefix123_give_donations_purchase_details', 10, 1 );
    /**
     * Adds a Custom "Engraved Message" Tag
     *
     * This function creates a custom Give email template tag.
     */
    function my_custom_prefix_add_sample_referral_tag() {
    	give_add_email_tag(
    			'engraving_message',
    			'This outputs the Engraved Message',
    			'my_custom_prefix_get_donation_referral_data'
    	);
    }
    add_action( 'give_add_email_tags', 'my_custom_prefix_add_sample_referral_tag' );
    /**
     * Get Donation Referral Data
     *
     * Example function that returns Custom field data if present in payment_meta;
     * The example used here is in conjunction with the Give documentation tutorials.
     *
     * @param array $tag_args Array of arguments
     *
     * @return string
     */
    function my_custom_prefix_get_donation_referral_data( $tag_args ) {
    	$engraving_message = get_post_meta( $tag_args['payment_id'], 'give_engraving_message', true );
    	$output = __( 'No referral data found.', 'give' );
    	if ( ! empty( $engraving_message ) ) {
    		$output = wp_kses_post( $engraving_message );
    	}
    	return $output;
    }
    • This reply was modified 8 years, 3 months ago by code3creative.
    Thread Starter code3creative

    (@igniswebdesign)

    Nevermind

    Thread Starter code3creative

    (@igniswebdesign)

    Ok cool, I cleared my browser cache and it worked. Thanks!

    Thread Starter code3creative

    (@igniswebdesign)

    That didn’t work. I also tried adding width: 100%. Neither made anything change.

    Thread Starter code3creative

    (@igniswebdesign)

    I did that, but it impacts desktop viewing as well. I only want the slider to be auto height in mobile viewing (max-width: 768px)

    Thread Starter code3creative

    (@igniswebdesign)

    We do and we purged that cache and that didn’t work. I have never seen anything like this before.

    Thread Starter code3creative

    (@igniswebdesign)

    Ummmmmmm ok no clue what happened but now everything works including Chrome login. Did what I did fix it????

    Thread Starter code3creative

    (@igniswebdesign)

    No it just reloads the login page. Nothing about invalid user name or anything. I just tried it on my personal iPhone using Safari and it did the same problem. I tried it with my friend’s phone using Safari and it worked… very confusing.

    I think it may have to do with the URL or something. Just now I was using IE. I went to the WP general settings and changed the URL from http://clackamasfire.com to http://www.clackamasfire.com and now its doing the same thing it was doing with Chrome now in IE. Now I can’t get in to the site at all!

    Thread Starter code3creative

    (@igniswebdesign)

    I tried clearing my entire Chrome cache including browsing history, passwords, auto fills forms, etc. I then tried to log in again and it still doesn’t work. I even tried logging in as a different user in to WP and still no.

    I’m able to log in still to other WP sites I manage using Chrome with no problem.

Viewing 14 replies - 1 through 14 (of 14 total)