Files
wp-strava/wp-strava.php
T

68 lines
2.3 KiB
PHP
Raw Normal View History

2011-08-23 09:34:28 -05:00
<?php
2018-01-26 13:34:37 -06:00
/**
2015-05-11 22:28:33 -05:00
* Plugin Name: WP Strava
2017-05-26 11:10:39 -05:00
* 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.
2018-06-22 09:09:58 -05:00
* Version: 1.6.0
* Author: Carlos Santa Cruz, Justin Foell, Lance Willett, Daniel Lintott
2015-05-11 22:28:33 -05:00
* License: GPL2
2017-05-26 10:53:24 -05:00
* Text Domain: wp-strava
* Domain Path: /lang
2015-05-11 22:28:33 -05:00
*/
2018-03-23 11:21:14 -05:00
/*
Copyright 2018 Carlos Santa Cruz (email : cmanon at gmail dot com)
2011-08-23 09:34:28 -05:00
2018-03-23 11:21:14 -05:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
2011-08-23 09:34:28 -05:00
2018-03-23 11:21:14 -05:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
2011-08-23 09:34:28 -05:00
2018-03-23 11:21:14 -05:00
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2011-08-23 09:34:28 -05:00
*/
2017-05-26 10:53:24 -05:00
define( 'WPSTRAVA_PLUGIN_DIR', trailingslashit( dirname( __FILE__ ) ) );
2013-02-03 20:38:55 -06:00
define( 'WPSTRAVA_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
2017-05-26 10:53:24 -05:00
define( 'WPSTRAVA_PLUGIN_NAME', plugin_basename( __FILE__ ) );
if ( ! defined( 'WPSTRAVA_DEBUG' ) ) {
define( 'WPSTRAVA_DEBUG', false );
}
2011-08-23 09:34:28 -05:00
2013-02-03 20:38:55 -06:00
// Load the multilingual support.
function wpstrava_load_plugin_textdomain() {
2017-05-26 10:53:24 -05:00
load_plugin_textdomain( 'wp-strava', false, WPSTRAVA_PLUGIN_DIR . 'lang/' );
2011-08-23 09:34:28 -05:00
}
add_action( 'plugins_loaded', 'wpstrava_load_plugin_textdomain' );
/**
* Autoloads files with classes when needed.
*
* @since 1.6.0
* @param string $class_name Name of the class being requested.
* @return void
*/
function wpstrava_autoload_classes( $class_name ) {
$parts = explode( '_', $class_name );
// If our class doesn't have our namespace, don't load it.
if ( empty( $parts[0] ) || 'WPStrava' !== $parts[0] ) {
return;
}
// @TODO Add directory searching if they get created.
$file = dirname( __FILE__ ) . '/lib/' . implode( '/', $parts ) . '.php';
if ( file_exists( $file ) ) {
include_once $file;
}
}
spl_autoload_register( 'wpstrava_autoload_classes' );
2011-08-23 09:34:28 -05:00
$wpstrava = WPStrava::get_instance();