PHP Class The_SEO_Framework\Generate_Ldjson

Generates SEO data based on content
Since: 2.7.1
Inheritance: extends Generate_Image
Datei anzeigen Open project: sybrew/the-seo-framework

Public Methods

Method Description
enable_ld_json_breadcrumbs ( ) : boolean Determines if breadcrumbs scripts are enabled.
enable_ld_json_knowledge ( ) : boolean Determines if Knowledge Graph Script is enabled.
enable_ld_json_searchbox ( ) : boolean Determines if searchbox script is enabled.
enable_ld_json_sitename ( ) : boolean Determines if sitename script is enabled.
ld_json_breadcrumb_first ( string | null $item_type = null ) : string Return home page item for LD Json Breadcrumbs.
ld_json_breadcrumb_last ( string $item_type = null, integer $pos = null, integer $post_id = null ) : string Return current page item for LD Json Breadcrumbs.
ld_json_breadcrumbs ( ) : escaped Generate LD+Json breadcrumb helper.
ld_json_breadcrumbs_page ( ) : string Generate page breadcrumb.
ld_json_breadcrumbs_post ( ) : string Generate post breadcrumb.
ld_json_knowledge ( ) : string Return LD+Json Knowledge Graph helper.
ld_json_name ( ) : string Generate Site Name LD+Json script.
ld_json_search ( ) : escaped Generate LD+Json search helper.
make_breadcrumb ( array $item, boolean $comma = true ) : string Builds a breadcrumb.
render_ld_json_scripts ( ) : string Render the LD+Json scripts.
schema_blog_name ( ) : string Returns json encoded blogname.
schema_breadcrumblist ( ) : string Returns 'BreadcrumbList' json encoded type name.
schema_context ( ) : string Returns http://schema.org json encoded context URL.
schema_home_url ( ) : string Returns json encoded home url.
schema_image ( integer | string $id, boolean $singular = false ) Returns 'image' json encoded value.
schema_listitem ( ) : string Returns 'ListItem' json encoded type name.
schema_type ( ) : string Returns 'WebSite' json encoded type name.

Protected Methods

Method Description
__construct ( ) Constructor, load parent constructor
build_breadcrumb_trees ( $kittens, array $previous_tree = [] ) : trees Build breadcrumb trees.

Method Details

__construct() protected method

Constructor, load parent constructor
protected __construct ( )

build_breadcrumb_trees() protected method

Build breadcrumb trees.
Since: 2.6.0
protected build_breadcrumb_trees ( $kittens, array $previous_tree = [] ) : trees
$previous_tree array A previous set tree to compare to, if set.
return trees in order.

enable_ld_json_breadcrumbs() public method

Determines if breadcrumbs scripts are enabled.
Since: 2.6.0

enable_ld_json_knowledge() public method

Determines if Knowledge Graph Script is enabled.
Since: 2.6.5

enable_ld_json_sitename() public method

Determines if sitename script is enabled.
Since: 2.6.0

ld_json_breadcrumb_first() public method

Return home page item for LD Json Breadcrumbs.
Since: 2.4.2
public ld_json_breadcrumb_first ( string | null $item_type = null ) : string
$item_type string | null the breadcrumb item type.
return string Home Breadcrumb item

ld_json_breadcrumb_last() public method

Return current page item for LD Json Breadcrumbs.
Since: 2.4.2
public ld_json_breadcrumb_last ( string $item_type = null, integer $pos = null, integer $post_id = null ) : string
$item_type string the breadcrumb item type.
$pos integer Last known position.
$post_id integer The current Post ID
return string Last Breadcrumb item

ld_json_breadcrumbs() public method

Generate LD+Json breadcrumb helper.
Since: 2.4.2
public ld_json_breadcrumbs ( ) : escaped
return escaped LD+json search helper string.

ld_json_breadcrumbs_page() public method

Generate page breadcrumb.
Since: 2.6.0
public ld_json_breadcrumbs_page ( ) : string
return string $output The breadcrumb script.

ld_json_breadcrumbs_post() public method

Generate post breadcrumb.
Since: 2.6.0
public ld_json_breadcrumbs_post ( ) : string
return string $output The breadcrumb script.

ld_json_knowledge() public method

Return LD+Json Knowledge Graph helper.
Since: 2.2.8
public ld_json_knowledge ( ) : string
return string LD+json Knowledge Graph helper.

ld_json_name() public method

Generate Site Name LD+Json script.
Since: 2.6.0
public ld_json_name ( ) : string
return string The LD+JSon Site Name script.

make_breadcrumb() public method

Builds a breadcrumb.
Since: 2.6.0
public make_breadcrumb ( array $item, boolean $comma = true ) : string
$item array : { 'type', 'pos', 'id', 'name' }
$comma boolean Whether to add a trailing comma.
return string The LD+Json breadcrumb.

render_ld_json_scripts() public method

Render the LD+Json scripts.
Since: 2.6.0
public render_ld_json_scripts ( ) : string
return string The LD+Json scripts.

schema_blog_name() public method

Returns json encoded blogname.
Since: 2.6.0
public schema_blog_name ( ) : string
return string The json encoded blogname.

schema_breadcrumblist() public method

Returns 'BreadcrumbList' json encoded type name.
Since: 2.6.0
public schema_breadcrumblist ( ) : string
return string The json encoded 'BreadcrumbList'.

schema_context() public method

Returns http://schema.org json encoded context URL.
Since: 2.6.0
public schema_context ( ) : string
return string The json encoded context url.

schema_home_url() public method

Returns json encoded home url.
Since: 2.6.0
public schema_home_url ( ) : string
return string The json encoded home url.

schema_image() public method

Returns 'image' json encoded value.
Since: 2.7.0
public schema_image ( integer | string $id, boolean $singular = false )
$id integer | string The page, post, product or term ID.
$singular boolean Whether the ID is singular.

schema_listitem() public method

Returns 'ListItem' json encoded type name.
Since: 2.6.0
public schema_listitem ( ) : string
return string The json encoded 'ListItem'.

schema_type() public method

Returns 'WebSite' json encoded type name.
Since: 2.6.0
public schema_type ( ) : string
return string The json encoded type name.