Skip to content

Commit 0145026

Browse files
committed
Initial commit.
0 parents  commit 0145026

4 files changed

Lines changed: 103 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# GlotPress Remove Powered By
2+
A plugin for [GlotPress as a WordPress plugin](https://github.com/deliciousbrains/GlotPress) that removes "Powered by" line in the footer.
3+

readme.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
=== GP Remove Powered By ===
2+
Contributors: gregross
3+
Donate link: http://toolstack.com/donate
4+
Plugin URI: http://glot-o-matic.com/gp-remove-powered-by
5+
Author URI: http://toolstack.com
6+
Tags: translation, glotpress
7+
Requires at least: 4.4
8+
Tested up to: 4.4
9+
Stable tag: 0.5
10+
License: GPLv2
11+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
12+
13+
A plugin for [GlotPress as a WordPress plugin](https://github.com/deliciousbrains/GlotPress) that removes the "Powered By" in the footer.
14+
15+
== Description ==
16+
17+
A plugin for [GlotPress as a WordPress plugin](https://github.com/deliciousbrains/GlotPress) that removes the "Powered By" in the footer.
18+
19+
== Installation ==
20+
21+
Install from the WordPress plugin directory.
22+
23+
== Frequently Asked Questions ==
24+
25+
= TBD =
26+
27+
TBD
28+
29+
== Changelog ==
30+
31+
= 1.0 =
32+
* Release Date: TBD
33+
* Initial release.
34+
35+
== Upgrade Notice ==
36+
37+
= 1.0 =
38+
39+
Initial release, no upgrade notes at this time.
40+

remove-powered-by.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
jQuery(document).ready( function() {
2+
var gp_rpb_footer = jQuery('#gp-footer');
3+
var gp_rpb_footer_content = gp_rpb_footer.html();
4+
5+
gp_rpb_footer_content = gp_rpb_footer_content.replace( /(.*--GP_RPB_MARKER--)/g, '<span style="display:none">' );
6+
7+
gp_rpb_footer.html( gp_rpb_footer_content );
8+
9+
10+
});

remove-powered-by.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
/*
3+
Plugin Name: GlotPress Remove Powered By
4+
Plugin URI: http://glot-o-matic.com/gp-remove-powered-by
5+
Description: Remove the "Powered by" line in the footer of GlotPress.
6+
Version: 0.5
7+
Author: gregross
8+
Author URI: http://toolstack.com
9+
Tags: glotpress, glotpress plugin
10+
License: GPLv2
11+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
12+
*/
13+
14+
class GP_Remove_Powered_By {
15+
public $id = 'remove-powered-by';
16+
17+
public function __construct() {
18+
wp_register_script( 'remove-powered-by', plugins_url( 'remove-powered-by.js', __FILE__ ), array( 'jquery' ) );
19+
20+
add_action( 'gp_pre_tmpl_load', array( $this, 'gp_pre_tmpl_load' ), 10, 2 );
21+
add_action( 'gp_footer', array( $this, 'gp_footer' ), 1, 2 );
22+
}
23+
24+
public function gp_pre_tmpl_load( $template, $args ) {
25+
26+
$url = gp_url_public_root();
27+
28+
if ( is_ssl() ) {
29+
$url = gp_url_ssl( $url );
30+
}
31+
32+
gp_enqueue_script( 'remove-powered-by' );
33+
34+
}
35+
36+
public function gp_footer() {
37+
echo '<span style="display: none;">--GP_RPB_MARKER--</span>&nbsp;';
38+
39+
}
40+
}
41+
42+
// Add an action to WordPress's init hook to setup the plugin. Don't just setup the plugin here as the GlotPress plugin may not have loaded yet.
43+
add_action( 'gp_init', 'gp_remove_powered_by_init' );
44+
45+
// This function creates the plugin.
46+
function gp_remove_powered_by_init() {
47+
GLOBAL $gp_remove_powered_by;
48+
49+
$gp_remove_powered_by = new GP_Remove_Powered_By;
50+
}

0 commit comments

Comments
 (0)