forked from InstaWP/sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsample-plugin.php
34 lines (29 loc) · 911 Bytes
/
sample-plugin.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
<?php
/**
* InstaWP Sample Plugin
*
* @package INSTAWPPRI
* @author Vikas
* @version 1.0.5
*
* @wordpress-plugin
* Plugin Name: Add text to the top of posts
* Plugin URI: https://instawp.com
* Description: InstaWP Git Deployment testing
* Version: 1.0.5
* Author: Vikas
* Author URI: https://instawp.com
* Text Domain: instawp-sample-plugin
* Domain Path: /languages
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
// Include your custom code here.
// Hook into the 'the_content' filter
add_filter('the_content', 'add_my_text');
function add_my_text($content) {
// Define the text and style
$custom_text = '<div style="background-color: red; padding: 10px; border: 1px solid #ddd;">Github change to the plugin</div>';
// Add the custom text to the beginning of the content
return $custom_text . $content;
}