Skip to content

Instantly share code, notes, and snippets.

View kmwalsh's full-sized avatar
🤖

Kate Walsh kmwalsh

🤖
View GitHub Profile
@kmwalsh
kmwalsh / admin-menu.php
Created April 29, 2025 19:31 — forked from mehrshaddarzi/admin-menu.php
debug get all list menu in admin wordpress
<?php
/*
Check class Adctie Menu Admin
//is_open => wp-has-current-submenu wp-menu-open
//is_open for menu who not submenu => current
//is_close => wp-not-current-submenu menu-top
//if for post Type li => id="menu-posts-{post_type_name}"
//if for taxonomy => id="toplevel_page_edit-tags-taxonomy-{taxonomy}-post_type-{posttype}"
*/
@kmwalsh
kmwalsh / gist:aeaf0b2115660154affcc146fcb8e319
Created September 9, 2020 19:55 — forked from gyrus/gist:3157198
Check if a WordPress page is "current"
<?php
/**
* Check if a WordPress page is "current", i.e. it's the current page or the ancestor of a current page
*
* @uses is_search()
* @uses get_post_type()
* @uses site_url()
* @uses get_permalink()
* @uses get_post_type_object()