@@ 1036-1067 (lines=32) @@ | ||
1033 | } |
|
1034 | ||
1035 | // Testimonials. |
|
1036 | if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_testimonial' ) ) { |
|
1037 | $testimonials_title = $this->create_menu_item_pair( |
|
1038 | array( |
|
1039 | 'url' => 'https://wordpress.com/types/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ), |
|
1040 | 'id' => 'wp-admin-bar-edit-testimonial', |
|
1041 | 'label' => esc_html__( 'Testimonials', 'jetpack' ), |
|
1042 | ), |
|
1043 | array( |
|
1044 | 'url' => 'https://wordpress.com/edit/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ), |
|
1045 | 'id' => 'wp-admin-bar-new-testimonial', |
|
1046 | 'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ), |
|
1047 | ) |
|
1048 | ); |
|
1049 | ||
1050 | if ( ! current_user_can( 'edit_pages' ) ) { |
|
1051 | $testimonials_title = $this->create_menu_item_anchor( |
|
1052 | 'ab-item ab-primary mb-icon', |
|
1053 | 'https://wordpress.com/types/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ), |
|
1054 | esc_html__( 'Testimonials', 'jetpack' ), |
|
1055 | 'wp-admin-bar-edit-testimonial' |
|
1056 | ); |
|
1057 | } |
|
1058 | ||
1059 | $wp_admin_bar->add_menu( |
|
1060 | array( |
|
1061 | 'parent' => 'publish', |
|
1062 | 'id' => 'new-jetpack-testimonial', |
|
1063 | 'title' => $testimonials_title, |
|
1064 | 'meta' => array( |
|
1065 | 'class' => 'inline-action', |
|
1066 | ), |
|
1067 | ) |
|
1068 | ); |
|
1069 | } |
|
1070 | ||
@@ 1072-1103 (lines=32) @@ | ||
1069 | } |
|
1070 | ||
1071 | // Portfolio. |
|
1072 | if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) { |
|
1073 | $portfolios_title = $this->create_menu_item_pair( |
|
1074 | array( |
|
1075 | 'url' => 'https://wordpress.com/types/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ), |
|
1076 | 'id' => 'wp-admin-bar-edit-portfolio', |
|
1077 | 'label' => esc_html__( 'Portfolio', 'jetpack' ), |
|
1078 | ), |
|
1079 | array( |
|
1080 | 'url' => 'https://wordpress.com/edit/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ), |
|
1081 | 'id' => 'wp-admin-bar-new-portfolio', |
|
1082 | 'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ), |
|
1083 | ) |
|
1084 | ); |
|
1085 | ||
1086 | if ( ! current_user_can( 'edit_pages' ) ) { |
|
1087 | $portfolios_title = $this->create_menu_item_anchor( |
|
1088 | 'ab-item ab-primary mb-icon', |
|
1089 | 'https://wordpress.com/types/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ), |
|
1090 | esc_html__( 'Portfolio', 'jetpack' ), |
|
1091 | 'wp-admin-bar-edit-portfolio' |
|
1092 | ); |
|
1093 | } |
|
1094 | ||
1095 | $wp_admin_bar->add_menu( |
|
1096 | array( |
|
1097 | 'parent' => 'publish', |
|
1098 | 'id' => 'new-jetpack-portfolio', |
|
1099 | 'title' => $portfolios_title, |
|
1100 | 'meta' => array( |
|
1101 | 'class' => 'inline-action', |
|
1102 | ), |
|
1103 | ) |
|
1104 | ); |
|
1105 | } |
|
1106 |