Plugin Directory

Changeset 1564814


Ignore:
Timestamp:
12/30/2016 07:27:49 AM (9 years ago)
Author:
rkbcomputing
Message:

Version 0.5.8 - Changed how the thankyou page works.

Location:
wp-postcode-lookup-form/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-postcode-lookup-form/trunk/options.php

    r1564766 r1564814  
    113113    add_settings_section( 'main_section', 'Main Settings', 'wpplf23_section_cb', __FILE__ );
    114114    add_settings_field( 'form_redirect', 'Postcode form redirect page:', 'wpplf23_form_redirect_setting', __FILE__, 'main_section' );
    115     add_settings_field( 'thankyou_page', 'Thankyou Page:', 'wpplf23_thankyou_page_setting', __FILE__, 'main_section' );
     115    add_settings_field( 'thankyou_page', 'Thankyou Page ID:', 'wpplf23_thankyou_page_setting', __FILE__, 'main_section' );
    116116    add_settings_field( 'table_items_per_page', 'Table items per page:', 'wpplf23_table_items_per_page_setting', __FILE__, 'main_section' );
    117117    add_settings_field( 'debug_log_enable', 'Enable debug log:', 'wpplf23_debug_log_enable_setting', __FILE__, 'main_section' );
     
    168168function wpplf23_thankyou_page_setting() { 
    169169    $options = get_option( 'wpplf23_plugin_options' );
     170    ?>
     171        <input name='wpplf23_plugin_options[thankyou_page]' type='number' value='<?php if ( ( isset( $options['thankyou_page'] ) ) ) { echo $options['thankyou_page']; } ?>' />
     172    <?php
     173
     174   
     175    /*
    170176    $settings = array(
    171177        'textarea_name' => 'wpplf23_plugin_options[thankyou_page]',
     
    187193        wp_editor( $content, 'edit_thankyou_page', $settings );
    188194    }
     195    */
    189196}
    190197
  • wp-postcode-lookup-form/trunk/readme.txt

    r1564766 r1564814  
    55Requires at least: 4.0
    66Tested up to: 4.7
    7 Stable tag:  4.0
     7Stable tag:  0.5.8
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    31311. Activate the plugin through the "Plugins" menu in WordPress
    32321. Add this shortcode To the page you want to show the form on: [postcode_lookup_form_sc]
    33 1. Create a page to hold the main form contents and place the same shortcode in it.
    34 1. Sign up to Google maps API and reCAPTCHA to get your access keys.
    35 1. Go to the options (Postcode Lookup Form in admin menu). In the option called "Postcode form redirect page" type the URL or page name of a page you have
    36 created for the main form (E.g. "/my-lead-gen-form/").
    37 1. Now configure your options for notification emails, reCAPTCHA, Google Maps API key etc.
    38 1. You can manage your submissions from the same admin menu.
     331. Create a page to hold the main form contents and place the same shortcode in it
     341. Sign up to Google maps API and reCAPTCHA to get your access keys
     351. Create a thankyou page and note down the 'page id'. The post content from this page will be displayed on the same page after successful submission,
     36it will not redirected.
     371. Go to the options (Postcode Lookup Form in admin menu). In the option called "Postcode form redirect page" type the URL or page name of a page you have
     38created for the main form (E.g. "/my-lead-gen-form/")
     391. In the 'Thankyou Page ID' field put the page ID you noted earlier.
     401. Now configure your options for notification emails, reCAPTCHA, Google Maps API key etc
     411. You can manage your submissions from the same admin menu
    3942
    4043== Frequently asked questions ==
     
    5558== Changelog ==
    5659
     60= 0.5.8 =
     61* Changed how the thankyou page works. You now have to create a page manually and enter it's post id in the options
     62
    5763= 0.5.7 =
    5864* Added UK telephone number validation capabilty
  • wp-postcode-lookup-form/trunk/wp-postcode-lookup-form.php

    r1564766 r1564814  
    22/**
    33 * Plugin Name: WP Postcode Lookup Form
    4  * Plugin URI:  http://rkbcomputing.co.uk/portfolio-items/wordpress-uk-postcode-lead-generation-plugin
    5  * Description: This is a multi-page contact form with postcode validation and address auto-completion.
    6  * Version: 0.5.7
     4 * Plugin URI: https://wordpress.org/plugins/wp-postcode-lookup-form/
     5 * Description: WP Postcode Lookup Form plugin was designed to help you easily add lead generation functionality to your Wordpress websites with UK address auto-complete.
     6 * Version: 0.5.8
    77 * Author: RKB Computing
    88 * Author URI: http://rkbcomputing.co.uk
     
    8282    $options = get_option( 'wpplf23_plugin_options' ); 
    8383    $form_redirect_option = $options['form_redirect'];
    84 
     84    $thankyou_page_option = $options['thankyou_page'];
     85   
    8586    if ( ( isset( $options['recaptcha_enable'] ) ) ) {
    8687        $recaptcha_enable_option = $options['recaptcha_enable'];
     
    356357
    357358        if ( isset( $options['thankyou_page'] ) && $options['thankyou_page'] != '' ) {
    358             $output = $options['thankyou_page'];
    359             return $output ;
     359
     360                $my_postid = $thankyou_page_option;//This is page id or post id
     361                $content_post = get_post($my_postid);
     362                $content = $content_post->post_content;
     363                $content = apply_filters('the_content', $content);
     364                $content = str_replace(']]>', ']]&gt;', $content);
     365
     366                return $content;
     367           
     368            //$output = $options['thankyou_page'];
     369            //return $output ;
    360370        } else {
     371            header("Refresh:0; url=$thankyou_page_option");
    361372            $output = '
    362373                <h2>Thank you for your enquirey</h2>
     
    366377                <p>One of our representatives will be in contact with you soon, to deal with your request</p>
    367378            ';
    368             return $output ;
     379            //return $output ;
    369380        }
    370381    }//End Page 3 of Form
Note: See TracChangeset for help on using the changeset viewer.