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