PHP 클래스 The_SEO_Framework\Generate_Url

Generates URL and permalink SEO data based on content.
부터: 2.7.1
상속: extends Generate_Title
파일 보기 프로젝트 열기: sybrew/the-seo-framework

보호된 프로퍼티들

프로퍼티 타입 설명
$current_host Holds current HTTP host.
$url_slashit Whether to slash the url or not. Used when query vars are in url.

공개 메소드들

메소드 설명
add_url_host ( string $path = '' ) : string Create full valid URL with parsed host.
add_url_subdomain ( string $url = '' ) : string Adds subdomain to input URL.
build_singular_relative_url ( integer $post_id = null, array $args = [] ) : relative Generates relative URL for the Homepage and Singular Posts.
generate_url_path ( array $args = [] ) : string Generate URL from arguments.
get_current_subdomain ( null | string $set = null, boolean $unset = false ) : string | boolean Fetches current subdomain set by $this->set_current_subdomain();
get_home_host ( ) : string Fetches home URL host. Like "wordpress.org".
get_home_path ( ) : string Fetches home URL subdirectory path. Like "wordpress.org/plugins/".
get_paged_post_url ( integer $i, integer $post_id, string $pos = 'prev' ) : string Returns the special URL of a paged post.
get_paged_url ( string $prev_next = 'next', integer $post_id ) : string | null Generates Previous and Next links.
get_relative_qtranslate_url ( string $path = '', integer $post_id = '' ) Generates qtranslate URL.
get_relative_term_url ( object $term = null, array | boolean $args = [] ) : Relative Generates relative URL for current term.
get_relative_wmpl_url ( string $path = '', integer $post_id = '' ) : relative Generate relative WPML url.
get_shortlink ( integer $post_id ) : string | null Generates shortlink URL.
get_translation_path ( string $path = '', integer $post_id = null, boolean $external = false ) : relative Generates relative URL for current post_ID for translation plugins.
make_fully_qualified_url ( string $url ) : string Makes a fully qualified URL from input. Always uses http to fix.
parse_url_args ( array $args = [], array $defaults = [], boolean $get_defaults = false ) : array Parse and sanitize url args.
permalink_structure ( ) : string Cached WordPress permalink structure settings.
reparse_url_args ( array $args = [] ) : array Reparse URL args.
set_current_subdomain ( string $subdomain = '' ) : string Sets current working subdomain.
set_url_scheme ( string $url, string $scheme = null, boolean $use_filter = true ) : string Sets URL scheme for input URL.
set_url_scheme_filter ( string $url, $current_scheme ) Set URL scheme based on filter.
the_url ( string $url = '', array $args = [] ) : string Creates canonical URL.
the_url_donncha_domainmap ( string $path, boolean $get_scheme = false ) : string | array | void Try to get an canonical URL when Donncha Domain Mapping is active.
the_url_wpmudev_domainmap ( string $path, boolean $get_scheme = false ) : string | array | void Creates a full canonical URL when WPMUdev Domain Mapping is active from path.
unset_current_subdomain ( ) Unsets current working subdomain.

보호된 메소드들

메소드 설명
__construct ( ) Constructor, load parent constructor and set up variables.
maybe_get_paged ( integer $paged, boolean $singular = false, boolean $plural = true ) : integer | boolean Add $paged if Paginated and allowed through arguments.

메소드 상세

__construct() 보호된 메소드

Constructor, load parent constructor and set up variables.
protected __construct ( )

add_url_host() 공개 메소드

Don't forget to use set_url_scheme() afterwards. Note: will return $path if no host can be found.
부터: 2.6.5
public add_url_host ( string $path = '' ) : string
$path string Current path.
리턴 string Full valid URL with http host.

add_url_subdomain() 공개 메소드

Adds subdomain to input URL.
부터: 2.6.5
public add_url_subdomain ( string $url = '' ) : string
$url string The current URL without subdomain.
리턴 string $url Fully qualified URL with possible subdomain.

build_singular_relative_url() 공개 메소드

Generates relative URL for the Homepage and Singular Posts.
부터: 2.6.5
public build_singular_relative_url ( integer $post_id = null, array $args = [] ) : relative
$post_id integer The ID.
$args array The URL arguments.
리턴 relative Post or Page url.

generate_url_path() 공개 메소드

Generate URL from arguments.
부터: 2.6.0
public generate_url_path ( array $args = [] ) : string
$args array the URL args.
리턴 string $path

get_current_subdomain() 공개 메소드

Fetches current subdomain set by $this->set_current_subdomain();
부터: 2.7.0
public get_current_subdomain ( null | string $set = null, boolean $unset = false ) : string | boolean
$set null | string Whether to set a new subdomain.
$unset boolean Whether to remove subdomain from cache.
리턴 string | boolean The set subdomain, false if none is set.

get_home_host() 공개 메소드

If this fails, you're going to have a bad time.
부터: 2.7.0
public get_home_host ( ) : string
리턴 string The home URL host.

get_home_path() 공개 메소드

Fetches home URL subdirectory path. Like "wordpress.org/plugins/".
부터: 2.7.0
public get_home_path ( ) : string
리턴 string The home URL path.

get_paged_post_url() 공개 메소드

Taken from _wp_link_page() in WordPress core, but instead of anchor markup, just return the URL. Also adds WPMUdev Domain Mapping support and is optimized for speed.
부터: 2.2.4
public get_paged_post_url ( integer $i, integer $post_id, string $pos = 'prev' ) : string
$i integer The page number to generate the URL from.
$post_id integer The post ID
$pos string Which url to get, accepts next|prev
리턴 string Unescaped URL

get_paged_url() 공개 메소드

