Changeset 1553895
- Timestamp:
- 12/13/2016 06:22:46 PM (9 years ago)
- File:
-
- 1 edited
-
vrpconnector/trunk/lib/VRPConnector.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vrpconnector/trunk/lib/VRPConnector.php
r1550793 r1553895 348 348 $pagetitle = $data->name; 349 349 350 if (!empty($data->page_title)) {350 if ( ! empty( $data->page_title ) ) { 351 351 $pagetitle = $data->page_title; 352 352 } … … 385 385 $data = json_decode( $this->search() ); 386 386 387 add_action( 'wp_head', function () {387 add_action( 'wp_head', function () { 388 388 // Do not index search results. 389 389 echo '<META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW">'; 390 } );390 } ); 391 391 392 392 if ( ! empty( $data->count ) ) { … … 493 493 } 494 494 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 ); 501 501 } 502 502 … … 504 504 } 505 505 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 ) { 509 508 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 ) { 516 514 return $page_description; 517 } );515 } ); 518 516 } 519 517 … … 1194 1192 1195 1193 $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 ); 1197 1195 1198 1196 if ( empty( $unit_data->id ) ) { … … 1290 1288 public function vrpSearch( $arr = [] ) { 1291 1289 1292 if ( !is_array($arr)) {1290 if ( ! is_array( $arr ) ) { 1293 1291 // If no arguments are used in the shortcode, WP passes $arr as an empty string. 1294 1292 $arr = []; … … 1562 1560 add_settings_section( 'vrpLoginCreds', 'VRP Login', [ $this, 'vrpLoginSettingTitleCallback' ], 'VRPConnector' ); 1563 1561 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' ); 1566 1566 add_settings_field( 'vrpTheme', 'VRP Theme', [ $this, 'vrpThemeSettingCallback' ], 'VRPConnector', 'vrpTheme' ); 1567 1567 } … … 1569 1569 public function apiKeySettingTitleCallback() { 1570 1570 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>"; 1573 1573 } 1574 1574 … … 1690 1690 } 1691 1691 1692 if ( isset( $_SESSION['arrival'] ) && $_SESSION['arrival'] != '01/01/1970' ) {1692 if ( isset( $_SESSION['arrival'] ) && $_SESSION['arrival'] != '01/01/1970' ) { 1693 1693 $this->search->arrival = date( 'm/d/Y', strtotime( $_SESSION['arrival'] ) ); 1694 1694 } else { … … 1701 1701 } 1702 1702 1703 if ( isset( $_SESSION['depart'] ) && $_SESSION['depart'] != '01/01/1970' ) {1703 if ( isset( $_SESSION['depart'] ) && $_SESSION['depart'] != '01/01/1970' ) { 1704 1704 $this->search->depart = date( 'm/d/Y', strtotime( $_SESSION['depart'] ) ); 1705 1705 } else {
Note: See TracChangeset
for help on using the changeset viewer.