-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added translation Capability and readability
- Loading branch information
1 parent
1c81e41
commit 0cee67d
Showing
7 changed files
with
36 additions
and
295 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,42 @@ | ||
<?php | ||
|
||
/** | ||
* @package RemoveLinksScripts\Main | ||
*/ | ||
|
||
// Make sure we don't expose any info if called directly | ||
if ( !defined('ABSPATH') ) { | ||
// Make sure we don't expose any info if called directly. | ||
if ( ! defined( 'ABSPATH' ) ) { | ||
echo 'Hi there! I\'m just a plugin, not much I can do when called directly.'; | ||
exit; | ||
} | ||
|
||
if ( !function_exists("add_action") || !function_exists("add_filter") ) { | ||
if ( ! function_exists( 'add_action' ) || ! function_exists( 'add_filter' ) ) { | ||
header( 'Status: 403 Forbidden' ); | ||
header( 'HTTP/1.1 403 Forbidden' ); | ||
exit(); | ||
} | ||
|
||
define('REMOVE_LINKS_SCRIPTS_PLUGIN_VERSION', '0.2'); | ||
define( 'REMOVE_LINKS_SCRIPTS_PLUGIN_VERSION', '0.2.1' ); | ||
|
||
if ( ! defined( 'REMOVE_LINKS_SCRIPTS_PATH' ) ) { | ||
define( 'REMOVE_LINKS_SCRIPTS_PATH', plugin_dir_path( REMOVE_LINKS_SCRIPTS_FILE ) ); | ||
} | ||
|
||
if ( !defined('REMOVE_LINKS_SCRIPTS_PATH') ) { | ||
define('REMOVE_LINKS_SCRIPTS_PATH', plugin_dir_path( __FILE__ )); | ||
if ( ! defined( 'REMOVE_LINKS_SCRIPTS_BASENAME' ) ) { | ||
define( 'REMOVE_LINKS_SCRIPTS_BASENAME', plugin_basename( REMOVE_LINKS_SCRIPTS_FILE ) ); | ||
} | ||
|
||
require_once(REMOVE_LINKS_SCRIPTS_PATH.'frontend/class.remove-links-scripts-frontend.php'); | ||
|
||
$remove_links_scripts_frontend = new Remove_Links_Scripts_Frontend(); | ||
$remove_links_scripts_frontend->init(); | ||
require_once( REMOVE_LINKS_SCRIPTS_PATH . 'frontend/class-remove-links-scripts-frontend.php' ); | ||
new Remove_Links_Scripts_Frontend(); | ||
|
||
if ( is_admin() ) { | ||
require_once(REMOVE_LINKS_SCRIPTS_PATH.'admin/class.remove-links-scripts-admin.php'); | ||
require_once( REMOVE_LINKS_SCRIPTS_PATH . 'admin/class-remove-links-scripts-admin.php' ); | ||
new Remove_Links_Scripts_Admin(); | ||
|
||
$plugin = plugin_basename( REMOVE_LINKS_SCRIPTS_FILE ); | ||
add_filter( "plugin_action_links_$plugin", 'remove_links_scripts_settings_link' ); | ||
} | ||
|
||
/** | ||
* Plugin Settings Page Link on the Plugin Page under the Plugin Name | ||
* Add textdomain hook for translation. | ||
*/ | ||
function remove_links_scripts_settings_link($links) { | ||
$settings_link = '<a href="admin.php?page=remove-links-scripts-settings">Settings</a>'; | ||
array_unshift($links, $settings_link); | ||
return $links; | ||
function remove_links_scripts_load_plugin_textdomain() { | ||
load_plugin_textdomain( 'remove-links-scripts', FALSE, REMOVE_LINKS_SCRIPTS_BASENAME . '/languages/' ); | ||
} | ||
add_action( 'plugins_loaded', 'remove_links_scripts_load_plugin_textdomain' ); |
Oops, something went wrong.