Move action links to main class
This commit is contained in:
@@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
function sportspress_plugin_action_links( $links ) {
|
|
||||||
$settings_link = '<a href="options-general.php?page=sportspress">' . __( 'Settings', 'sportspress' ) . '</a>';
|
|
||||||
// $docs_link = '<a href="http://docs.themeboy.com/sportspress" target="_blank">' . __( 'Docs', 'sportspress' ) . '</a>';
|
|
||||||
// $themes_link = '<a href="http://themeboy.com/themes?plugin=sportspress" target="_blank">' . __( 'Themes', 'sportspress' ) . '</a>';
|
|
||||||
|
|
||||||
array_push( $links, $settings_link );
|
|
||||||
|
|
||||||
return $links;
|
|
||||||
}
|
|
||||||
|
|
||||||
$plugin = plugin_basename( SP_PLUGIN_FILE );
|
|
||||||
add_filter( "plugin_action_links_$plugin", 'sportspress_plugin_action_links' );
|
|
||||||
@@ -64,13 +64,13 @@ class SP_Admin {
|
|||||||
|
|
||||||
switch ( $screen->id ) {
|
switch ( $screen->id ) {
|
||||||
case 'dashboard' :
|
case 'dashboard' :
|
||||||
include( 'class-sp-admin-dashboard.php' );
|
// include( 'class-sp-admin-dashboard.php' );
|
||||||
break;
|
break;
|
||||||
case 'users' :
|
case 'users' :
|
||||||
case 'user' :
|
case 'user' :
|
||||||
case 'profile' :
|
case 'profile' :
|
||||||
case 'user-edit' :
|
case 'user-edit' :
|
||||||
include( 'class-sp-admin-profile.php' );
|
// include( 'class-sp-admin-profile.php' );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ final class SportsPress {
|
|||||||
*/
|
*/
|
||||||
protected static $_instance = null;
|
protected static $_instance = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var SP_Countries $countries
|
||||||
|
*/
|
||||||
|
public $countries = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main SportsPress Instance
|
* Main SportsPress Instance
|
||||||
*
|
*
|
||||||
@@ -96,6 +101,7 @@ final class SportsPress {
|
|||||||
$this->includes();
|
$this->includes();
|
||||||
|
|
||||||
// Hooks
|
// Hooks
|
||||||
|
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'action_links' ) );
|
||||||
add_action( 'widgets_init', array( $this, 'include_widgets' ) );
|
add_action( 'widgets_init', array( $this, 'include_widgets' ) );
|
||||||
add_action( 'init', array( $this, 'init' ), 0 );
|
add_action( 'init', array( $this, 'init' ), 0 );
|
||||||
add_action( 'init', array( 'SP_Shortcodes', 'init' ) );
|
add_action( 'init', array( 'SP_Shortcodes', 'init' ) );
|
||||||
@@ -105,6 +111,18 @@ final class SportsPress {
|
|||||||
do_action( 'sportspress_loaded' );
|
do_action( 'sportspress_loaded' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show action links on the plugin screen
|
||||||
|
*
|
||||||
|
* @param mixed $links
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function action_links( $links ) {
|
||||||
|
return array_merge( array(
|
||||||
|
'<a href="' . admin_url( 'options-general.php?page=sportspress' ) . '">' . __( 'Settings', 'sportspress' ) . '</a>',
|
||||||
|
), $links );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auto-load SP classes on demand to reduce memory consumption.
|
* Auto-load SP classes on demand to reduce memory consumption.
|
||||||
*
|
*
|
||||||
@@ -258,7 +276,6 @@ final class SportsPress {
|
|||||||
include_once( 'admin/hooks/the-content.php' );
|
include_once( 'admin/hooks/the-content.php' );
|
||||||
include_once( 'admin/hooks/widget-text.php' );
|
include_once( 'admin/hooks/widget-text.php' );
|
||||||
include_once( 'admin/hooks/wp-insert-post-data.php' );
|
include_once( 'admin/hooks/wp-insert-post-data.php' );
|
||||||
include_once( 'admin/hooks/plugin-action-links.php' );
|
|
||||||
include_once( 'admin/hooks/post-updated-messages.php' );
|
include_once( 'admin/hooks/post-updated-messages.php' );
|
||||||
|
|
||||||
// Register activation hook
|
// Register activation hook
|
||||||
|
|||||||
Reference in New Issue
Block a user