| @@ -98,15 +98,16 @@ | ||
| 98 | 98 | 'meta' => array( |
| 99 | 99 | 'target' => '_blank', |
| 100 | 100 | ), |
| 101 | 101 | ) ); |
| 102 | - | |
| 103 | - $bar->add_menu( array( | |
| 104 | - 'id' => 'create_content_with_ai', | |
| 105 | - 'parent' => 'hostinger_admin_bar', | |
| 106 | - 'title' => esc_html__( 'Create content with AI', 'hostinger' ), | |
| 107 | - 'href' => self::AI_ASSISTANT_URL, | |
| 108 | - ) ); | |
| 102 | + if ( has_action( 'hostinger_ai_assistant_tab_view' ) && current_user_can( 'edit_posts' ) ) { | |
| 103 | + $bar->add_menu( array( | |
| 104 | + 'id' => 'create_content_with_ai', | |
| 105 | + 'parent' => 'hostinger_admin_bar', | |
| 106 | + 'title' => esc_html__( 'Create content with AI', 'hostinger' ), | |
| 107 | + 'href' => self::AI_ASSISTANT_URL, | |
| 108 | + ) ); | |
| 109 | + } | |
| 109 | 110 | } |
| 110 | 111 | |
| 111 | 112 | public function render(): void { |
| 112 | 113 | $onboarding = new Onboarding(); |