← All changes
|
src/integrations/admin/link-count-columns-integration.php
+13
-7
18.4
→
28.5
View file →
| @@ -21,9 +21,9 @@ | ||
| 21 | 21 | * Partial column name. |
| 22 | 22 | * |
| 23 | 23 | * @var string |
| 24 | 24 | */ |
| 25 | - const COLUMN_LINKED = 'linked'; | |
| 25 | + public const COLUMN_LINKED = 'linked'; | |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Partial column name. |
| 29 | 29 | * |
| @@ -28,9 +28,9 @@ | ||
| 28 | 28 | * Partial column name. |
| 29 | 29 | * |
| 30 | 30 | * @var string |
| 31 | 31 | */ |
| 32 | - const COLUMN_LINKS = 'links'; | |
| 32 | + public const COLUMN_LINKS = 'links'; | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * The post type helper. |
| 36 | 36 | * |
| @@ -96,9 +96,9 @@ | ||
| 96 | 96 | public function register_hooks() { |
| 97 | 97 | \add_filter( 'posts_clauses', [ $this, 'order_by_links' ], 1, 2 ); |
| 98 | 98 | \add_filter( 'posts_clauses', [ $this, 'order_by_linked' ], 1, 2 ); |
| 99 | 99 | |
| 100 | - \add_filter( 'admin_init', [ $this, 'register_init_hooks' ] ); | |
| 100 | + \add_action( 'admin_init', [ $this, 'register_init_hooks' ] ); | |
| 101 | 101 | |
| 102 | 102 | // Adds a filter to exclude the attachments from the link count. |
| 103 | 103 | \add_filter( 'wpseo_link_count_post_types', [ 'WPSEO_Post_Type', 'filter_attachment_post_type' ] ); |
| 104 | 104 | } |
| @@ -104,8 +104,10 @@ | ||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * Register hooks that need to be registered after `init` due to all post types not yet being registered. |
| 108 | + * | |
| 109 | + * @return void | |
| 108 | 110 | */ |
| 109 | 111 | public function register_init_hooks() { |
| 110 | 112 | $public_post_types = \apply_filters( 'wpseo_link_count_post_types', $this->post_type_helper->get_accessible_post_types() ); |
| 111 | 113 | |
| @@ -133,17 +135,19 @@ | ||
| 133 | 135 | } |
| 134 | 136 | |
| 135 | 137 | $columns[ 'wpseo-' . self::COLUMN_LINKS ] = \sprintf( |
| 136 | 138 | '<span class="yoast-linked-to yoast-column-header-has-tooltip" data-tooltip-text="%1$s"><span class="screen-reader-text">%2$s</span></span>', |
| 137 | - \esc_attr__( 'Number of outgoing internal links in this post. See "Yoast Columns" text in the help tab for more info.', 'wordpress-seo' ), | |
| 138 | - \esc_html__( 'Outgoing internal links', 'wordpress-seo' ) | |
| 139 | + \esc_attr__( 'Number of outgoing internal links in this post.', 'wordpress-seo' ), | |
| 140 | + /* translators: Hidden accessibility text. */ | |
| 141 | + \esc_html__( 'Outgoing internal links', 'wordpress-seo' ), | |
| 139 | 142 | ); |
| 140 | 143 | |
| 141 | 144 | if ( $this->post_link_indexing_action->get_total_unindexed() === 0 ) { |
| 142 | 145 | $columns[ 'wpseo-' . self::COLUMN_LINKED ] = \sprintf( |
| 143 | 146 | '<span class="yoast-linked-from yoast-column-header-has-tooltip" data-tooltip-text="%1$s"><span class="screen-reader-text">%2$s</span></span>', |
| 144 | - \esc_attr__( 'Number of internal links linking to this post. See "Yoast Columns" text in the help tab for more info.', 'wordpress-seo' ), | |
| 145 | - \esc_html__( 'Received internal links', 'wordpress-seo' ) | |
| 147 | + \esc_attr__( 'Number of internal links linking to this post.', 'wordpress-seo' ), | |
| 148 | + /* translators: Hidden accessibility text. */ | |
| 149 | + \esc_html__( 'Received internal links', 'wordpress-seo' ), | |
| 146 | 150 | ); |
| 147 | 151 | } |
| 148 | 152 | |
| 149 | 153 | return $columns; |
| @@ -216,8 +220,10 @@ | ||
| 216 | 220 | * Displays the column content for the given column. |
| 217 | 221 | * |
| 218 | 222 | * @param string $column_name Column to display the content for. |
| 219 | 223 | * @param int $post_id Post to display the column content for. |
| 224 | + * | |
| 225 | + * @return void | |
| 220 | 226 | */ |
| 221 | 227 | public function column_content( $column_name, $post_id ) { |
| 222 | 228 | $indexable = $this->admin_columns_cache->get_indexable( $post_id ); |
| 223 | 229 | // Nothing to output if we don't have the value. |