REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 3.67 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/jetpack/modules/theme-tools/site-breadcrumbs.php
Text
Base64
<?php /** * Plugin Name: Site Breadcrumbs * Plugin URI: https://wordpress.com * Description: Quickly add breadcrumbs to the single view of a hierarchical post type or a hierarchical taxonomy. * Author: Automattic * Version: 1.0 * Author URI: https://wordpress.com * License: GPL2 or later * Text Domain: jetpack * * @package automattic/jetpack */ /** * Echos a set of breadcrumbs. * * Themes can call this function where the breadcrumbs should be outputted. */ function jetpack_breadcrumbs() { $taxonomy = is_category() ? 'category' : get_query_var( 'taxonomy' ); $is_taxonomy_hierarchical = is_taxonomy_hierarchical( $taxonomy ); $post_type = is_page() ? 'page' : get_query_var( 'post_type' ); $is_post_type_hierarchical = is_post_type_hierarchical( $post_type ); if ( ! ( $is_post_type_hierarchical || $is_taxonomy_hierarchical ) || is_front_page() ) { return; } $breadcrumb = ''; $position = 1; if ( $is_post_type_hierarchical ) { $post_id = get_queried_object_id(); $ancestors = array_reverse( get_post_ancestors( $post_id ) ); if ( $ancestors ) { foreach ( $ancestors as $ancestor ) { $breadcrumb .= '<span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><meta itemprop="position" content="' . esc_attr( $position ) . '"><a href="' . esc_url( get_permalink( $ancestor ) ) . '" itemprop="item"><span itemprop="name">' . esc_html( get_the_title( $ancestor ) ) . '</span></a></span>'; ++$position; } } $breadcrumb .= '<span class="current-page" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><meta itemprop="position" content="' . esc_attr( $position ) . '"><span itemprop="name">' . esc_html( get_the_title( $post_id ) ) . '</span></span>'; } elseif ( $is_taxonomy_hierarchical ) { $current = get_term( get_queried_object_id(), $taxonomy ); if ( is_wp_error( $current ) ) { return; } if ( $current->parent ) { $breadcrumb = jetpack_get_term_parents( $current->parent, $taxonomy ); } $breadcrumb .= '<span class="current-category" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><meta property="position" content="' . esc_attr( $position ) . '"><span itemprop="name">' . esc_html( $current->name ) . '</span></span>'; } $home = '<span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><meta itemprop="position" content="' . esc_attr( $position ) . '"><meta itemprop="position" content="0"><a href="' . esc_url( home_url( '/' ) ) . '" class="home-link" itemprop="item" rel="home"><span itemprop="name">' . esc_html__( 'Home', 'jetpack' ) . '</span></a></span>'; echo '<nav class="entry-breadcrumbs" itemscope itemtype="https://schema.org/BreadcrumbList">' . $home . $breadcrumb . '</nav>'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Return the parents for a given taxonomy term ID. * * @param int $term Taxonomy term whose parents will be returned. * @param string $taxonomy Taxonomy name that the term belongs to. * @param array $visited Terms already added to prevent duplicates. * * @return string A list of links to the term parents. */ function jetpack_get_term_parents( $term, $taxonomy, $visited = array() ) { $parent = get_term( $term, $taxonomy ); if ( is_wp_error( $parent ) ) { return $parent; } $chain = ''; if ( $parent->parent && ( $parent->parent !== $parent->term_id ) && ! in_array( $parent->parent, $visited, true ) ) { $visited[] = $parent->parent; $chain .= jetpack_get_term_parents( $parent->parent, $taxonomy, $visited ); } $chain .= '<a href="' . esc_url( get_category_link( $parent->term_id ) ) . '">' . $parent->name . '</a>'; return $chain; }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 6 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
compat
DIR
-
drwxr-xr-x
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
content-options
DIR
-
drwxr-xr-x
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
js
DIR
-
drwxr-xr-x
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
responsive-videos
DIR
-
drwxr-xr-x
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
site-logo
DIR
-
drwxr-xr-x
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
social-menu
DIR
-
drwxr-xr-x
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
content-options.php
7.10 KB
lrw-r--r--
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
devicepx.php
1.24 KB
lrw-r--r--
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
featured-content.php
24.02 KB
lrw-r--r--
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
infinite-scroll.php
1.88 KB
lrw-r--r--
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
random-redirect.php
3.77 KB
lrw-r--r--
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
responsive-videos.php
5.66 KB
lrw-r--r--
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
site-breadcrumbs.php
3.67 KB
lrw-r--r--
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
site-logo.php
2.47 KB
lrw-r--r--
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
social-links.php
6.93 KB
lrw-r--r--
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
social-menu.php
3.00 KB
lrw-r--r--
2023-04-04 05:35:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).