|
Server : LiteSpeed System : Linux srv526460274 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : kerao9884 ( 1082) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /home/kaos188slot.com/public_html/wp-content/plugins/wordpress-seo/src/helpers/ |
Upload File : |
<?php
namespace Yoast\WP\SEO\Helpers;
use Yoast\WP\SEO\Models\Indexable;
/**
* A helper object for permalinks.
*/
class Permalink_Helper {
/**
* Retrieves the permalink for an indexable.
*
* @param Indexable $indexable The indexable.
*
* @return string|null The permalink.
*/
public function get_permalink_for_indexable( $indexable ) {
switch ( true ) {
case $indexable->object_type === 'post':
if ( $indexable->object_sub_type === 'attachment' ) {
return \wp_get_attachment_url( $indexable->object_id );
}
return \get_permalink( $indexable->object_id );
case $indexable->object_type === 'home-page':
return \home_url( '/' );
case $indexable->object_type === 'term':
$term = \get_term( $indexable->object_id );
if ( $term === null || \is_wp_error( $term ) ) {
return null;
}
return \get_term_link( $term, $term->taxonomy );
case $indexable->object_type === 'system-page' && $indexable->object_sub_type === 'search-page':
return \get_search_link();
case $indexable->object_type === 'post-type-archive':
return \get_post_type_archive_link( $indexable->object_sub_type );
case $indexable->object_type === 'user':
return \get_author_posts_url( $indexable->object_id );
}
return null;
}
}