Generates Previous and Next links.
부터: 2.2.4
public get_paged_url ( string $prev_next = 'next', integer $post_id ) : string | null
$prev_next string Previous or next page link.
$post_id integer The post ID.
리턴 string | null Escaped site Pagination URL

get_relative_qtranslate_url() 공개 메소드

Generates qtranslate URL.
부터: 2.6.0
public get_relative_qtranslate_url ( string $path = '', integer $post_id = '' )
$path string The current path.
$post_id integer The Post ID. Unused until qTranslate provides external URL forgery.

get_relative_term_url() 공개 메소드

Generates relative URL for current term.
부터: 2.4.2
부터: 2.7.0 Added home directory to output.
public get_relative_term_url ( object $term = null, array | boolean $args = [] ) : Relative
$term object The term object.
$args array | boolean { 'external' : Whether to fetch the WP Request or get the permalink by Post Object. 'paged' : Whether to add pagination for all types. 'paged_plural' : Whether to add pagination for the second or later page. }
리턴 Relative term or taxonomy URL.

get_relative_wmpl_url() 공개 메소드

Generate relative WPML url.
부터: 2.4.3
public get_relative_wmpl_url ( string $path = '', integer $post_id = '' ) : relative
$path string The current path.
$post_id integer The Post ID.
리턴 relative path for WPML urls.

get_translation_path() 공개 메소드

Generates relative URL for current post_ID for translation plugins.
부터: 2.6.0
public get_translation_path ( string $path = '', integer $post_id = null, boolean $external = false ) : relative
$path string the current URL path.
$post_id integer The post ID.
$external boolean Whether the request for URL generation is external.
리턴 relative Post or Page url.

make_fully_qualified_url() 공개 메소드

Makes a fully qualified URL from input. Always uses http to fix.
부터: 2.6.5
public make_fully_qualified_url ( string $url ) : string
$url string Required the current maybe not fully qualified URL.
리턴 string $url

maybe_get_paged() 보호된 메소드

Add $paged if Paginated and allowed through arguments.
부터: 2.6.0
protected maybe_get_paged ( integer $paged, boolean $singular = false, boolean $plural = true ) : integer | boolean
$paged integer
$singular boolean Whether to allow plural and singular.
$plural boolean Whether to allow plural regardless.
리턴 integer | boolean $paged. False if not allowed. Int if allowed.

parse_url_args() 공개 메소드

Parse and sanitize url args.
부터: 2.4.2
부터: 2.5.0:
public parse_url_args ( array $args = [], array $defaults = [], boolean $get_defaults = false ) : array
$args array required The passed arguments.
$defaults array The default arguments.
$get_defaults boolean Return the default arguments. Ignoring $args.
리턴 array $args parsed args.

reparse_url_args() 공개 메소드

Reparse URL args.
부터: 2.6.2
public reparse_url_args ( array $args = [] ) : array
$args array required The passed arguments.
리턴 array $args parsed args.

set_current_subdomain() 공개 메소드

Sets current working subdomain.
부터: 2.7.0
public set_current_subdomain ( string $subdomain = '' ) : string
$subdomain string The current subdomain.
리턴 string The set subdomain.

set_url_scheme() 공개 메소드

WordPress core function, without filter.
부터: 2.4.2
public set_url_scheme ( string $url, string $scheme = null, boolean $use_filter = true ) : string
$url string Absolute url that includes a scheme.
$scheme string optional. Scheme to give $url. Currently 'http', 'https', 'login', 'login_post', 'admin', or 'relative'.
$use_filter boolean Whether to parse filters.
리턴 string url with chosen scheme.

set_url_scheme_filter() 공개 메소드

Set URL scheme based on filter.
부터: 2.6.0
public set_url_scheme_filter ( string $url, $current_scheme )
$url string The url with scheme.

the_url() 공개 메소드

Creates canonical URL.
부터: 2.4.2
부터: 2.0.0
public the_url ( string $url = '', array $args = [] ) : string
$url string the url
$args array : accepted args : { @param bool $paged Return current page URL without pagination if false @param bool $paged_plural Whether to add pagination for the second or later page. @param bool $from_option Get the canonical uri option @param object $post The Post Object. @param bool $external Whether to fetch the current WP Request or get the permalink by Post Object. @param bool $is_term Fetch url for term. @param object $term The term object. @param bool $home Fetch home URL. @param bool $forceslash Fetch home URL and slash it, always. @param int $id The Page or Term ID. }
리턴 string Escape url.

the_url_donncha_domainmap() 공개 메소드

Try to get an canonical URL when Donncha Domain Mapping is active.
부터: 2.4.0
public the_url_donncha_domainmap ( string $path, boolean $get_scheme = false ) : string | array | void
$path string The post relative path.
$get_scheme boolean Output array with scheme.
리턴 string | array | void The unescaped URL, the scheme

the_url_wpmudev_domainmap() 공개 메소드

Creates a full canonical URL when WPMUdev Domain Mapping is active from path.
부터: 2.3.0
부터: 2.4.0 Added $get_scheme parameter.
public the_url_wpmudev_domainmap ( string $path, boolean $get_scheme = false ) : string | array | void
$path string The post relative path.
$get_scheme boolean Output array with scheme.
리턴 string | array | void The unescaped URL, the scheme

unset_current_subdomain() 공개 메소드

Unsets current working subdomain.
부터: 2.7.0

프로퍼티 상세

$current_host 보호되어 있는 프로퍼티

Holds current HTTP host.
부터: 2.6.5
protected $current_host

$url_slashit 보호되어 있는 프로퍼티

Whether to slash the url or not. Used when query vars are in url.
부터: 2.6.0
protected $url_slashit