-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml-tag-and-class-replace.php
97 lines (75 loc) · 2.65 KB
/
html-tag-and-class-replace.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/**
* Plugin Name: HTML Tag and Class Replace
* Plugin URI: https://wordpress.org/plugins/html-tag-and-class-replace/
* Description: Allows you to Replace any HTML Tag and Class of your WordPress WebSite.
* Version: 1.1.0
* Requires at least: 4.7
* Tested up to: 6.7
* Requires PHP: 5.3
* Author: jahidcse
* Author URI: https://profiles.wordpress.org/jahidcse/
*/
/**
* OOP Class HTMLtagreplace
*/
class HTMLtagreplace {
public function __construct() {
$file_data = get_file_data( __FILE__, array( 'Version' => 'Version' ) );
$this->plugin = new stdClass;
$this->plugin->name = 'html-tag-and-class-replace';
$this->plugin->displayName = 'Tag and Class Replace';
$this->plugin->folder = plugin_dir_path( __FILE__ );
$this->plugin->url = plugin_dir_url( __FILE__ );
define( 'HTMLTagReplace_VERSION', '1.0.9' );
define( 'HTMLTagReplace_URL', plugin_dir_url( __FILE__ ) );
/**
* Hooks
*/
add_action('admin_menu', array($this,'html_tag_replace_admin_add_page'));
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array($this,'html_tag_replace_page_settings'));
$this->html_tag_and_class_replace_function();
}
/**
* Admin Menu
*/
function html_tag_replace_admin_add_page() {
add_submenu_page( 'options-general.php', $this->plugin->displayName, $this->plugin->displayName, 'manage_options', $this->plugin->name, array( &$this, 'settingsPanel' ) );
}
/**
* Deshboard file and data insert
*/
function settingsPanel() {
$this->html_tag_replace_info = array(
'html_class_replace' => get_option( 'html_class_replace' ),
'html_tag_replace' => get_option( 'html_tag_replace' )
);
include_once $this->plugin->folder.'/view/deshboard.php';
}
/**
* Activated Plugin Setting
*/
function html_tag_replace_activated( $plugin ) {
if ( plugin_basename( __FILE__ ) == $plugin ) {
wp_redirect( admin_url( 'options-general.php?page='.$this->plugin->name ) );
die();
}
}
/**
* Plugin Setting Page Linked
*/
function html_tag_replace_page_settings( $links ) {
$link = sprintf( "<a href='%s' style='color:#2271b1;'>%s</a>", admin_url( 'options-general.php?page='.$this->plugin->name ), __( 'Settings', 'html-tag-and-class-replace' ) );
array_push( $links, $link );
return $links;
}
/**
* Load Function
*
* @return void
*/
function html_tag_and_class_replace_function(){
require_once __DIR__ . '/inc/functions.php';
}
}
$HTMLtagreplace = new HTMLtagreplace();