Changeset 2845324
- Timestamp:
- 01/09/2023 08:28:50 AM (19 months ago)
- Location:
- wp-hooks-finder/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-hooks-finder/trunk/assets/css/style.css
r2457628 r2845324 1 1 li#wp-admin-bar-wp-hooks-finder a { 2 background-color: #6b037d; 2 background-color: #6b037d !important; 3 color: #FFF !important; 3 4 } 4 5 5 li#wp-admin-bar-wp-hooks-finder a:hover{6 background-color: #6e0082!important;7 color: white!important;6 li#wp-admin-bar-wp-hooks-finder { 7 background-color: !important; 8 color: !important; 8 9 } 9 10 10 li .menupop.wp-admin-bar-wp-hooks-finder.hover a{11 background-color: #6b037d!important;12 color: white!important;11 li { 12 background-color: !important; 13 color: !important; 13 14 } 14 15 15 16 #wphf-action { 16 17 border: solid 1px; 17 background-color: # d94f4f;18 background-color: #; 18 19 margin: 5px; 19 20 color: white; … … 24 25 #wphf-filter { 25 26 border: solid 1px; 26 background-color: # 007cba;27 background-color: #; 27 28 margin: 5px; 28 29 color: white; … … 30 31 font-size: 12px; 31 32 } 33 34 35 36 37 -
wp-hooks-finder/trunk/readme.txt
r2841885 r2845324 4 4 Requires at least: 4.0 5 5 Tested up to: 6.1.1 6 Stable tag: 1.2. 26 Stable tag: 1.2. 7 7 License: GPLv2 8 8 License URI: GPLv2 … … 40 40 41 41 == Changelog == 42 43 44 45 46 47 42 48 = 1.2.2 = 43 49 Compatible with WP v6.1.1 -
wp-hooks-finder/trunk/wp-hooks-finder.php
r2841885 r2845324 2 2 /** 3 3 * Plugin Name: WP Hooks Finder 4 * Version: 1.2. 24 * Version: 1.2. 5 5 * Description: Easily enable/disable hooks and filters which are running in the page. A menu "WP Hooks Finder" will be added in your wordpress admin bar menu where you can display all the hooks and filters 6 6 * Author: Muhammad Rehman 7 7 * Author URI: https://muhammadrehman.com/ 8 8 * License: GPLv2 or later 9 9 10 */ 10 11 … … 33 34 function wphf_add_toolbar_items( $admin_bar ){ 34 35 36 37 38 39 35 40 $page_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; 36 41 … … 38 43 $page_request = parse_url( $page_url ); 39 44 40 41 $wphp_request = $page_url . ( isset( $page_request['query'] ) ? '&' : '?' ) . 'wphf=0';42 $display_label = 'Hide All hooks & Filters';43 44 if( !isset( $_GET['wphf']) || $_GET['wphf'] == 0 ) {45 46 47 $wphp_request = $page_url . ( isset( $page_request['query'] ) ? '&' : '?' ) . 'wphf=1';48 $display_label = 'Show All hooks & Filters';49 }50 51 45 $admin_bar->add_menu( array( 52 46 'id' => 'wp-hooks-finder', 53 'title' => 'WP Hooks Finder',47 'title' => , 54 48 'href' => '#', 55 49 'meta' => array( 56 'title' => __('WP Hooks Finder' ),50 'title' => __('WP Hooks Finder' 57 51 ), 58 52 )); … … 60 54 'id' => 'enable-disable-hooks', 61 55 'parent' => 'wp-hooks-finder', 62 'title' => $display_label,63 'href' => $wphp_request,56 'title' => , 57 'href' => , 64 58 'meta' => array( 65 'title' => __($display_label), 59 'title' => wphf_is_active( 'wphf', 'All Action & Filter ' ), 60 // 'target' => '_blank', 61 'class' => 'wphf-menu' 62 ), 63 )); 64 $admin_bar->add_menu( array( 65 'id' => 'enable-disable-action-hooks', 66 'parent' => 'wp-hooks-finder', 67 'title' => wphf_is_active( 'wphfa', 'Action' ), 68 'href' => wphf_is_url( $page_url, $page_request, 'wphfa' ), 69 'meta' => array( 70 'title' => wphf_is_active( 'wphfa', 'Action' ), 71 // 'target' => '_blank', 72 'class' => 'wphf-menu' 73 ), 74 )); 75 $admin_bar->add_menu( array( 76 'id' => 'enable-disable-filter-hooks', 77 'parent' => 'wp-hooks-finder', 78 'title' => wphf_is_active( 'wphff', 'Filter' ), 79 'href' => wphf_is_url( $page_url, $page_request, 'wphff' ), 80 'meta' => array( 81 'title' => wphf_is_active( 'wphff', 'Filter' ), 66 82 // 'target' => '_blank', 67 83 'class' => 'wphf-menu' … … 70 86 } 71 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 72 117 function wphf_clean_url( $url ) { 73 118 74 $query_url = array( '?wphf=1', '?wphf=0', '&wphf=0', '&wphf=1' );119 $query_url = array( '?wphf=1', '?wphf=0', '&wphf=0', '&wphf=1' ); 75 120 76 121 foreach( $query_url as $q_url ) { … … 94 139 function wphf_display_all_hooks( $tag ) { 95 140 96 if( !isset( $_GET['wphf'] ) || $_GET['wphf'] == 0 ) return; 141 if( ( !isset( $_GET['wphf'] ) || $_GET['wphf'] == 0 ) && 142 ( !isset( $_GET['wphfa'] ) || $_GET['wphfa'] == 0 ) && 143 ( !isset( $_GET['wphff'] ) || $_GET['wphff'] == 0 ) ) return; 97 144 98 145 global $debug_tags; global $wp_actions; … … 105 152 } 106 153 107 if( isset( $wp_actions[$tag] ) ) {108 echo "<div id='wphf-action' title=' Action Hook'><img src='".WPHF_PLUGIN_PATH."assets/img/action.png' />" . $tag. "</div>";109 } else {110 echo "<div id='wphf-filter' title='Filter Hook'><img src='".WPHF_PLUGIN_PATH."assets/img/filter.png' />" . $tag. "</div>";154 if( isset( $wp_actions[$tag] ) ) { 155 echo "<div id='wphf-action' title=' Action Hook'><img src='".WPHF_PLUGIN_PATH."assets/img/action.png' />" . . "</div>"; 156 } else { 157 echo "<div id='wphf-filter' title='Filter Hook'><img src='".WPHF_PLUGIN_PATH."assets/img/filter.png' />" . . "</div>"; 111 158 } 112 159
Note: See TracChangeset
for help on using the changeset viewer.