Merge pull request #80 from cmanon/feature/71-no-map-link-in-editor

Feature/71 no map link in editor
This commit is contained in:
Justin Foell
2020-12-24 12:25:45 -06:00
committed by GitHub
3 changed files with 17 additions and 5 deletions
+3 -2
View File
@@ -4,7 +4,7 @@ Contributors: cmanon, jrfoell, lancewillett, dlintott, sebastianerb
Tags: strava, activity, bicycle, cycling, biking, running, run, swimming, swim, paddle, kayak, gps, shortcode, widget, plugin
Requires at least: 4.6
Tested up to: 5.5
Stable tag: 2.5.0
Stable tag: 2.5.1
Requires PHP: 5.3
License: GPLv2 or later
@@ -113,12 +113,13 @@ On the WP-Strava settings page you cannot currently remove and add another athle
== Changelog ==
= Unreleased =
= 2.5.1 =
Fix latest_map class replacing echo with return https://wordpress.org/support/topic/latest-activity-map-shortcode-wrong-placed-on-page/
Fix styling on pace activity max speed.
Fix broken water pace on activity.
Fix pace types and remove 'other' - making 'speed' default.
Fix to remove map link in editor so you don't leave the editor.
= 2.5.0 =
+12 -1
View File
@@ -109,11 +109,22 @@ class WPStrava_Activity {
* @since 2.3.2
*/
public function get_activity_link( $activity_id, $text, $title = '' ) {
if ( WPStrava::get_instance()->settings->no_link ) {
if ( $this->is_rest_request() || WPStrava::get_instance()->settings->no_link ) {
return $text;
}
$url = esc_url( self::ACTIVITIES_URL . $activity_id );
$title_attr = $title ? " title='" . esc_attr( $title ) . "'" : '';
return "<a href='{$url}'{$title_attr}>{$text}</a>";
}
/**
* Check if rest request to skip link rendering in block editor.
*
* @return boolean
* @author Justin Foell <justin@foell.org>
* @since 2.5.1
*/
private function is_rest_request() {
return defined( 'REST_REQUEST' ) && REST_REQUEST;
}
}
+2 -2
View File
@@ -3,7 +3,7 @@
* Plugin Name: WP Strava
* Plugin URI: https://wordpress.org/plugins/wp-strava/
* Description: Show your strava.com activity on your WordPress site. Some Icons are Copyright © Yusuke Kamiyamane. All rights reserved. Licensed under a Creative Commons Attribution 3.0 license.
* Version: 2.5.0
* Version: 2.5.1
* Author: Carlos Santa Cruz, Justin Foell, Lance Willett, Daniel Lintott, Sebastian Erb
* License: GPL2
* Text Domain: wp-strava
@@ -27,7 +27,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
define( 'WPSTRAVA_PLUGIN_VERSION', '2.5.0' );
define( 'WPSTRAVA_PLUGIN_VERSION', '2.5.1' );
define( 'WPSTRAVA_PLUGIN_FILE', __FILE__ );
define( 'WPSTRAVA_PLUGIN_DIR', trailingslashit( dirname( __FILE__ ) ) );
define( 'WPSTRAVA_PLUGIN_URL', plugins_url( '/', __FILE__ ) );