-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjan.php
45 lines (41 loc) · 1.08 KB
/
jan.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* The plugin main file.
*
* @package Jan
*
* @wordpress-plugin
* Plugin Name: Jan
* Plugin URI: https://github.com/richardkorthuis/jan
* Description: Change every occurrence of 'Powered by WordPress' with 'Powered by Coffee, much Coffee'.
* Version: 1.0.0
* Author: Richard Korthuis
* Author URI: https://github.com/richardkorthuis
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl.html
*/
/**
* Replace occurrences of 'Powered by WordPress' in the output buffer.
*
* @param string $buffer The output buffer.
*
* @return string The output buffer.
*/
function jan_callback( $buffer ) {
$buffer = str_replace( __( 'Powered by WordPress', 'jan' ), __( 'Powered by Coffee, much Coffee', 'jan' ), $buffer );
return $buffer;
}
/**
* Start the output buffering.
*/
function jan_buffer_start() {
ob_start( 'jan_callback' );
}
/**
* End the output buffering.
*/
function jan_buffer_end() {
ob_end_flush();
}
add_action( 'after_setup_theme', 'jan_buffer_start' );
add_action( 'shutdown', 'jan_buffer_end' );