WPSEO_Meta_Columns::column_content
Displays the column content for the given column.
Метод класса: WPSEO_Meta_Columns{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WPSEO_Meta_Columns = new WPSEO_Meta_Columns(); $WPSEO_Meta_Columns->column_content( $column_name, $post_id );
- $column_name(строка) (обязательный)
- Column to display the content for.
- $post_id(int) (обязательный)
- Post to display the column content for.
Код WPSEO_Meta_Columns::column_content() WPSEO Meta Columns::column content Yoast 27.6
public function column_content( $column_name, $post_id ) {
if ( $this->display_metabox() === false ) {
return;
}
switch ( $column_name ) {
case 'wpseo-score':
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Correctly escaped in render_score_indicator() method.
echo $this->parse_column_score( $post_id );
return;
case 'wpseo-score-readability':
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Correctly escaped in render_score_indicator() method.
echo $this->parse_column_score_readability( $post_id );
return;
case 'wpseo-title':
$meta = $this->get_meta( $post_id );
if ( $meta ) {
echo esc_html( $meta->title );
}
return;
case 'wpseo-metadesc':
$metadesc_val = '';
$meta = $this->get_meta( $post_id );
if ( $meta ) {
$metadesc_val = $meta->meta_description;
}
if ( $metadesc_val === '' ) {
echo '<span aria-hidden="true">—</span><span class="screen-reader-text">',
/* translators: Hidden accessibility text. */
esc_html__( 'Meta description not set.', 'wordpress-seo' ),
'</span>';
return;
}
echo esc_html( $metadesc_val );
return;
case 'wpseo-focuskw':
$focuskw_val = WPSEO_Meta::get_value( 'focuskw', $post_id );
if ( $focuskw_val === '' ) {
echo '<span aria-hidden="true">—</span><span class="screen-reader-text">',
/* translators: Hidden accessibility text. */
esc_html__( 'Focus keyphrase not set.', 'wordpress-seo' ),
'</span>';
return;
}
echo esc_html( $focuskw_val );
return;
}
}