WPSEO_Bulk_List_Table::parse_page_title_column()protectedYoast 1.0

Parsing the title.

Метод класса: WPSEO_Bulk_List_Table{}

Хуков нет.

Возвращает

Строку.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->parse_page_title_column( $rec );
$rec(WP_Post) (обязательный)
Post object.

Код WPSEO_Bulk_List_Table::parse_page_title_column() Yoast 22.4

protected function parse_page_title_column( $rec ) {

	$title = empty( $rec->post_title ) ? __( '(no title)', 'wordpress-seo' ) : $rec->post_title;

	$return = sprintf( '<strong>%1$s</strong>', stripslashes( wp_strip_all_tags( $title ) ) );

	$post_type_object = get_post_type_object( $rec->post_type );
	$can_edit_post    = current_user_can( $post_type_object->cap->edit_post, $rec->ID );

	$actions = [];

	if ( $can_edit_post && $rec->post_status !== 'trash' ) {
		$actions['edit'] = sprintf(
			'<a href="%s" aria-label="%s">%s</a>',
			esc_url( get_edit_post_link( $rec->ID, true ) ),
			/* translators: Hidden accessibility text; %s: post title. */
			esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;', 'wordpress-seo' ), $title ) ),
			__( 'Edit', 'wordpress-seo' )
		);
	}

	if ( $post_type_object->public ) {
		if ( in_array( $rec->post_status, [ 'pending', 'draft', 'future' ], true ) ) {
			if ( $can_edit_post ) {
				$actions['view'] = sprintf(
					'<a href="%s" aria-label="%s">%s</a>',
					esc_url( add_query_arg( 'preview', 'true', get_permalink( $rec->ID ) ) ),
					/* translators: Hidden accessibility text; %s: post title. */
					esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;', 'wordpress-seo' ), $title ) ),
					__( 'Preview', 'wordpress-seo' )
				);
			}
		}
		elseif ( $rec->post_status !== 'trash' ) {
			$actions['view'] = sprintf(
				'<a href="%s" aria-label="%s" rel="bookmark">%s</a>',
				esc_url( get_permalink( $rec->ID ) ),
				/* translators: Hidden accessibility text; %s: post title. */
				esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'wordpress-seo' ), $title ) ),
				__( 'View', 'wordpress-seo' )
			);
		}
	}

	$return .= $this->row_actions( $actions );

	return $return;
}