| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | * @package Polylang |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | /** |
| 7 | - * Manages links related functions. | |
| 7 | + * Manages links related functions | |
| 8 | 8 | * |
| 9 | 9 | * @since 1.8 |
| 10 | 10 | */ |
| 11 | 11 | class PLL_Admin_Links extends PLL_Links { |
| @@ -10,14 +10,14 @@ | ||
| 10 | 10 | */ |
| 11 | 11 | class PLL_Admin_Links extends PLL_Links { |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | - * Returns the html markup for a new translation link. | |
| 14 | + * Returns html markup for a new translation link | |
| 15 | 15 | * |
| 16 | 16 | * @since 2.6 |
| 17 | 17 | * |
| 18 | - * @param string $link The new translation link. | |
| 19 | - * @param PLL_Language $language The language of the new translation. | |
| 18 | + * @param string $link The new translation link. | |
| 19 | + * @param object $language The language of the new translation. | |
| 20 | 20 | * @return string |
| 21 | 21 | */ |
| 22 | 22 | protected function new_translation_link( $link, $language ) { |
| 23 | 23 | $str = ''; |
| @@ -37,14 +37,14 @@ | ||
| 37 | 37 | return $str; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | - * Returns the html markup for a translation link. | |
| 41 | + * Returns html markup for a translation link | |
| 42 | 42 | * |
| 43 | 43 | * @since 2.6 |
| 44 | 44 | * |
| 45 | - * @param string $link The translation link. | |
| 46 | - * @param PLL_Language $language The language of the translation. | |
| 45 | + * @param string $link The translation link. | |
| 46 | + * @param object $language The language of the translation. | |
| 47 | 47 | * @return string |
| 48 | 48 | */ |
| 49 | 49 | public function edit_translation_link( $link, $language ) { |
| 50 | 50 | return $link ? sprintf( |
| @@ -55,22 +55,22 @@ | ||
| 55 | 55 | ) : ''; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | - * Get the link to create a new post translation. | |
| 59 | + * Get the link to create a new post translation | |
| 60 | 60 | * |
| 61 | 61 | * @since 1.5 |
| 62 | 62 | * |
| 63 | - * @param int $post_id The source post id. | |
| 64 | - * @param PLL_Language $language The language of the new translation. | |
| 65 | - * @param string $context Optional. Defaults to 'display' which encodes '&' to '&'. | |
| 66 | - * Otherwise, preserves '&'. | |
| 63 | + * @param int $post_id The source post id. | |
| 64 | + * @param object $language The language of the new translation. | |
| 65 | + * @param string $context Optional. Defaults to 'display' which encodes '&' to '&'. | |
| 66 | + * Otherwise, preserves '&'. | |
| 67 | 67 | * @return string |
| 68 | 68 | */ |
| 69 | 69 | public function get_new_post_translation_link( $post_id, $language, $context = 'display' ) { |
| 70 | 70 | $post_type = get_post_type( $post_id ); |
| 71 | 71 | $post_type_object = get_post_type_object( get_post_type( $post_id ) ); |
| 72 | - if ( empty( $post_type_object ) || ! current_user_can( $post_type_object->cap->create_posts ) ) { | |
| 72 | + if ( ! current_user_can( $post_type_object->cap->create_posts ) ) { | |
| 73 | 73 | return ''; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // Special case for the privacy policy page which is associated to a specific capability |
| @@ -112,26 +112,26 @@ | ||
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | - * Filters the new post translation link. | |
| 116 | + * Filter the new post translation link | |
| 117 | 117 | * |
| 118 | 118 | * @since 1.8 |
| 119 | 119 | * |
| 120 | - * @param string $link The new post translation link. | |
| 121 | - * @param PLL_Language $language The language of the new translation. | |
| 122 | - * @param int $post_id The source post id. | |
| 120 | + * @param string $link the new post translation link | |
| 121 | + * @param object $language the language of the new translation | |
| 122 | + * @param int $post_id the source post id | |
| 123 | 123 | */ |
| 124 | 124 | return apply_filters( 'pll_get_new_post_translation_link', $link, $language, $post_id ); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | - * Returns the html markup for a new post translation link. | |
| 128 | + * Returns html markup for a new post translation link | |
| 129 | 129 | * |
| 130 | 130 | * @since 1.8 |
| 131 | 131 | * |
| 132 | - * @param int $post_id The source post id. | |
| 133 | - * @param PLL_Language $language The language of the new translation. | |
| 132 | + * @param int $post_id | |
| 133 | + * @param object $language | |
| 134 | 134 | * @return string |
| 135 | 135 | */ |
| 136 | 136 | public function new_post_translation_link( $post_id, $language ) { |
| 137 | 137 | $link = $this->get_new_post_translation_link( $post_id, $language ); |
| @@ -138,13 +138,13 @@ | ||
| 138 | 138 | return $this->new_translation_link( $link, $language ); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | - * Returns the html markup for a post translation link. | |
| 142 | + * Returns html markup for a translation link | |
| 143 | 143 | * |
| 144 | 144 | * @since 1.4 |
| 145 | 145 | * |
| 146 | - * @param int $post_id The translation post id. | |
| 146 | + * @param int $post_id translation post id | |
| 147 | 147 | * @return string |
| 148 | 148 | */ |
| 149 | 149 | public function edit_post_translation_link( $post_id ) { |
| 150 | 150 | $link = get_edit_post_link( $post_id ); |
| @@ -152,16 +152,16 @@ | ||
| 152 | 152 | return $this->edit_translation_link( $link, $language ); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | - * Get the link to create a new term translation. | |
| 156 | + * Get the link to create a new term translation | |
| 157 | 157 | * |
| 158 | 158 | * @since 1.5 |
| 159 | 159 | * |
| 160 | - * @param int $term_id Source term id. | |
| 161 | - * @param string $taxonomy Taxonomy name. | |
| 162 | - * @param string $post_type Post type name. | |
| 163 | - * @param PLL_Language $language The language of the new translation. | |
| 160 | + * @param int $term_id | |
| 161 | + * @param string $taxonomy | |
| 162 | + * @param string $post_type | |
| 163 | + * @param object $language | |
| 164 | 164 | * @return string |
| 165 | 165 | */ |
| 166 | 166 | public function get_new_term_translation_link( $term_id, $taxonomy, $post_type, $language ) { |
| 167 | 167 | $tax = get_taxonomy( $taxonomy ); |
| @@ -178,30 +178,30 @@ | ||
| 178 | 178 | |
| 179 | 179 | $link = add_query_arg( $args, admin_url( 'edit-tags.php' ) ); |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | - * Filters the new term translation link. | |
| 182 | + * Filter the new term translation link | |
| 183 | 183 | * |
| 184 | 184 | * @since 1.8 |
| 185 | 185 | * |
| 186 | - * @param string $link The new term translation link. | |
| 187 | - * @param PLL_Language $language The language of the new translation. | |
| 188 | - * @param int $term_id The source term id. | |
| 189 | - * @param string $taxonomy Taxonomy name. | |
| 190 | - * @param string $post_type Post type name. | |
| 186 | + * @param string $link the new term translation link | |
| 187 | + * @param object $language the language of the new translation | |
| 188 | + * @param int $term_id the source term id | |
| 189 | + * @param string $taxonomy | |
| 190 | + * @param string $post_type | |
| 191 | 191 | */ |
| 192 | 192 | return apply_filters( 'pll_get_new_term_translation_link', $link, $language, $term_id, $taxonomy, $post_type ); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
| 196 | - * Returns the html markup for a new term translation. | |
| 196 | + * Returns html markup for a new term translation | |
| 197 | 197 | * |
| 198 | 198 | * @since 1.8 |
| 199 | 199 | * |
| 200 | - * @param int $term_id Source term id. | |
| 201 | - * @param string $taxonomy Taxonomy name. | |
| 202 | - * @param string $post_type Post type name. | |
| 203 | - * @param PLL_Language $language The language of the new translation. | |
| 200 | + * @param int $term_id | |
| 201 | + * @param string $taxonomy | |
| 202 | + * @param string $post_type | |
| 203 | + * @param object $language | |
| 204 | 204 | * @return string |
| 205 | 205 | */ |
| 206 | 206 | public function new_term_translation_link( $term_id, $taxonomy, $post_type, $language ) { |
| 207 | 207 | $link = $this->get_new_term_translation_link( $term_id, $taxonomy, $post_type, $language ); |
| @@ -208,15 +208,15 @@ | ||
| 208 | 208 | return $this->new_translation_link( $link, $language ); |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /** |
| 212 | - * Returns the html markup for a term translation link. | |
| 212 | + * Returns html markup for a term translation link | |
| 213 | 213 | * |
| 214 | 214 | * @since 1.4 |
| 215 | 215 | * |
| 216 | - * @param int $term_id Translation term id. | |
| 217 | - * @param string $taxonomy Taxonomy name. | |
| 218 | - * @param string $post_type Post type name. | |
| 216 | + * @param object $term_id translation term id | |
| 217 | + * @param string $taxonomy | |
| 218 | + * @param string $post_type | |
| 219 | 219 | * @return string |
| 220 | 220 | */ |
| 221 | 221 | public function edit_term_translation_link( $term_id, $taxonomy, $post_type ) { |
| 222 | 222 | $link = get_edit_term_link( $term_id, $taxonomy, $post_type ); |