@@ 1161-1194 (lines=34) @@ | ||
1158 | } |
|
1159 | ||
1160 | // Testimonials. |
|
1161 | if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_testimonial' ) ) { |
|
1162 | $testimonials_title = $this->create_menu_item_pair( |
|
1163 | array( |
|
1164 | 'url' => Redirect::get_url( 'calypso-list-jetpack-testimonial' ), |
|
1165 | 'id' => 'wp-admin-bar-edit-testimonial', |
|
1166 | 'label' => esc_html__( 'Testimonials', 'jetpack' ), |
|
1167 | ), |
|
1168 | array( |
|
1169 | 'url' => Redirect::get_url( 'calypso-edit-jetpack-testimonial' ), |
|
1170 | 'id' => 'wp-admin-bar-new-testimonial', |
|
1171 | 'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ), |
|
1172 | ) |
|
1173 | ); |
|
1174 | ||
1175 | if ( ! current_user_can( 'edit_pages' ) ) { |
|
1176 | $testimonials_title = $this->create_menu_item_anchor( |
|
1177 | 'ab-item ab-primary mb-icon', |
|
1178 | Redirect::get_url( 'calypso-list-jetpack-testimonial' ), |
|
1179 | esc_html__( 'Testimonials', 'jetpack' ), |
|
1180 | 'wp-admin-bar-edit-testimonial' |
|
1181 | ); |
|
1182 | } |
|
1183 | ||
1184 | $wp_admin_bar->add_menu( |
|
1185 | array( |
|
1186 | 'parent' => 'publish', |
|
1187 | 'id' => 'new-jetpack-testimonial', |
|
1188 | 'title' => $testimonials_title, |
|
1189 | 'meta' => array( |
|
1190 | 'class' => 'inline-action', |
|
1191 | ), |
|
1192 | ) |
|
1193 | ); |
|
1194 | } |
|
1195 | ||
1196 | // Portfolio. |
|
1197 | if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) { |
|
@@ 1197-1230 (lines=34) @@ | ||
1194 | } |
|
1195 | ||
1196 | // Portfolio. |
|
1197 | if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) { |
|
1198 | $portfolios_title = $this->create_menu_item_pair( |
|
1199 | array( |
|
1200 | 'url' => Redirect::get_url( 'calypso-list-jetpack-portfolio' ), |
|
1201 | 'id' => 'wp-admin-bar-edit-portfolio', |
|
1202 | 'label' => esc_html__( 'Portfolio', 'jetpack' ), |
|
1203 | ), |
|
1204 | array( |
|
1205 | 'url' => Redirect::get_url( 'calypso-edit-jetpack-portfolio' ), |
|
1206 | 'id' => 'wp-admin-bar-new-portfolio', |
|
1207 | 'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ), |
|
1208 | ) |
|
1209 | ); |
|
1210 | ||
1211 | if ( ! current_user_can( 'edit_pages' ) ) { |
|
1212 | $portfolios_title = $this->create_menu_item_anchor( |
|
1213 | 'ab-item ab-primary mb-icon', |
|
1214 | Redirect::get_url( 'calypso-list-jetpack-portfolio' ), |
|
1215 | esc_html__( 'Portfolio', 'jetpack' ), |
|
1216 | 'wp-admin-bar-edit-portfolio' |
|
1217 | ); |
|
1218 | } |
|
1219 | ||
1220 | $wp_admin_bar->add_menu( |
|
1221 | array( |
|
1222 | 'parent' => 'publish', |
|
1223 | 'id' => 'new-jetpack-portfolio', |
|
1224 | 'title' => $portfolios_title, |
|
1225 | 'meta' => array( |
|
1226 | 'class' => 'inline-action', |
|
1227 | ), |
|
1228 | ) |
|
1229 | ); |
|
1230 | } |
|
1231 | ||
1232 | if ( current_user_can( 'edit_theme_options' ) ) { |
|
1233 | // Look and Feel group. |