Add filters to welcome links

This commit is contained in:
Brian Miyaji
2016-02-17 01:57:37 +11:00
parent 79b097266e
commit ab30b88785

View File

@@ -5,7 +5,7 @@
* @author ThemeBoy * @author ThemeBoy
* @category Admin * @category Admin
* @package SportsPress/Admin * @package SportsPress/Admin
* @version 1.8.7 * @version 1.9.17
*/ */
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -148,42 +148,69 @@ class SP_Settings_Modules extends SP_Settings_Page {
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
<table class="widefat" cellspacing="0"> <?php
<thead> $categories = array(
<tr><th> 'documentation' => array(
<strong><?php _e( 'Welcome to SportsPress', 'sportspress' ); ?></strong> 'icon' => 'sp-icon-book',
</th></tr> 'label' => __( 'Documentation', 'sportspress' ),
</thead> 'links' => array(
<tbody> 'http://tboy.co/installation' => __( 'Getting Started', 'sportspress' ),
<tr><td> 'http://tboy.co/manuals' => __( 'Manuals', 'sportspress' ),
<p><strong><i class="sp-icon-book"></i> <?php _e( 'Documentation', 'sportspress' ); ?></strong></p> 'http://tboy.co/videos' => __( 'Videos', 'sportspress' ),
<ul class="sp-documentation-links"> 'http://tboy.co/developers' => __( 'Developers', 'sportspress' ),
<li><a href="http://tboy.co/installation" target="_blank"><?php _e( 'Getting Started', 'sportspress' ); ?></a></li> 'http://tboy.co/integration' => __( 'Theme Integration Guide', 'sportspress' ),
<li><a href="http://tboy.co/manuals" target="_blank"><?php _e( 'Manuals', 'sportspress' ); ?></a></li> ),
<li><a href="http://tboy.co/videos" target="_blank"><?php _e( 'Videos', 'sportspress' ); ?></a></li> ),
<li><a href="http://tboy.co/developers" target="_blank"><?php _e( 'Developers', 'sportspress' ); ?></a></li> 'help' => array(
<li><a href="http://tboy.co/integration" target="_blank"><?php _e( 'Theme Integration Guide', 'sportspress' ); ?></a></li> 'icon' => 'dashicons dashicons-heart',
</ul> 'label' => __( 'Help', 'sportspress' ),
<p><strong><i class="dashicons dashicons-heart"></i> <?php _e( 'Help', 'sportspress' ); ?></strong></p> 'links' => array(
<ul class="sp-community-links"> 'http://tboy.co/forums' => __( 'Support Forums', 'sportspress' ),
<li><a href="http://tboy.co/forums" target="_blank"><?php _e( 'Support Forums', 'sportspress' ); ?></a></li> 'http://tboy.co/ideas' => __( 'Feature Requests', 'sportspress' ),
<li><a href="http://tboy.co/ideas" target="_blank"><?php _e( 'Feature Requests', 'sportspress' ); ?></a></li> ),
<?php if ( class_exists( 'SportsPress_Pro' ) ) { ?> ),
<li><a href="<?php echo apply_filters( 'sportspress_support_url', 'http://support.themeboy.com/' ); ?>" target="_blank"><?php _e( 'Premium Support', 'sportspress' ); ?></a></li> 'social' => array(
<?php } else { ?> 'icon' => 'dashicons dashicons-share',
<li><a href="<?php echo apply_filters( 'sportspress_pro_url', 'http://tboy.co/pro' ); ?>" target="_blank"><span class="sp-desc-tip" title="<?php _e( 'Upgrade to Pro', 'sportspress' ); ?>"><?php _e( 'Premium Support', 'sportspress' ); ?></span></a></li> 'label' => __( 'Connect', 'sportspress' ),
'links' => array(
'http://tboy.co/twitter' => __( 'Twitter', 'sportspress' ),
'http://tboy.co/facebook' => __( 'Facebook', 'sportspress' ),
'http://tboy.co/youtube' => __( 'YouTube', 'sportspress' ),
'http://tboy.co/gplus' => __( 'Google+', 'sportspress' ),
),
),
);
if ( class_exists( 'SportsPress_Pro' ) ) {
$categories['help']['links']['http://support.themeboy.com/'] = __( 'Premium Support', 'sportspress' );
} else {
$categories['help']['links']['http://tboy.co/pro'] = '<span class="sp-desc-tip" title="' . __( 'Upgrade to Pro', 'sportspress' ) . '">' . __( 'Premium Support', 'sportspress' ) . '</span>';
}
$categories = apply_filters( 'sportspress_modules_welcome_links', $categories );
if ( sizeof( $categories ) ) {
?>
<table class="widefat" cellspacing="0">
<thead>
<tr><th>
<strong><?php _e( 'Welcome to SportsPress', 'sportspress' ); ?></strong>
</th></tr>
</thead>
<tbody>
<tr><td>
<?php foreach ( $categories as $slug => $category ) { ?>
<p><strong><i class="<?php echo $category['icon']; ?>"></i> <?php echo $category['label']; ?></strong></p>
<ul class="sp-<?php echo $slug; ?>-links">
<?php foreach ( $category['links'] as $url => $text ) { ?>
<li><a href="<?php echo $url; ?>" target="_blank"><?php echo $text; ?></a></li>
<?php } ?>
</ul>
<?php } ?> <?php } ?>
</ul> </td></tr>
<p><strong><i class="dashicons dashicons-share"></i> <?php _e( 'Connect', 'sportspress' ); ?></strong></p> </tbody>
<ul class="sp-community-links"> </table>
<li><a href="http://tboy.co/twitter" target="_blank"><?php _e( 'Twitter', 'sportspress' ); ?></a></li> <?php } ?>
<li><a href="http://tboy.co/facebook" target="_blank"><?php _e( 'Facebook', 'sportspress' ); ?></a></li>
<li><a href="http://tboy.co/youtube" target="_blank"><?php _e( 'YouTube', 'sportspress' ); ?></a></li>
<li><a href="http://tboy.co/gplus" target="_blank"><?php _e( 'Google+', 'sportspress' ); ?></a></li>
</ul>
</td></tr>
</tbody>
</table>
<?php do_action( 'sportspress_modules_after_sidebar' ); ?> <?php do_action( 'sportspress_modules_after_sidebar' ); ?>
</div> </div>