The Core menu system, which was not mentioned in the initial version of the question, does not have any “before” and “after” hooks that I can find. You could create a custom Walker that could include those hooks but it is going to be a theme problem, either way.
If that is not satisfactory, you will need to alter the DOM with Javascript. I don’t know if that is even possible/viable for the code you want to include but if that is an option you need to hook code to wp_enqueue_scripts
something like this: https://wordpress.stackexchange.com/a/128250/21376.
You can use wp_localize_script()
to write data to the page that your script can use. For example: https://wordpress.stackexchange.com/a/92184/21376.
Related Posts:
- Should all plugins be encapsulated in a Class?
- In what order does WordPress load plugin files?
- How to include a plugin’s php file to another plugin functions file [duplicate]
- How can I bulk edit variations in woocommerce? [closed]
- Add a subitem to Woocommerce section
- How to find out if option exists but is empty?
- Search and replace text across all posts
- Reduce nonce lifespan
- Add Products to user’s ID Woocommerce
- Add_rewrite_rule doesn’t add custom url in plugin
- Fatal error: Uncaught Error: Call to undefined function get_userdata()
- How to add inline css/js inside a shortcode
- Upload files programmatically to users
- taxonomy_template filter do not loads custom taxonomy template properly
- Is this plugin being loaded before file.php, subsequently not allowing me to use certain functions?
- Ajax with jQuery UI dialog not working
- Shortcode in AJAX popup
- Editing Theme to apply Co-Authors Plus
- Display comments of users on single page
- How do you remove plugin edit option?
- Localiztion in javascript
- Why none of the plugins that have ajax doesn’t work in my website?
- wordpress reusable content blocks
- Is there a filter for get_post_custom()?
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- I am getting error message on accessing menu-endpoint
- Where should I save an API key of my user when installing my plugin?
- How to make a customize role and view a specific plugins base on that role?
- Set featured image randomly from WordPress Database on post submission
- Headers Content-Security-Policy CSP Major Issue
- Woocommerce Deposit, then random payments until product paid in full [closed]
- How do I run SQL queries on a WordPress web page? [closed]
- Remove strange code from wordpress footer [closed]
- Removing an action from wp_footer called in a class that’s inside a bigger class
- Modal suddenly disapearring [closed]
- media page returnig to 404 in rtmedia [closed]
- Remove Woocomerce shop page
- Setting up PubSubHubbub (PUSH) with WordPress
- How do I show a different homepage to logged in and non-logged in users?
- Check if SEO plugin installed
- How can i delete options on plugin uninstallation?
- Advanced Custom Fields – Get value in other plugin file [closed]
- autologin in wordpress when loged in non wp-site
- Image crop, resize and compression plugin?
- How to Include File from Plugins into Template?
- Woocommerce Coupon Menu and Marketing Menu missing After “Coupons can now be managed from Marketing > Coupons.” [closed]
- “uagb/section and uagb/columns block”
- Progmatically adding menu links to the default (Top) or Footer menu
- WordPress Console Application (ability to excecute a custom function via crontab only)
- How to add table class for tables of TinyMCE advanced wordpress plugin? [closed]
- Huge number of 404 pages getting spawned
- Licensing options for WordPress Plugins
- Updating WordPress across multiple versions
- Is there a way to easily manage Project options (custom-fields)
- I am Unable to access WP admin
- Replace woocommerce | (pipe) separator in product variation to , or another character?
- how would I include some html in the header section of a wordpress plugin? I get an error
- Automatic WordPress Backup Plugin works, but says it’s not
- Category “same post” retreive and display
- Adding custom Field To The Posts Listing
- WordPress does not allow me to upload a .xml file
- WordPress FLIR (Facelift Image Replacement) plugin clipping off end of text
- Add a new category for posts
- How to use a shortcode or an application to dynamically embed content from one WordPress site to another?
- Referrer Question From Server Log
- is there a way to preload specific images for desktop users only? (excluding mobile users)
- How to get brand children with woocommerce brands
- How do I insert a shape onto an image and then play an audio file upon mouse hover or mouse click on that shape in WordPress
- How to migrate Powerbuilder page data to another site?
- Is it possible to customize a wordpress post from outside dashboard(Something like site.com/post-type/post/?e=post_id)?
- Bing/msn bots is heavily requesting random of my website
- Woocommerce budget search
- WordPress Thickbox Navigation Issue in Gallery
- Allow vendors on a WordPress site to pick from a gallery of pre-selected images when choosing product’s featured image
- Update and remove buttons are hidden in plugin’s page
- How to detect if i am on plugin’s settings page
- Featured Image id disappeared
- Plugins effecting layout & login
- How to delete only user meta value (not key) from usermeta table in wordpress?
- Style WordPress Custom Post Type Single Page
- How to set up year view for datepicker in The Events Calendar plugin?
- Pull Data from DB for Admin Page Display as Relates to Admin Page Class by BA Internet
- WordPress Custom post type won’t save properly
- A simple script/plugin to display specific page upon hierarchy of selections
- Choose User to email when adding a new post?
- A plugin, which allows editing certain template regions [duplicate]
- Does a Google + RSS Plugin Exist?
- My wordpress website admin panel loads very slow, what can i do about that? [closed]
- Can I install plugins manually on WP.com? [closed]
- PHP $_session is not work in wordpress
- How can I output completely custom content with plugin while still having header, footer, sidebar etc [closed]
- Woo Commerce filter
- WordPress Customise
- Attachement title in wpallimport
- Block registration with viewScript
- Edit a page/post DB data?
- how to update WordPress plugins from external website with nodejs?
- this code is fiven by chat-gtp but nothing match even I key in the value of a cell. help!
- How do i fix this error?
- How do i display the number of images on the “post screen”