Plugin Directory

Changeset 3413224


Ignore:
Timestamp:
12/06/2025 08:51:00 PM (4 months ago)
Author:
wpSight
Message:
  • Add - Option to print the form title as a heading above the form
  • Add - Option to hide the form on a page of an unavailable listing
Location:
wpcasa-contact-form-7
Files:
11 added
3 edited

Legend:

Unmodified
Added
Removed
  • wpcasa-contact-form-7/trunk/README.txt

    r3407101 r3413224  
    6262== Changelog ==
    6363
     64= 1.4.0 =
     65* Add - Option to print the form title as a heading above the form
     66* Add - Option to hide the form on a page of an unavailable listing
     67
    6468= 1.3.1 =
    6569* Fix - fixed `_load_textdomain_just_in_time` notice with WordPress 6.7
     
    7983* Add - listing agent name tag
    8084* Add - compatibility with WPCasa 1.2 version
    81 * ADD - recipient by default
     85* Add - recipient by default
    8286
    8387= 1.1.0 =
     
    9195
    9296== Upgrade Notice ==
     97= 1.4.0 =
     98We have added some useful new options to the settings page.
     99
    93100= 1.3.0 =
    94101We did some improvements for PHP 8 compatibility and translations are now handled on WordPress.org. Please be part of the community and help to translate WPCasa Contact Form 7 on [GlotPress](https://translate.wordpress.org/projects/wp-plugins/wpcasa-contact-form-7/). Thank you!
  • wpcasa-contact-form-7/trunk/includes/admin/class-wpsight-contact-form-7-admin.php

    r2996688 r3413224  
    4646        $options_cf7 = array(
    4747            'contact_form_7_pageheading' => array(
    48                 'name'      => __( 'Contact Form 7', 'wpcasa-contact-form-7' ),
     48                'name'      => esc_html__( 'Contact Form 7', 'wpcasa-contact-form-7' ),
    4949                'desc'      => '',
    5050                'link'      => 'https://docs.wpcasa.com/article/wpcasa-contact-form-7',
     
    5555            ),
    5656
    57             'contact_form_7_listing_form_id' => array(
    58                 'name'      => __( 'Listing Form', 'wpcasa-contact-form-7' ),
    59                 'desc'      => __( 'Select the form that you want to use on listing pages.', 'wpcasa-contact-form-7' ),
     57            'contact_form_7_listing_form_id' => array(
     58                'name'      => esc_html__( 'Listing Form', 'wpcasa-contact-form-7' ),
     59                'desc'      => esc_html__( 'Select the form that you want to use on listing pages.', 'wpcasa-contact-form-7' ),
    6060                'id'        => 'contact_form_7_listing_form_id',
    6161                'type'      => 'select',
    6262                'options'   => $forms
    63             )
     63            ),
     64
     65            'contact_form_7_listing_form_print_heading' => array(
     66                'name'      => esc_html__( 'Print Title Heading', 'wpcasa-contact-form-7' ),
     67                'desc'      => esc_html__( 'Select check the box if you want to print the form title as heading above the form.', 'wpcasa-contact-form-7' ),
     68                'id'        => 'contact_form_7_listing_form_print_heading',
     69                'type'      => 'checkbox',
     70            ),
     71
    6472
    6573        );
    66        
     74
     75        if( wpsight_get_option( 'contact_form_7_listing_form_print_heading' ) ) {
     76
     77            $options_cf7['contact_form_7_listing_form_print_heading_tag'] = array(
     78                'name'      => esc_html__( 'Title Heading Tag', 'wpcasa-contact-form-7' ),
     79                'desc'      => esc_html__( 'Select the heading tag for the title and choose between <h2> and <h6>.', 'wpcasa-contact-form-7' ),
     80                'id'        => 'contact_form_7_listing_form_print_heading_tag',
     81                'type'      => 'select',
     82                'options'   => array(
     83                    'h2' => __( 'h2' ),
     84                    'h3' => __( 'h3' ),
     85                    'h4' => __( 'h4' ),
     86                    'h5' => __( 'h5' ),
     87                    'h6' => __( 'h6' ),
     88                )
     89            );
     90
     91        }
     92
     93        $options_cf7['contact_form_7_listing_form_show_unavailable_listings'] = array(
     94            'name'      => esc_html__( 'Show on unavailable listings', 'wpcasa-contact-form-7' ),
     95            'desc'      => esc_html__( 'Select uncheck the box if you don\'t want to show the form on the page of unavailable listings.', 'wpcasa-contact-form-7' ),
     96            'id'        => 'contact_form_7_listing_form_show_unavailable_listings',
     97            'type'      => 'checkbox',
     98        );
     99
    67100        $form_id = wpsight_get_option( 'contact_form_7_listing_form_id' );
    68101       
     
    70103       
    71104            $options_cf7['contact_form_7_listing_form_display'] = array(
    72                 'name'      => __( 'Form Display', 'wpcasa-contact-form-7' ),
    73                 'desc'  => __( 'Select where to display the listing form or choose to manually add the form via shortcode or function.', 'wpcasa-contact-form-7' ),
     105                'name'      => esc_html__( 'Form Display', 'wpcasa-contact-form-7' ),
     106                'desc'      => esc_html__( 'Select where to display the listing form or choose to manually add the form via shortcode or function.', 'wpcasa-contact-form-7' ),
    74107                'id'        => 'contact_form_7_listing_form_display',
    75108                'type'      => 'select',
     
    88121       
    89122        $options_cf7['contact_form_7_listing_form_css'] = array(
    90             'name'      => __( 'Form CSS', 'wpcasa-contact-form-7' ),
    91             'cb_label'  => __( 'Please uncheck the box to disable the plugin from outputting CSS.', 'wpcasa-contact-form-7' ),
     123            'name'      => esc_html__( 'Form CSS', 'wpcasa-contact-form-7' ),
     124            'cb_label'  => esc_html__( 'Please uncheck the box to disable the plugin from outputting CSS.', 'wpcasa-contact-form-7' ),
    92125            'id'        => 'contact_form_7_listing_form_css',
    93126            'type'      => 'checkbox'
  • wpcasa-contact-form-7/trunk/wpcasa-contact-form-7.php

    r3199135 r3413224  
    5252        define( 'WPSIGHT_CONTACT_FORM_7_NAME', 'WPCasa Contact Form 7' );
    5353        define( 'WPSIGHT_CONTACT_FORM_7_DOMAIN', 'wpcasa-contact-form-7' );
    54         define( 'WPSIGHT_CONTACT_FORM_7_VERSION', '1.3.1' );
     54        define( 'WPSIGHT_CONTACT_FORM_7_VERSION', '1.4.0' );
    5555        define( 'WPSIGHT_CONTACT_FORM_7_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
    5656        define( 'WPSIGHT_CONTACT_FORM_7_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
     
    154154     */
    155155    public function listing_form() {
    156        
    157         if( wpsight_get_option( 'contact_form_7_listing_form_id' ) ) {
     156
     157        if( wpsight_get_option( 'contact_form_7_listing_form_id' ) && wpsight_get_option( 'contact_form_7_listing_form_show_unavailable_listings' ) ) {
    158158           
    159159            $contact_form = wpcf7_contact_form( self::wpcf7_contact_form_id() );
    160            
    161             if( is_object( $contact_form ) )
    162                 echo $contact_form->form_html( array( 'html_class' => 'wpsight-wpcf7' ) );
    163            
     160
     161            if( is_object( $contact_form ) ) {
     162
     163                if( wpsight_get_option( 'contact_form_7_listing_form_print_heading' ) ) {
     164
     165                    $tag = wpsight_get_option( 'contact_form_7_listing_form_print_heading_tag', 'h3' );
     166
     167                    echo wp_sprintf( '<%1$s>%2$s</%1$s>', $tag, $contact_form->title() );
     168
     169                }
     170
     171                echo $contact_form->form_html( array( 'html_class' => 'wpsight-wpcf7' ) );
     172
     173            }
     174
    164175        }
    165176       
     
    411422
    412423        $options = array(
    413             'contact_form_7_listing_form_id'        => $contact_form_id,
    414             'contact_form_7_listing_form_css'       => '1',
    415             'contact_form_7_listing_form_display'   => 'wpsight_listing_single_after'
     424            'contact_form_7_listing_form_id'                        => $contact_form_id,
     425            'contact_form_7_listing_form_print_heading'             => '0',
     426            'contact_form_7_listing_form_print_heading_tag'         => 'h3',
     427            'contact_form_7_listing_form_show_unavailable_listings' => '1',
     428            'contact_form_7_listing_form_css'                       => '1',
     429            'contact_form_7_listing_form_display'                   => 'wpsight_listing_single_after'
    416430        );
    417431
Note: See TracChangeset for help on using the changeset viewer.