Plugin Directory

Changeset 1553895


Ignore:
Timestamp:
12/13/2016 06:22:46 PM (9 years ago)
Author:
Houghtelin
Message:

09df4c4 Merge pull request #136 from Gueststream-Inc/vrplib_spaces_to_tabs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vrpconnector/trunk/lib/VRPConnector.php

    r1550793 r1553895  
    348348                    $pagetitle = $data->name;
    349349
    350                     if(!empty($data->page_title)) {
     350                    if ( ! empty( $data->page_title ) ) {
    351351                        $pagetitle = $data->page_title;
    352352                    }
     
    385385                $data = json_decode( $this->search() );
    386386
    387                 add_action('wp_head', function () {
     387                add_action( 'wp_head', function () {
    388388                    // Do not index search results.
    389389                    echo '<META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW">';
    390                 });
     390                } );
    391391
    392392                if ( ! empty( $data->count ) ) {
     
    493493        }
    494494
    495         if (!empty($pagetitle)) {
    496             $this->overrideYoastPageTitle($pagetitle);
    497         }
    498 
    499         if (!empty($pagedescription)) {
    500             $this->overrideYoastMetaDesc($pagedescription);
     495        if ( ! empty( $pagetitle ) ) {
     496            $this->overrideYoastPageTitle( $pagetitle );
     497        }
     498
     499        if ( ! empty( $pagedescription ) ) {
     500            $this->overrideYoastMetaDesc( $pagedescription );
    501501        }
    502502
     
    504504    }
    505505
    506     private function overrideYoastPageTitle($page_title)
    507     {
    508         add_filter('wpseo_title', function ($yoast_page_title) use ($page_title) {
     506    private function overrideYoastPageTitle( $page_title ) {
     507        add_filter( 'wpseo_title', function ( $yoast_page_title ) use ( $page_title ) {
    509508            return $page_title;
    510         });
    511     }
    512 
    513     private function overrideYoastMetaDesc($page_description)
    514     {
    515         add_filter('wpseo_metadesc', function ($yoast_page_description) use ($page_description) {
     509        } );
     510    }
     511
     512    private function overrideYoastMetaDesc( $page_description ) {
     513        add_filter( 'wpseo_metadesc', function ( $yoast_page_description ) use ( $page_description ) {
    516514            return $page_description;
    517         });
     515        } );
    518516    }
    519517
     
    11941192
    11951193        $json_unit_data = $this->call( "getunit/" . $args['page_slug'] );
    1196         $unit_data     = json_decode( $json_unit_data );
     1194        $unit_data      = json_decode( $json_unit_data );
    11971195
    11981196        if ( empty( $unit_data->id ) ) {
     
    12901288    public function vrpSearch( $arr = [] ) {
    12911289
    1292         if (!is_array($arr)) {
     1290        if ( ! is_array( $arr ) ) {
    12931291            // If no arguments are used in the shortcode, WP passes $arr as an empty string.
    12941292            $arr = [];
     
    15621560        add_settings_section( 'vrpLoginCreds', 'VRP Login', [ $this, 'vrpLoginSettingTitleCallback' ], 'VRPConnector' );
    15631561        add_settings_field( 'vrpUser', 'VRP Username', [ $this, 'vrpUserCallback' ], 'VRPConnector', 'vrpLoginCreds' );
    1564         add_settings_field( 'vrpPass', 'VRP Password', [ $this, 'vrpPasswordCallback' ], 'VRPConnector', 'vrpLoginCreds' );
    1565         add_settings_section( 'vrpTheme', 'VRP Theme Selection', [ $this, 'vrpThemeSettingTitleCallback' ], 'VRPConnector' );
     1562        add_settings_field( 'vrpPass', 'VRP Password', [ $this, 'vrpPasswordCallback' ], 'VRPConnector',
     1563            'vrpLoginCreds' );
     1564        add_settings_section( 'vrpTheme', 'VRP Theme Selection', [ $this, 'vrpThemeSettingTitleCallback' ],
     1565            'VRPConnector' );
    15661566        add_settings_field( 'vrpTheme', 'VRP Theme', [ $this, 'vrpThemeSettingCallback' ], 'VRPConnector', 'vrpTheme' );
    15671567    }
     
    15691569    public function apiKeySettingTitleCallback() {
    15701570        echo "<p>Your API Key can be found in the settings section after logging in to <a href='https://www.gueststream.net'>Gueststream.net</a>.</p>
    1571         <p>Don't have an account? <a href='http://www.gueststream.com/apps-and-tools/vrpconnector-sign-up-page/'>Click Here</a> to learn more about getting a <a href='https://www.gueststream.net'>Gueststream.net</a> account.</p>
    1572         <p>Demo API Key: <strong>1533020d1121b9fea8c965cd2c978296</strong> The Demo API Key does not contain bookable units therfor availability searches will not work.</p>";
     1571<p>Don't have an account? <a href='http://www.gueststream.com/apps-and-tools/vrpconnector-sign-up-page/'>Click Here</a> to learn more about getting a <a href='https://www.gueststream.net'>Gueststream.net</a> account.</p>
     1572<p>Demo API Key: <strong>1533020d1121b9fea8c965cd2c978296</strong> The Demo API Key does not contain bookable units therfor availability searches will not work.</p>";
    15731573    }
    15741574
     
    16901690        }
    16911691
    1692         if ( isset( $_SESSION['arrival'] ) && $_SESSION['arrival'] != '01/01/1970') {
     1692        if ( isset( $_SESSION['arrival'] ) && $_SESSION['arrival'] != '01/01/1970' ) {
    16931693            $this->search->arrival = date( 'm/d/Y', strtotime( $_SESSION['arrival'] ) );
    16941694        } else {
     
    17011701        }
    17021702
    1703         if ( isset( $_SESSION['depart'] ) && $_SESSION['depart'] != '01/01/1970') {
     1703        if ( isset( $_SESSION['depart'] ) && $_SESSION['depart'] != '01/01/1970' ) {
    17041704            $this->search->depart = date( 'm/d/Y', strtotime( $_SESSION['depart'] ) );
    17051705        } else {
Note: See TracChangeset for help on using the changeset viewer.