Skip to content

Instantly share code, notes, and snippets.

@MogulChris
Created January 26, 2022 21:23
Show Gist options
  • Save MogulChris/3a2d8a9888eedaabcf914f9736cad981 to your computer and use it in GitHub Desktop.
Save MogulChris/3a2d8a9888eedaabcf914f9736cad981 to your computer and use it in GitHub Desktop.
Filtering the 'Edit with Elementor' admin menu
<?php
function example_admin_bar_settings($settings){
//print_r($settings);
foreach($settings['elementor_edit_page']['children'] as $id => $item){
//$id is the post id, perform whatever checks you want
//if(get_post_type($id) == 'post_type_i_dont_want') unset($settings['elementor_edit_page']['children'][$id]);
}
return $settings;
}
add_filter('elementor/frontend/admin_bar/settings','example_admin_bar_settings');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment