Plugin Directory

Changeset 2845324

Timestamp:
01/09/2023 08:28:50 AM (19 months ago)
Author:
Muhammad Rehman
Message:

Release v1.2.3 with new features and improvements

Location:
wp-hooks-finder/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-hooks-finder/trunk/assets/css/style.css

    r2457628 r2845324  
    11li#wp-admin-bar-wp-hooks-finder a {
    2     background-color: #6b037d;
     2    background-color: #6b037d !important;
     3    color: #FFF !important;
    34}
    45
    5 li#wp-admin-bar-wp-hooks-finder a:hover {
    6     background-color: #6e0082 !important;
    7     color: white !important;
     6li#wp-admin-bar-wp-hooks-finder {
     7    background-color: !important;
     8    color: !important;
    89}
    910
    10 li.menupop.wp-admin-bar-wp-hooks-finder.hover a {
    11     background-color: #6b037d !important;
    12     color: white !important;
     11li {
     12    background-color: !important;
     13    color: !important;
    1314}
    1415
    1516#wphf-action {
    1617    border: solid 1px;
    17     background-color: #d94f4f;
     18    background-color: #;
    1819    margin: 5px;
    1920    color: white;
     
    2425#wphf-filter {
    2526    border: solid 1px;
    26     background-color: #007cba;
     27    background-color: #;
    2728    margin: 5px;
    2829    color: white;
     
    3031    font-size: 12px;
    3132}
     33
     34
     35
     36
     37
  • wp-hooks-finder/trunk/readme.txt

    r2841885 r2845324  
    44Requires at least: 4.0
    55Tested up to: 6.1.1
    6 Stable tag: 1.2.2
     6Stable tag: 1.2.
    77License: GPLv2
    88License URI: GPLv2
     
    4040
    4141== Changelog ==
     42
     43
     44
     45
     46
     47
    4248= 1.2.2 =
    4349Compatible with WP v6.1.1
  • wp-hooks-finder/trunk/wp-hooks-finder.php

    r2841885 r2845324  
    22/**
    33 * Plugin Name: WP Hooks Finder
    4  * Version: 1.2.2
     4 * Version: 1.2.
    55 * 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
    66 * Author: Muhammad Rehman
    77 * Author URI: https://muhammadrehman.com/
    88 * License: GPLv2 or later
     9
    910 */
    1011
     
    3334function wphf_add_toolbar_items( $admin_bar ){
    3435
     36
     37
     38
     39
    3540    $page_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    3641
     
    3843    $page_request = parse_url( $page_url );
    3944
    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 
    5145    $admin_bar->add_menu( array(
    5246        'id'    => 'wp-hooks-finder',
    53         'title' => 'WP Hooks Finder',
     47        'title' => ,
    5448        'href'  => '#',
    5549        'meta'  => array(
    56             'title' => __('WP Hooks Finder'),           
     50            'title' => __('WP Hooks Finder'     
    5751        ),
    5852    ));
     
    6054        'id'    => 'enable-disable-hooks',
    6155        'parent' => 'wp-hooks-finder',
    62         'title' => $display_label,
    63         'href'  => $wphp_request,
     56        'title' => ,
     57        'href'  => ,
    6458        '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' ),
    6682            // 'target' => '_blank',
    6783            'class' => 'wphf-menu'
     
    7086}
    7187
     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
    72117function wphf_clean_url( $url ) {
    73118
    74     $query_url = array( '?wphf=1', '?wphf=0', '&wphf=0', '&wphf=1' );
     119    $query_url = array( '?wphf=1', '?wphf=0', '&wphf=0', '&wphf=1' );
    75120
    76121    foreach( $query_url as $q_url ) {
     
    94139function wphf_display_all_hooks( $tag ) {
    95140
    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;
    97144
    98145    global $debug_tags; global $wp_actions;
     
    105152    }
    106153
    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>";
    111158    }
    112159
Note: See TracChangeset for help on using the changeset viewer.