HEX
Server: nginx/1.16.1
System: Linux VM-0-14-centos 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www (1000)
PHP: 8.3.31
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/1.scey.cn/wp-content/themes/Leading/public/utils.php
<?php
function wpjam_theme_get_setting($setting_name){
	return wpjam_get_setting('wpjam_theme', $setting_name);
}

// 侧边栏分类
function get_category_root_id($cat)  {  
	$this_category = get_category($cat); // 取得当前分类  
	while($this_category->category_parent) // 若当前分类有上级分类时,循环  
	{  
		$this_category = get_category($this_category->category_parent); // 将当前分类设为上级分类(往上爬)  
	}  
	return $this_category->term_id; // 返回根分类的id号  
}

// 面包屑导航
function get_breadcrumbs()  {
	global $wp_query;
	if ( !is_home() ){
		// Start the UL
		//echo '<ul class="breadcrumb">'; 
		echo '<i class="iconfont icon-locationfill"></i> ';
		// Add the Home link  
		echo '<a href="'. get_option('home') .'">首页</a>';

		if ( is_category() )  {
			$catTitle = single_cat_title('', false);
			$cat = get_cat_ID( $catTitle );
			echo " <span>&raquo;</span> ". get_category_parents( $cat, TRUE, " <span>&raquo;</span> " ) ."";
		}
		elseif ( is_tag() )  {
			echo " <span>&raquo;</span> ".single_cat_title('', false)."";
		}
		elseif ( is_tax() )  {
			echo " <span>&raquo;</span> ".single_term_title('', false)."";
		}
		elseif ( is_search() ) {
			echo ' <span>&raquo;</span> 搜索结果(共搜索到 ' . $wp_query->found_posts . ' 篇文章)';
		}
		elseif ( is_archive() )  {
			echo " <span>&raquo;</span> 存档";
		}
		elseif ( is_404() )  {
			echo " <span>&raquo;</span> 404 Not Found";
		}
		elseif ( is_single() )  {
			$category = get_the_category();
			if($category){
				$category_id = get_cat_ID( $category[0]->cat_name );
				echo ' <span>&raquo;</span> '. get_category_parents( $category_id, TRUE, "  <span>&raquo;</span> " );
				echo get_the_title(); 
			}
		}
		elseif ( is_page() )  {
			$post = $wp_query->get_queried_object();
			if ( $post->post_parent == 0 ){
				echo " <span>&raquo;</span> ".the_title('','', FALSE)."";
			} else {
				$title = the_title('','', FALSE);
				$ancestors = array_reverse( get_post_ancestors( $post->ID ) );
				array_push($ancestors, $post->ID);
	
				foreach ( $ancestors as $ancestor ){
					if( $ancestor != end($ancestors) ){
						echo ' <span>&raquo;</span> <a href="'. get_permalink($ancestor) .'">'. strip_tags( apply_filters( 'single_post_title', get_the_title( $ancestor ) ) ) .'</a>'; 
					} else {
						echo ' <span>&raquo;</span> '. strip_tags( apply_filters( 'single_post_title', get_the_title( $ancestor ) ) ) .'';
					}
				}
			}
		}
		// End the UL
		//echo "</ul>";
	}
}