@@ 1062-1093 (lines=32) @@ | ||
1059 | } |
|
1060 | ||
1061 | // Testimonials. |
|
1062 | if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_testimonial' ) ) { |
|
1063 | $testimonials_title = $this->create_menu_item_pair( |
|
1064 | array( |
|
1065 | 'url' => 'https://wordpress.com/types/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ), |
|
1066 | 'id' => 'wp-admin-bar-edit-testimonial', |
|
1067 | 'label' => esc_html__( 'Testimonials', 'jetpack' ), |
|
1068 | ), |
|
1069 | array( |
|
1070 | 'url' => 'https://wordpress.com/edit/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ), |
|
1071 | 'id' => 'wp-admin-bar-new-testimonial', |
|
1072 | 'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ), |
|
1073 | ) |
|
1074 | ); |
|
1075 | ||
1076 | if ( ! current_user_can( 'edit_pages' ) ) { |
|
1077 | $testimonials_title = $this->create_menu_item_anchor( |
|
1078 | 'ab-item ab-primary mb-icon', |
|
1079 | 'https://wordpress.com/types/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ), |
|
1080 | esc_html__( 'Testimonials', 'jetpack' ), |
|
1081 | 'wp-admin-bar-edit-testimonial' |
|
1082 | ); |
|
1083 | } |
|
1084 | ||
1085 | $wp_admin_bar->add_menu( |
|
1086 | array( |
|
1087 | 'parent' => 'publish', |
|
1088 | 'id' => 'new-jetpack-testimonial', |
|
1089 | 'title' => $testimonials_title, |
|
1090 | 'meta' => array( |
|
1091 | 'class' => 'inline-action', |
|
1092 | ), |
|
1093 | ) |
|
1094 | ); |
|
1095 | } |
|
1096 | ||
@@ 1098-1129 (lines=32) @@ | ||
1095 | } |
|
1096 | ||
1097 | // Portfolio. |
|
1098 | if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) { |
|
1099 | $portfolios_title = $this->create_menu_item_pair( |
|
1100 | array( |
|
1101 | 'url' => 'https://wordpress.com/types/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ), |
|
1102 | 'id' => 'wp-admin-bar-edit-portfolio', |
|
1103 | 'label' => esc_html__( 'Portfolio', 'jetpack' ), |
|
1104 | ), |
|
1105 | array( |
|
1106 | 'url' => 'https://wordpress.com/edit/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ), |
|
1107 | 'id' => 'wp-admin-bar-new-portfolio', |
|
1108 | 'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ), |
|
1109 | ) |
|
1110 | ); |
|
1111 | ||
1112 | if ( ! current_user_can( 'edit_pages' ) ) { |
|
1113 | $portfolios_title = $this->create_menu_item_anchor( |
|
1114 | 'ab-item ab-primary mb-icon', |
|
1115 | 'https://wordpress.com/types/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ), |
|
1116 | esc_html__( 'Portfolio', 'jetpack' ), |
|
1117 | 'wp-admin-bar-edit-portfolio' |
|
1118 | ); |
|
1119 | } |
|
1120 | ||
1121 | $wp_admin_bar->add_menu( |
|
1122 | array( |
|
1123 | 'parent' => 'publish', |
|
1124 | 'id' => 'new-jetpack-portfolio', |
|
1125 | 'title' => $portfolios_title, |
|
1126 | 'meta' => array( |
|
1127 | 'class' => 'inline-action', |
|
1128 | ), |
|
1129 | ) |
|
1130 | ); |
|
1131 | } |
|
1132 |