Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • Programming
    • C
    • C++
    • Java
  • Web Development
    • Java Script
    • jQuery
    • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • Programming
    • C
    • C++
    • Java
  • Web Development
    • Java Script
    • jQuery
    • PHP

Question about how global $wp_admin_bar works

You are not declaring an ‘id’ key. Without one, the id will default to a sanitized version of the ‘title’ value – hence your overwrite.

Declare a unique id element, and you should be golden.

That said, add_node is now the preferred method of achieving this.

Categories admin-bar Tags admin-bar
Post navigation
Using FirePHP with WordPress
How To Disable Comments On New Page

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Run code once when block is created
  • Why wp_update_user doesn’t update user_activation_key on users with apostrophes in their email?
  • Get Required Assets (JS, CSS etc) for post using REST API
  • ACF: how do I get the fields and its values of a specific group?
  • Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme [closed]
  • Sending data from custom inputs in WordPress comment form in the admin notification email
  • How to add an entry to the Page/Post Settings Sidebar? [duplicate]
  • Automatically assign video ‘poster’ value to ‘filename’ for archive listing
  • Display as tree terms of taxonomy and custom posts for each term of taxonomy
  • Images will not display, when I call them up with html in wordpress, just two blank small spaces [closed]
© 2022 Read For Learn
  • Programming
    • C
    • C++
    • Java
    • javascript
    • Python
    • R
  • Web Development
    • Java Script
    • jQuery
    • PHP
    • WordPress
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Microsoft Office
  • modx
  • root
  • Tips & Trick
  • Tools
  • windows