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