Daniel Milner on "[Plugin: Admin Page Spider] A couple of suggestions from a fellow plugin developer"

ساخت وبلاگ

Beaver Builder does their add_action right up front, so remove_action should work if you add it to the plugins_loaded action hook. You just have to make sure that remove_action happens after add_action.

The only problem with hooking in to wp_before_admin_bar_render to remove an item, is that by that point, the admin bar is pretty much set in stone. Meaning that any plugins that are going to add their menus or sub-menus to it have already done so. Mainly, what I'm saying is that if you want to remove a menu item, you should probably prevent it from being added in the first place instead of removing it after it's already there.

In my situation, my plugin (Beaver Tunnels), adds a sub-menu to the Page Builder menu. I can run a check to make sure that the Page Builder menu exists and create my own menu if it doesn't…but when the menu is removed right before it's output to the page, everything gets lost.

For now, I've added a specific check to look for the apspider_admin_bar_removal action hook and add my own menu if it exists.

Btw, your plugin is great and I see it offering a great value to a lot of people.

If you have any questions or are just stuck on something not working right. Feel free to hit me up. I'd be glad to help out.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 179 تاريخ : شنبه 25 ارديبهشت 1395 ساعت: 2:55