Plugin Directory

Changeset 2867666


Ignore:
Timestamp:
02/19/2023 12:55:25 PM (3 years ago)
Author:
liquidpoll
Message:

Integrate external form with shortcode

Location:
wp-poll
Files:
285 added
4 edited

Legend:

Unmodified
Added
Removed
  • wp-poll/trunk/includes/classes/class-meta-boxes.php

    r2862674 r2867666  
    348348                ),
    349349                array(
     350                    'id'         => 'poll_external_form_enable',
     351                    'title'      => esc_html__( 'External Form', 'wp-poll' ),
     352                    'label'      => esc_html__( 'Enable external email collection form.', 'wp-poll' ),
     353                    'type'       => 'switcher',
     354                    'default'    => false,
     355                    'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     356                ),
     357                array(
     358                    'id'         => 'external_form_shortcode_field',
     359                    'title'      => ' ',
     360                    'type'       => 'textarea',
     361                    'placeholder'=>'[INSERT_FORM_SHORTCODE_HERE]',
     362                    'attributes'=>array(
     363                        'rows'  => '2',
     364                        'cols'  => '50',
     365                        'style' => 'width:35%;min-height: auto;',
     366                    ),
     367                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|true', 'all' ),
     368                ),
     369                array(
    350370                    'id'         => 'poll_form_fields',
    351371                    'title'      => esc_html__( 'Form Fields', 'wp-poll' ),
     
    367387                    ),
    368388                    'default'    => array( 'first_name', 'email_address' ),
    369                     'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     389                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    370390                ),
    371391                array(
     
    374394                    'subtitle'   => esc_html__( 'Label for first name in the form', 'wp-poll' ),
    375395                    'type'       => 'text',
    376                     'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     396                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    377397                ),
    378398                array(
     
    381401                    'subtitle'   => esc_html__( 'Label for last name in the form', 'wp-poll' ),
    382402                    'type'       => 'text',
    383                     'dependency' => array( '_type|poll_form_fields|poll_form_enable', 'any|any|==', 'poll,nps,reaction|last_name|true', 'all' ),
     403                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    384404                ),
    385405                array(
     
    388408                    'subtitle'   => esc_html__( 'Label for email address in the form', 'wp-poll' ),
    389409                    'type'       => 'text',
    390                     'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     410                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    391411                ),
    392412                array(
     
    395415                    'subtitle'   => esc_html__( 'Label for submit button in the form.', 'wp-poll' ),
    396416                    'type'       => 'text',
    397                     'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     417                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    398418                ),
    399419                array(
     
    404424                    'media_buttons' => false,
    405425                    'height'        => '100px',
    406                     'dependency'    => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     426                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    407427                ),
    408428                array(
     
    413433                    'media_buttons' => false,
    414434                    'height'        => '100px',
    415                     'dependency'    => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     435                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    416436                ),
    417437                array(
     
    421441                    'type'       => 'switcher',
    422442                    'default'    => false,
    423                     'dependency' => array( '_type', 'any', 'poll,nps,reaction', 'all' ),
     443                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    424444                ),
    425445                array(
    426446                    'type'       => 'subheading',
    427447                    'content'    => esc_html__( 'Form Styling', 'wp-poll' ),
    428                     'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     448                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    429449                ),
    430450                array(
     
    440460                        'button_bg_hover' => esc_html__( 'Button Bg (Hover))', 'wp-poll' ),
    441461                    ),
    442                     'dependency' => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     462                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    443463                ),
    444464                array(
     
    452472                    'text_align'     => false,
    453473                    'letter_spacing' => false,
    454                     'dependency'     => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     474                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    455475                ),
    456476                array(
     
    464484                    'text_align'     => false,
    465485                    'letter_spacing' => false,
    466                     'dependency'     => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     486                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    467487                ),
    468488                array(
     
    476496                    'text_align'     => false,
    477497                    'letter_spacing' => false,
    478                     'dependency'     => array( '_type|poll_form_enable', 'any|==', 'poll,nps,reaction|true', 'all' ),
     498                    'dependency' => array( '_type|poll_form_enable|poll_external_form_enable', 'any|==|==', 'poll,nps,reaction|true|false', 'all' ),
    479499                ),
    480500            ),
  • wp-poll/trunk/includes/template-hook-functions.php

    r2835348 r2867666  
    1717        global $poll;
    1818
    19         $poll_form_enable = $poll->get_meta( 'poll_form_enable', '0' );
    20 
    21         if ( '1' == $poll_form_enable || 'yes' == $poll_form_enable ) {
     19        $poll_form_enable          = $poll->get_meta( 'poll_form_enable', '0' );
     20        $poll_external_form_enable = $poll->get_meta( 'poll_external_form_enable', '0' );
     21        $form_shortcode            = $poll->get_meta( 'external_form_shortcode_field' );
     22
     23        if ( ( '1' == $poll_form_enable || 'yes' == $poll_form_enable ) && '1' != $poll_external_form_enable ) {
    2224            liquidpoll_get_template( 'single-poll/form.php' );
    2325        }
     26
     27        if (( '1' == $poll_form_enable || 'yes' == $poll_form_enable ) && ( '1' == $poll_external_form_enable || 'yes' == $poll_external_form_enable ) ) {
     28            echo '<div class="liquidpoll-form">';
     29            echo do_shortcode( $form_shortcode );
     30            echo '</div>';
     31        }
     32
    2433    }
    2534}
  • wp-poll/trunk/readme.txt

    r2865767 r2867666  
    55    Requires at least: 4.6
    66    Tested up to: 6.1.1
    7     Stable tag: 3.3.62
     7    Stable tag: 3.3.63
    88    License: GPLv2 or later
    99    License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    356356* 15/02/2023 - NEW - Integrate one click addon install.
    357357
     358= 3.3.63 =
     359* 19/02/2023 - NEW - Integrate external form with shortcode.
     360
  • wp-poll/trunk/wp-poll.php

    r2865767 r2867666  
    44 * Plugin URI: https://liquidpoll.com
    55 * Description: It allows user to poll in your website with many awesome features.
    6  * Version: 3.3.62
     6 * Version: 3.3.63
    77 * Author: LiquidPoll
    88 * Text Domain: wp-poll
     
    2727defined( 'LIQUIDPOLL_TICKET_URL' ) || define( 'LIQUIDPOLL_TICKET_URL', 'https://www.liquidpoll.com/my-account/' );
    2828defined( 'LIQUIDPOLL_COMMUNITY_URL' ) || define( 'LIQUIDPOLL_COMMUNITY_URL', 'https://www.facebook.com/groups/liquidpoll/' );
    29 defined( 'LIQUIDPOLL_VERSION' ) || define( 'LIQUIDPOLL_VERSION', '3.3.62' );
     29defined( 'LIQUIDPOLL_VERSION' ) || define( 'LIQUIDPOLL_VERSION', '3.3.63' );
    3030
    3131if ( ! class_exists( 'LIQUIDPOLL_Main' ) ) {
Note: See TracChangeset for help on using the changeset viewer.