Plugin Directory

Changeset 2409220


Ignore:
Timestamp:
10/29/2020 04:44:52 PM (5 years ago)
Author:
dsky
Message:

placeholders

Location:
site-search-360/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • site-search-360/trunk/class-sitesearch360-plugin.php

    r2382784 r2409220  
    7575    public function searchbox_shortcode($attrs) {
    7676        $keys = ['include', 'exclude', 'include-suggest', 'exclude-suggest'];
    77         $a = shortcode_atts(array('style' => '', 'include' => NULL, 'exclude' => NULL, 'include-suggest' => NULL, 'exclude-suggest' => NULL), $attrs);
     77        $a = shortcode_atts(array('style' => '', 'include' => NULL, 'exclude' => NULL, 'include-suggest' => NULL, 'exclude-suggest' => NULL, 'placeholder' => NULL), $attrs);
    7878       
    7979        $dataStr = '';
     
    8383            }
    8484        }
     85
     86        $placeholder = '';
     87        if ($a['placeholder'] != null) {
     88            $placeholder = ' data-ss360-keep-placeholder="true" placeholder="' . $a['placeholder'] . '"';
     89        }
    8590       
    86         return '<input class="ss360-searchbox" type="search" style="'.$a['style'].'"'.($this->getType()!='full'?' name="s"':'').$dataStr.'>';
     91        return '<input class="ss360-searchbox" type="search"'. $placeholder .' style="'.$a['style'].'"'.($this->getType()!='full'?' name="s"':'').$dataStr.'>';
    8792    }
    8893
     
    651656                    }
    652657                    ?>
    653                     <!-- Site Search 360 WP v<?php $ss360_v = defined('SITESEARCH360_VERSION') ? SITESEARCH360_VERSION : '1.1.19'; echo $ss360_v; ?> -->
     658                    <!-- Site Search 360 WP v<?php $ss360_v = defined('SITESEARCH360_VERSION') ? SITESEARCH360_VERSION : '1.1.20'; echo $ss360_v; ?> -->
    654659                    <script type="text/javascript">
    655660                        var ss360Config = <?php echo json_encode($configuration); ?>;
  • site-search-360/trunk/class-sitesearch360-tracker.php

    r2382784 r2409220  
    8383        }
    8484
    85         $data['version'] = defined('SITESEARCH360_VERSION') ? SITESEARCH360_VERSION : '1.1.19';
     85        $data['version'] = defined('SITESEARCH360_VERSION') ? SITESEARCH360_VERSION : '1.1.20';
    8686
    8787        $args = array(
  • site-search-360/trunk/class-sitesearch360-widget.php

    r2327402 r2409220  
    3030        if($customStyling) {
    3131            $result = $result . ' data-ss360="true"';
    32         }
     32        }
     33        $placeholder = '';
     34        if (isset($instance['placeholder']) && !empty($instance['placeholder'])) {
     35            $placeholder = ' data-ss360-keep-placeholder="true" placeholder="' . $instance['placeholder'] . '"';
     36        }
    3337        $result = $result . ' style="display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center">';
    34         $result = $result . '<input class="ss360-searchbox" type="search"'.($customStyling?'':' style="margin-right:8px;"').($ss360_integration_type!='full'?' name="s"':'').'>';
     38        $result = $result . '<input class="ss360-searchbox" type="search"'.$placeholder.($customStyling?'':' style="margin-right:8px;"').($ss360_integration_type!='full'?' name="s"':'').'>';
    3539        $result = $result . '<button class="ss360-searchbutton"'.($customStyling?'':' style="margin-right:8px;"').'>'.$label.'</button>';
    3640        if($ss360_integration_type != 'full'){
     
    5155        } else {
    5256            $title = __( 'Search', 'wpb_widget_domain' );
    53         }
     57        }
     58        if (isset($instance['placeholder'])) {
     59            $placeholder = $instance['placeholder'];
     60        } else {
     61            $placeholder = '';
     62        }
    5463        if(isset($instance['searchButtonLabel'])) {
    5564            $searchButtonLabel = $instance['searchButtonLabel'];
     
    6675        <p>
    6776            <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'site-search-360' ); ?></label>
    68             <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
     77            <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />       
     78            <label for="<?php echo $this->get_field_id( 'placeholder' ); ?>"><?php esc_html_e( 'Placeholder:', 'site-search-360' ); ?></label>
     79            <input class="widefat" id="<?php echo $this->get_field_id( 'placeholder' ); ?>" name="<?php echo $this->get_field_name( 'placeholder' ); ?>" type="text" value="<?php echo esc_attr( $placeholder ); ?>" />
    6980            <?php if(!$customStyling) { ?>
    7081                <label for="<?php echo $this->get_field_id( 'searchButtonLabel' ); ?>"><?php esc_html_e( 'Search Button Text:', 'site-search-360' ); ?></label>
     
    8293        $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
    8394        $instance['searchButtonLabel'] = ( ! empty( $new_instance['searchButtonLabel'] ) ) ? strip_tags( $new_instance['searchButtonLabel'] ) : '';
    84         $instance['customStyling'] = (isset($new_instance['customStyling']) && !empty($new_instance['customStyling']));
     95        $instance['customStyling'] = (isset($new_instance['customStyling']) && !empty($new_instance['customStyling']));
     96        $instance['placeholder'] = (isset($new_instance['placeholder']) && !empty($new_instance['placeholder'])) ? strip_tags($new_instance['placeholder']) : '';
    8597        return $instance;
    8698    }
  • site-search-360/trunk/readme.txt

    r2382784 r2409220  
    66Requires at least: 4.0.0
    77Tested up to: 5.5
    8 Stable tag: 1.1.19
     8Stable tag: 1.1.20
    99Requires PHP: 5.2.4
    1010License: GPLv2
     
    7878
    7979== Changelog ==
     80= 1.1.20 =
     81* Add placeholder attribute to shortcodes and widgets.
     82
    8083= 1.1.19 =
    8184* Don't prefill email when signing up.
  • site-search-360/trunk/sitesearch360.php

    r2382784 r2409220  
    66Description: Site Search 360 enhances and improves your standard WordPress search with search suggests, autocompletion, semantic search, and a whole lot of customization. Also, you'll be amazed of how much faster you get relevant search results.
    77Author: SEMKNOX GmbH
    8 Version: 1.1.19
     8Version: 1.1.20
    99Author URI: https://sitesearch360.com
    1010Text Domain: site-search-360
     
    1212*/
    1313
    14 define( 'SITESEARCH360_VERSION', '1.1.19' );
     14define( 'SITESEARCH360_VERSION', '1.1.20' );
    1515
    1616require_once 'class-sitesearch360-widget.php';
Note: See TracChangeset for help on using the changeset viewer.