Commit e94ce4e2 authored by Kevin Stover's avatar Kevin Stover

Merge branch 'release/v2.6.3'

parents fad67441 06564c32
......@@ -135,12 +135,6 @@ a.tooltip span
vertical-align: inherit;
}
.ninja-forms-form-wrap input,
.ninja-forms-form-wrap textarea {
padding: 5px;
}
.ninja-forms-form-wrap label {
font-weight: bold;
}
......
......@@ -89,10 +89,10 @@ function ninja_forms_register_exp_fav_fields_metabox(){
function ninja_forms_save_impexp_fields( $data ){
global $wpdb, $ninja_forms_admin_update_message;
$plugin_settings = nf_get_settings();
$update_message = '';
if($_POST['submit'] == __( 'Export Fields', 'ninja-forms' ) ){
if(isset($_POST['ninja_forms_fav']) AND !empty($_POST['ninja_forms_fav'])){
$fav_ids = esc_html( $_POST['ninja_forms_fav'] );
$fav_ids = ninja_forms_esc_html_deep( $_POST['ninja_forms_fav'] );
if(isset($plugin_settings['date_format'])){
$date_format = $plugin_settings['date_format'];
......@@ -127,22 +127,25 @@ function ninja_forms_save_impexp_fields( $data ){
echo $favorites;
die();
}else{
$ninja_forms_admin_update_message = __( 'Please select favorite fields to export.', 'ninja-forms' );
$update_message = __( 'Please select favorite fields to export.', 'ninja-forms' );
}
}elseif( $_POST['submit'] == __( 'Import Favorites', 'ninja-forms' ) ){
if( $_FILES['userfile']['error'] == UPLOAD_ERR_OK AND is_uploaded_file( $_FILES['userfile']['tmp_name'] ) ){
$file = file_get_contents($_FILES['userfile']['tmp_name']);
$favorites = unserialize($file);
if(is_array($favorites)){
foreach($favorites as $fav){
$fav['data'] = serialize( $fav['data'] );
$wpdb->insert(NINJA_FORMS_FAV_FIELDS_TABLE_NAME, $fav);
}
}
$ninja_forms_admin_update_message = __( 'Favorites imported successfully.', 'ninja-forms' );
$update_message = __( 'Favorites imported successfully.', 'ninja-forms' );
}else{
$ninja_forms_admin_update_message = __( 'Please select a valid favorite fields file.', 'ninja-forms' );
$update_message = __( 'Please select a valid favorite fields file.', 'ninja-forms' );
}
}
return $update_message;
}
\ No newline at end of file
......@@ -317,8 +317,8 @@ function ninja_forms_get_sub_count( $args = array() ) {
$where .= "date_updated < '".$end_date."'";
}
$subs_results = $wpdb->get_results($wpdb->prepare("SELECT COUNT(*) FROM ".NINJA_FORMS_SUBS_TABLE_NAME." WHERE ".$where." ORDER BY `date_updated`", NINJA_FORMS_SUBS_TABLE_NAME), ARRAY_A);
$subs_results = $wpdb->get_results( "SELECT COUNT(*) FROM ".NINJA_FORMS_SUBS_TABLE_NAME." WHERE " . $where . " ORDER BY `date_updated`" , ARRAY_A );
return $subs_results[0]['COUNT(*)'];
}
......@@ -407,7 +407,7 @@ function ninja_forms_get_subs($args = array()){
unset($args['limit']);
}
$subs_results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".NINJA_FORMS_SUBS_TABLE_NAME." WHERE ".$where." ORDER BY `date_updated` DESC ".$limit, NINJA_FORMS_SUBS_TABLE_NAME), ARRAY_A);
$subs_results = $wpdb->get_results( "SELECT * FROM ".NINJA_FORMS_SUBS_TABLE_NAME." WHERE " . $where . " ORDER BY `date_updated` DESC ".$limit, ARRAY_A );
if(is_array($subs_results) AND !empty($subs_results)){
$x = 0;
......
......@@ -21,7 +21,9 @@ function ninja_forms_default_value_filter( $data, $field_id ) {
if ( $default_value === false and isset ( $data['default_value'] ) ) {
$default_value = $data['default_value'];
$default_value = do_shortcode( $default_value );
if ( is_string( $default_value ) )
$default_value = do_shortcode( $default_value );
}
if ( isset ( $ninja_forms_fields[ $field_type ]['process_field'] ) and $ninja_forms_fields[ $field_type ]['process_field'] ) {
......
......@@ -12,7 +12,7 @@ function nf_check_post() {
// If our nonce isn't set, bail
if ( !isset ( $_POST['_wpnonce'] ) )
return false;
// If our nonce doesn't validate, bail
if ( ! wp_verify_nonce( $_POST['_wpnonce'], 'nf_form_' + absint( $_POST['_form_id'] ) ) )
return false;
......@@ -31,7 +31,7 @@ function nf_check_post() {
add_action( 'init', 'ninja_forms_setup_processing_class', 5 );
add_action( 'init', 'ninja_forms_pre_process', 999 );
}
}
}
}
add_action( 'plugins_loaded', 'nf_check_post' );
......@@ -51,7 +51,7 @@ function ninja_forms_session_class_setup(){
if ( get_transient( $_SESSION['ninja_forms_transient_id'] ) !== false ) {
add_action( 'init', 'ninja_forms_setup_processing_class', 5 );
}
}
}
}
add_action( 'init', 'ninja_forms_session_class_setup', 4 );
......@@ -74,8 +74,6 @@ add_action( 'wp_head', 'ninja_forms_clear_transient' );
function ninja_forms_page_append_check(){
global $post, $ninja_forms_append_page_form_id;
if(is_array($ninja_forms_append_page_form_id)){
unset($ninja_forms_append_page_form_id);
}
......@@ -83,14 +81,13 @@ function ninja_forms_page_append_check(){
$ninja_forms_append_page_form_id = array();
}
if( !is_admin() AND is_main_query() AND ( is_page() OR is_single() ) ){
$form_ids = ninja_forms_get_form_ids_by_post_id($post->ID);
if(is_array($form_ids) AND !empty($form_ids)){
foreach($form_ids as $form_id){
$ninja_forms_append_page_form_id[] = $form_id;
//remove_filter('the_content', 'wpautop');
add_filter( 'the_content', 'ninja_forms_append_to_page', 9999 );
}
$form_ids = ninja_forms_get_form_ids_by_post_id($post->ID);
if(is_array($form_ids) AND !empty($form_ids)){
foreach($form_ids as $form_id){
$ninja_forms_append_page_form_id[] = $form_id;
//remove_filter('the_content', 'wpautop');
add_filter( 'the_content', 'ninja_forms_append_to_page', 9999 );
}
}
}
......@@ -99,15 +96,17 @@ add_action('wp_head', 'ninja_forms_page_append_check');
function ninja_forms_append_to_page($content){
global $ninja_forms_append_page_form_id;
$form = '';
if(is_array($ninja_forms_append_page_form_id) AND !empty($ninja_forms_append_page_form_id)){
foreach($ninja_forms_append_page_form_id as $form_id){
$form .= ninja_forms_return_echo('ninja_forms_display_form', $form_id);
if( !is_admin() AND is_main_query() AND ( is_page() OR is_single() ) ){
$form = '';
if(is_array($ninja_forms_append_page_form_id) AND !empty($ninja_forms_append_page_form_id)){
foreach($ninja_forms_append_page_form_id as $form_id){
$form .= ninja_forms_return_echo('ninja_forms_display_form', $form_id);
}
}else{
$form = ninja_forms_return_echo('ninja_forms_display_form', $ninja_forms_append_page_form_id);
}
}else{
$form = ninja_forms_return_echo('ninja_forms_display_form', $ninja_forms_append_page_form_id);
$content .= $form;
}
$content .= $form;
return $content;
}
......@@ -115,7 +114,7 @@ function ninja_forms_append_to_page($content){
* Main function used to display a Ninja Form.
* ninja_forms_display_form() can be called anywhere on in a WordPress template.
* By default it's called by the ninja_forms_append_to_page() function in the main ninja_forms.php file.
*
*
**/
function ninja_forms_display_form( $form_id = '' ){
......@@ -170,7 +169,7 @@ function ninja_forms_display_form( $form_id = '' ){
$display = false;
}
}
$display = apply_filters( 'ninja_forms_display_show_form', $display, $form_id );
if($ajax == 1){
......@@ -182,14 +181,14 @@ function ninja_forms_display_form( $form_id = '' ){
if( $display ){
do_action( 'ninja_forms_before_form_display', $form_id );
do_action('ninja_forms_display_before_form_wrap', $form_id);
do_action('ninja_forms_display_open_form_wrap', $form_id);
do_action('ninja_forms_display_before_form_title', $form_id);
do_action('ninja_forms_display_form_title', $form_id);
do_action('ninja_forms_display_after_form_title', $form_id);
do_action('ninja_forms_display_before_form', $form_id);
do_action('ninja_forms_display_open_form_tag', $form_id);
do_action('ninja_forms_display_after_open_form_tag', $form_id);
......@@ -199,7 +198,7 @@ function ninja_forms_display_form( $form_id = '' ){
do_action('ninja_forms_display_after_fields', $form_id);
do_action('ninja_forms_display_close_form_tag', $form_id);
do_action('ninja_forms_display_after_form', $form_id);
do_action('ninja_forms_display_after_form', $form_id);
do_action('ninja_forms_display_close_form_wrap', $form_id);
do_action('ninja_forms_display_after_form_wrap', $form_id);
......@@ -212,4 +211,4 @@ function ninja_forms_display_form( $form_id = '' ){
do_action( 'ninja_forms_display_user_not_logged_in', $form_id );
}
}
}
\ No newline at end of file
}
<?php
add_action('init', 'ninja_forms_register_fields_pre_process');
function ninja_forms_register_fields_pre_process(){
add_action( 'ninja_forms_pre_process', 'ninja_forms_fields_pre_process' );
add_action( 'ninja_forms_pre_process', 'ninja_forms_fields_pre_process', 9 );
}
function ninja_forms_fields_pre_process(){
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
Plugin Name: Ninja Forms
Plugin URI: http://ninjaforms.com/
Description: Ninja Forms is a webform builder with unparalleled ease of use and features.
Version: 2.6.2
Version: 2.6.3
Author: The WP Ninjas
Author URI: http://ninjaforms.com
Text Domain: ninja-forms
......@@ -54,7 +54,7 @@ global $wpdb, $wp_version;
define("NINJA_FORMS_DIR", WP_PLUGIN_DIR."/".basename( dirname( __FILE__ ) ) );
define("NINJA_FORMS_URL", plugins_url()."/".basename( dirname( __FILE__ ) ) );
define("NINJA_FORMS_VERSION", "2.6.2");
define("NINJA_FORMS_VERSION", "2.6.3");
define("NINJA_FORMS_TABLE_NAME", $wpdb->prefix . "ninja_forms");
define("NINJA_FORMS_FIELDS_TABLE_NAME", $wpdb->prefix . "ninja_forms_fields");
define("NINJA_FORMS_FAV_FIELDS_TABLE_NAME", $wpdb->prefix . "ninja_forms_fav_fields");
......
......@@ -3,7 +3,7 @@ Contributors: kstover, jameslaws, daveshine, mordauk, bftrick, helgatheviking
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 3.6
Tested up to: 3.9
Stable tag: 2.6.2
Stable tag: 2.6.3
License: GPLv2 or later
Forms created with a simple drag and drop interface. Contact forms, Email collection forms, or any other form you want on your WordPress site.
......@@ -76,11 +76,18 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
== Upgrade Notice ==
= 2.6.2 =
= 2.6.3 (05/15/2014) =
*Bugs:*
* Removed CSS padding issues for some themes.
* Fixed a bug with short codes on default values.
* Fixed a PHP Notice related to WordPress version 3.9 and $wpdb->prepare().
*Changes:*
* Added some CSS to make forms more responsive and cross browser compatible.
* Added a Finnish Translation (Thanks to ottok).
* Fixed a bug with short codes on default values.
== Requested Features ==
......@@ -88,6 +95,19 @@ If you have any feature requests, please feel free to visit [ninjaforms.com](htt
== Changelog ==
= 2.6.3 (05/15/2014) =
*Bugs:*
* Removed CSS padding issues for some themes.
* Fixed a bug with short codes on default values.
* Fixed a PHP Notice related to WordPress version 3.9 and $wpdb->prepare().
*Changes:*
* Added a Finnish Translation (Thanks to ottok).
* Fixed a bug with short codes on default values.
= 2.6.2 (04/22/2014) =
*Changes:*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment