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