The title. */ protected function getPostTitle( $postId, $seoTitle = '' ) { $post = get_post( $postId ); if ( ! is_object( $post ) ) { return ''; } $postType = $post->post_type; $oldOptions = get_option( 'aioseo_options_v3' ); $titleFormat = isset( $oldOptions[ "aiosp_{$postType}_title_format" ] ) ? $oldOptions[ "aiosp_{$postType}_title_format" ] : ''; $seoTitle = aioseo()->helpers->pregReplace( '/(%post_title%|%page_title%)/', $seoTitle, $titleFormat ); return aioseo()->helpers->sanitizeOption( aioseo()->migration->helpers->macrosToSmartTags( $seoTitle ) ); } }