01.筆者が作ったwordpressのfunctionの全てのコード

作成日: 2022/08/10 更新日: 2023/03/25 サイトの紹介と使い方

概要

初めに

  1. 筆者が独自にfunction Codeを分類、構成しています。
  2. ファイル(置き場所):テーマCocoon childのfunctions.php
  3. このコードは、PHP言語で記述していますが、コードはテーマCocoonの一部として組み込まれているので、PHP言語の宣言などは必要ありません。
  4. ソースコードの中で説明のないコードが数行ありますが、お許しください。

全てのコード

<?php //子テーマ用関数
if ( !defined( 'ABSPATH' ) ) exit;

//子テーマ用のビジュアルエディタースタイルを適用
add_editor_style();

define('WPLANG', 'ja');

//以下に子テーマ用の関数を書く

//<-------------------------------------------------------------------------->
//<--- 1100 はサイト特有(例えばホームドメイン名など)の値を返す分類コード
//引っ越しなどでサイトが移動したとき、この分類コードの値だけ変更する。--->
//<--- 1101
function my_get_homepage(){
  return "https://aidendo-pilot.com";
}
// 1101 --->
// <--- 1102
function my_get_domain(){
  return "https://aidendo-pilot.com";
}
// 1102 --->
//<-------------------------------------------------------------------------->
//<--- 1200はサイト内で共有のget 関数 --->
//<--- 1201
function my_get_block_paragraph_begin(){
  $ret  = "<!-- wp:paragraph --><br>";
  return $ret;
}
// 1201 --->
//<--- 1202
function my_get_block_paragraph_end(){
  $ret  = "<br><!-- /wp:paragraph -->";
  return $ret;
}
// 1202 --->
//<--- 1203
function my_get_block_code_begin(){
  $ret  = "<!-- wp:code -->";
  $ret .= "<pre class=\"wp-block-code\"><code>";
  return $ret;
}
// 1203 --->
//<--- 1204
function my_get_block_code_end(){
  $ret .= "</code></pre>";
  $ret .= "<!-- /wp:code -->";
  return $ret;
}
// 1204 --->
//<--- 1205
function my_get_block_html_begin(){
  $ret  = "<!-- wp:html -->";
  return $ret;
}
// 1205 --->
//<--- 1206
function my_get_block_html_end(){
  $ret  = "<!-- /wp:html -->";
  return $ret;
}
// 1206 --->
//<--- 1207
function my_get_short_code_begin(){
  $ret  = "<!-- wp:shortcode -->";
  return $ret;
}
// 1207 --->
//<--- 1208
function my_get_short_code_end(){
  $ret  = "<!-- /wp:shortcode -->";
  return $ret;
}
// 1208 --->
//<--- 1211
function my_get_menu_title( $arg1 ){
  if( stristr(urldecode("%E8%87%AA%E5%B7%B1%E7%B4%B9%E4%BB%8B"),$arg1) ):// 概要
    $ret = urldecode( "%E6%A6%82%E8%A6%81" );
  elseif( stristr(urldecode("%E7%9B%AE%E7%9A%84"),$arg1) ):
    $ret = urldecode( "%E6%A6%82%E8%A6%81" );
  elseif( stristr(urldecode("%E3%81%8A%E5%95%8F%E5%90%88%E3%81%9B"),$arg1) ):
    $ret = urldecode( "%E6%A6%82%E8%A6%81" );
  elseif( stristr(urldecode("%E3%83%91%E3%82%BD%E3%82%B3%E3%83%B3%E3%81%AE%E6%BA%96%E5%82%99"),$arg1) ):// 初心者
    $ret = urldecode( "%E5%88%9D%E5%BF%83%E8%80%85" );
  elseif( stristr(urldecode("%E5%88%9D%E3%82%81%E3%81%A6"),$arg1) ):
    $ret = urldecode( "%E5%88%9D%E5%BF%83%E8%80%85" );
  elseif( stristr(urldecode("%E5%88%9D%E5%BF%83%E8%80%85"),$arg1) ):
    $ret = urldecode( "%E5%88%9D%E5%BF%83%E8%80%85" );
  elseif( stristr(urldecode("wordpress"),$arg1) ):// WEB
    $ret = urldecode( "WEB" );
  elseif( stristr(urldecode("%E3%82%B5%E3%82%A4%E3%83%88%E6%A7%8B%E7%AF%89"),$arg1) ):
    $ret = urldecode( "WEB" );
  elseif( stristr(urldecode("EC%E3%82%B5%E3%82%A4%E3%83%88"),$arg1) ):
    $ret = urldecode( "WEB" );
  elseif( stristr(urldecode("%E4%BA%BA%E5%B7%A5%E7%9F%A5%E8%83%BD"),$arg1) ):// 実務
    $ret = urldecode( "%E5%AE%9F%E5%8B%99" );
  elseif( stristr(urldecode("%E3%82%B9%E3%83%9E%E3%83%9B%E3%82%A2%E3%83%97%E3%83%AA"),$arg1) ):
    $ret = urldecode( "%E5%AE%9F%E5%8B%99" );
  elseif( stristr(urldecode("%EF%BC%98%EF%BC%90%EF%BC%98%EF%BC%96%E7%B3%BB"),$arg1) ):// コンピュータの基礎
    $ret = urldecode( "%E3%82%B3%E3%83%B3%E3%83%94%E3%83%A5%E3%83%BC%E3%82%BF%E3%81%AE%E5%9F%BA%E7%A4%8E" );
  elseif( stristr(urldecode("%E5%9B%B3%E5%BD%A2%E3%81%A8%E6%96%B9%E7%A8%8B%E5%BC%8F"),$arg1) ):// 数学
    $ret = urldecode( "%E6%95%B0%E5%AD%A6" );
  elseif( stristr(urldecode("%E9%96%A2%E6%95%B0"),$arg1) ):
    $ret = urldecode( "%E6%95%B0%E5%AD%A6" );
  elseif( stristr(urldecode("%E6%9C%80%E5%B0%8F%E4%BA%8C%E4%B9%97%E6%B3%95"),$arg1) ):
    $ret = urldecode( "%E6%95%B0%E5%AD%A6" );
  elseif( stristr(urldecode("%E9%A0%86%E5%88%97%E3%81%A8%E7%B5%84%E3%81%BF%E5%90%88%E3%82%8F%E3%81%9B"),$arg1) ):
    $ret = urldecode( "%E6%95%B0%E5%AD%A6" );
  elseif( stristr(urldecode("%E5%B7%A1%E5%9B%9E%E3%82%BB%E3%83%BC%E3%83%AB%E3%82%B9%E3%83%9E%E3%83%B3%E5%95%8F%E9%A1%8C"),$arg1) ):
    $ret = urldecode( "%E6%95%B0%E5%AD%A6" );
  elseif( stristr(urldecode("%E3%81%95%E3%81%8F%E3%82%89%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%BC%E3%83%8D%E3%83%83%E3%83%88"),$arg1) ):// プラットフォーム
    $ret = urldecode( "%E3%83%97%E3%83%A9%E3%83%83%E3%83%88%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0" );
  elseif( stristr(urldecode("Unix%E7%B3%BBOS"),$arg1) ):
    $ret = urldecode( "%E3%83%97%E3%83%A9%E3%83%83%E3%83%88%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0" );
  elseif( stristr(urldecode("%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E8%A8%80%E8%AA%9E%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6"),arg1) ):// プログラム言語
    $ret = urldecode( "%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E8%A8%80%E8%AA%9E" );
  elseif( stristr(urldecode("HTML%E3%81%A8CSS"),$arg1) ):
    $ret = urldecode( "%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E8%A8%80%E8%AA%9E" );
  elseif( stristr(urldecode("PHP"),$arg1) ):
    $ret = urldecode( "%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E8%A8%80%E8%AA%9E" );
  elseif( stristr(urldecode("%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E6%8C%87%E5%90%91"),$arg1) ):
    $ret = urldecode( "%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E8%A8%80%E8%AA%9E" );
  elseif( stristr(urldecode("PYTHON"),$arg1) ):
    $ret = urldecode( "%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E8%A8%80%E8%AA%9E" );
  elseif( stristr(urldecode("%E3%82%A8%E3%83%83%E3%82%BB%E3%82%A4"),$arg1) ):// その他
    $ret = urldecode( "%E3%81%9D%E3%81%AE%E4%BB%96" );
  elseif( stristr(urldecode("%E3%82%A2%E3%83%BC%E3%82%AB%E3%82%A4%E3%83%96"),$arg1) ):
    $ret = urldecode( "%E3%81%9D%E3%81%AE%E4%BB%96" );
  elseif( stristr(urldecode("%E3%83%96%E3%83%AD%E3%82%B0%E8%A8%98%E4%BA%8B%E3%81%AE%E7%AE%A1%E7%90%86%E3%81%A8%E3%83%86%E3%82%B9%E3%83%88"),$arg1) ):
    $ret = urldecode( "%E3%81%9D%E3%81%AE%E4%BB%96" );
  else:
    $ret = "no menu";
  endif;

  return $ret;
}
// 1211 --->
//<-------------------------------------------------------------------------->
//<--- 1300はサイト内で共有のset 関数 --->
//<--- 1301
function my_set_list_a_tag( $arg1,$arg2 ){
  $ret  = "<li><a href=\"";
  $ret .= my_get_domain();
  $ret .= $arg1;
  $ret .= "\">";
  $ret .= $arg2;
  $ret .= "</a></li>";
  return $ret;
}
// 1301 --->
//<--- 1302
function my_set_list_a_tag_article( $post ){
  $arg1  ="/" .  $post->post_title;
  $arg2  = " [ ";
  $date  = new DateTime($post->post_date_gmt);
  $arg2 .= $date->format("Y/m/d");
  $arg2 .= ":";
  $date  = new DateTime($post->post_modified_gmt);
  $arg2 .= $date->format("Y/m/d");
  $arg2 .= " ] ";
  $arg2 .= $post->post_title;
  $ret   = my_set_list_a_tag( $arg1,$arg2 );
  return $ret;
}
// 1302 --->
//<-------------------------------------------------------------------------->
//<--- 2100はショートコード用のデバッグ関数 --->
//<--- 2101
function my_debug_shortcode_echo( $arg1,$arg2 ){
  $fh = fopen($arg1, "w");
  if( $fh ):
    fwrite( $fh,$arg2 );
    fclose( $fh );
  else:
  endif;
  return "";
}
// 2101 --->
//<-------------------------------------------------------------------------->
//<--- 2200はHTML部品関数 --->
//<--- 2201
function my_intro_parts($atts){ 
  $ret .= "<a class=\"my_intro\" href=\"";
  $ret .= my_get_domain();
  $ret .= "/";
  $wrk  = "%E3%82%B5%E3%82%A4%E3%83%88%E3%81%AE%E7%B4%B9%E4%BB%8B%E3%81%A8%E4%BD%BF%E3%81%84%E6%96%B9";
  $ret .= $wrk;
  $ret .=	"/\"  target=\"_blank\">";
  $ret .= urldecode( $wrk );
  $ret .= "</a>";

//  my_debug_shortcode_echo( "my_intro.txt",$ret );

  return $ret;
}
// 2201 --->
//<--- 2202
function my_search_form_parts($atts){
  $ret  = "<form class=\"my-search-site\" method=\"get\" action=\"https://www.google.co.jp/search\" target=\"_blank\">";
  $ret .= "<input type=\"hidden\" name=\"sitesearch\" value=\"";
  $ret .= my_get_domain();
  $ret .= "\">";
  $wrk  = urldecode( "%E3%82%AD%E3%83%BC%E3%83%AF%E3%83%BC%E3%83%89%E3%82%92%E5%85%A5%E5%8A%9B%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84" );
  $ret .= "<input type=\"text\" name=\"q\" style=\"font-size:15px;size:20px;\" placeholder=" . $wrk . " value=\"\">";
  $wrk  = "google" . urldecode( "%E3%82%B5%E3%82%A4%E3%83%88%E5%86%85%E6%A4%9C%E7%B4%A2" );
  $ret .= "<button type=\"submit\" style=\"height:40px;font-weight:bold;\">" . $wrk . "</button>";
  $ret .= "</form>";
	
//  my_debug_shortcode_echo( "my_search_form.txt",$ret );

  return $ret;
}
// 2202 --->
//<--- 2203
function my_date_parts($atts){ 
  $post = get_post();
  $ret  = "<span class=\"my-article-date\">created: ";
  $date = new DateTime($post->post_date_gmt);
  $ret .= $date->format("Y/m/d");
  unset($date);
  $ret .= "  modified: ";
  $date = new DateTime($post->post_modified_gmt);
  $ret .= $date->format("Y/m/d");
  unset($date);
  $ret .= "</span>";

//  my_debug_shortcode_echo( "my_date.txt",$ret );

  return $ret;
}
// 2203 --->
//<--- 2204
function my_bread_crumb_parts($atts){
  $post = get_post();
  $ret .= "<ul id=\"my_top\" class=\"my-bread-crumb\">";
  $ret .= my_set_list_a_tag( "/","top" );
  if( has_tag("20nonecategory",$post) ):
  elseif( has_tag("81parent_cat",$post) ):
    $catr = $post->post_title;
    $arg2 = my_get_menu_title( $catr );
    $ret .= my_set_list_a_tag( "/",$arg2 );
  elseif( has_tag("82child_cat",$post) ):
    $categorys = get_the_category();
    $parent    = get_the_category_by_ID( $categorys[0]->category_parent );
    $catr      = $parent;
    $arg2      = my_get_menu_title( $catr );
    $ret      .= my_set_list_a_tag( "/",$arg2 );
    $arg1      = "/cat_parent_" . $parent;
    $ret      .= my_set_list_a_tag( $arg1,$parent );
  elseif( has_tag("21parent",$post) ):
    $categorys = get_the_category();
    $parent    = get_the_category_by_ID( $categorys[0]->term_id );
    $catr      = $parent;
    $arg2      = my_get_menu_title( $catr );
    $ret      .= my_set_list_a_tag( "/",$arg2 );
    $arg1      = "/cat_parent_" . $parent;
    $ret      .= my_set_list_a_tag( $arg1,$parent );
  elseif( has_tag("22child",$post) ):
    $categorys = get_the_category();
    $parent    = get_the_category_by_ID( $categorys[0]->category_parent );
    $catr      = $parent;
    $arg2      = my_get_menu_title( $catr );
    $ret      .= my_set_list_a_tag( "/",$arg2 );
    $arg1      = "/cat_parent_" . $parent;
    $ret      .= my_set_list_a_tag( $arg1,$parent );
    $child     = get_the_category_by_ID( $categorys[0]->term_id );
    $arg1      = "/cat_child_" . $child;
    if( stristr($child,"samplecode") ):
      $child   = "sampleCode";
    elseif( stristr($child,"functioncode") ):
      $child   = "functionCode";
    elseif( stristr($child,"class") ):
      $child   = "class";
    endif;
    $ret      .= my_set_list_a_tag( $arg1,$child );
  endif;
  $ret .= "</ul>";
  $ret .= "<span class=\"my-bread-crumb_title\">" . "< " . $post->post_title . " >" . "</span>";

//  my_debug_shortcode_echo( "my_bread_crumb_parts.txt",$ret );

  return $ret;
}
// 2204 --->
//<--- 2205
function my_home_parts($atts){ 
  $ret  = "<a href=\"";
  $ret .= my_get_homepage();
  $ret .= "/\">Top</a>";

//  my_debug_shortcode_echo( "my_home_parts.txt",$ret );

  return $ret;
}
// 2205 --->
//<--- 2206
function my_mail_parts()
{
  $ret  = "<h2>";
  $ret .= urldecode( "%E3%81%8A%E5%95%8F%E5%90%88%E3%81%9B%E3%83%BB%E5%BE%A1%E8%A6%81%E6%9C%9B" );
  $ret .= "</h2>";
  $ret .= "<a href=\"" . "https://aidendo-pilot.com/" . urldecode( "%e3%81%8a%e5%95%8f%e5%90%88%e3%81%9b%e3%83%9a%e3%83%bc%e3%82%b8-%e3%81%8a%e6%b0%97%e8%bb%bd%e3%81%ab%e9%80%a3%e7%b5%a1%e3%81%8f%e3%81%a0%e3%81%95%e3%81%84/" );
  $ret .= "/\">" . urldecode( "%E3%81%8A%E5%95%8F%E5%90%88%E3%81%9B" ) . "</a>";

//  my_debug_shortcode_echo( "my_mail_parts.txt",$ret );
	
  return $ret;
}
// 2206 --->
//<--- 2207
function my_embedded_contents_parts($atts){
  $args = array(
	'posts_per_page'    => 500,
	'post_type'         => 'post',
  ); 
  $ps = get_posts( $args );

  if( $ps ):	
	foreach( $ps as $p ):
	  if( $p->post_title==$atts[0] ):
		$ret .= "<p>";
		$ret .= $p->post_content;
		$ret .= "</p>";
	  endif;
	endforeach;
  endif;
	
//  my_debug_shortcode_echo( "my_embedded_contents_parts.txt",$ret );
	
  return $ret;
}
// 2207 --->
//<-------------------------------------------------------------------------->
//<--- 2211
function my_show_child_category_parts($atts){
  $ret = "<ul class=\"my-menu-list\">";
  $categorys = get_the_category();
  $args = array(
	'type'       => 'post',
	'child_of'   => $categorys[0]->term_id
  );
  $categories = get_categories( $args );

  foreach ($categories as $category):
    $arg1      = "/cat_child_" . $category->cat_name;
    if( stristr($category->cat_name,"samplecode") ):
      $arg2 = "sampleCode";
    elseif( stristr($category->cat_name,"functioncode") ):
	   $arg2 = "functionCode";
    elseif( stristr($category->cat_name,"class") ):
	   $arg2 = "class";
    else:
      $arg2 = $category->cat_name;
    endif;
    $ret      .= my_set_list_a_tag( $arg1,$arg2 );
  endforeach;

  $ret .= "</ul>";
	
//  my_debug_shortcode_echo( "my_show_child_category_parts.txt",$ret );

  return $ret;
}
// 2211 --->
//<--- 2212
function my_article_list_parts($atts){
  $ret = "<ul class=\"my-link-list\"> ";
  $post_self = get_post();
  $categorys = get_the_category();

  $args = array(
	'posts_per_page'   => 500,
	'category'         => $categorys[0]->term_id,
	'orderby'          => $atts[0],
	'post_type'        => 'post',
	'order'            => $atts[1]
  ); 
  $posts = get_posts( $args );
  if( $posts ):
    foreach ($posts as $post):
      if( has_tag("81parent_cat",$post_self) ):
        if( has_tag("21parent",$post) ):
          $ret .= my_set_list_a_tag_article( $post );
        endif;
      elseif( has_tag("82child_cat",$post_self) ):
        if( has_tag("22child",$post) ):
         $ret .= my_set_list_a_tag_article( $post );
        endif;
      endif;
    endforeach;
  endif;

  $ret .= "</ul>";

//  my_debug_shortcode_echo( "my_article_list_parts.txt",$ret );
	
  return $ret;
}
// 2212 --->
//<--- 2213
function my_article_list_csv_parts($atts){
  $fh = fopen($atts[0], "w");
  if( $fh ):
	$ret .= "<p>" . $atts[0] . "</p>";
	$rec = "id,parent,child,tag,title,#char,#cat\n";
	fwrite( $fh,$rec );
    $args = array(
	  'posts_per_page'   => 500,
	  'post_type'		 => 'post'
    ); 
    $my_posts = get_posts( $args );
	
	foreach ($my_posts as $p){
	  $rec = strval( $p->ID );
	  $rec .= ",";
	  $cats = get_the_category( $p->ID );
	  if( count($cats) ){
		if( has_tag("21parent",$p) ):
		  $rec .= $cats[0]->name;
		  $rec .= ",,";
		  $rec .= "21parent,";
		elseif( has_tag("22child",$p) ):
		  $par  = get_category( $cats[0]->parent );
		  $rec .= $par->name;
		  $rec .= ",";
		  $rec .= $cats[0]->name;
		  $rec .= ",";
		  $rec .= "22child,";
		elseif( has_tag("81parent_cat",$p) ):
		  $rec .= $cats[0]->name;
		  $rec .= ",,";
		  $rec .= "81parent_cat,";
		elseif( has_tag("82child_cat",$p) ):
		  $par  = get_category( $cats[0]->parent );
		  $rec .= $par->name;
		  $rec .= ",";
		  $rec .= $cats[0]->name;
		  $rec .= ",";
		  $rec .= "82child_cat,";
		else:
	      $rec .= "no tag for article,,";
		endif;
	  }else{
		$rec   .= "none category,,";
	  }
	  $rec .= $p->post_title;
	  $rec .= ",";
	  $ss   = str_replace( array("\r\n", "\r", "\n"), '', $p->post_content );
      $cnt  = mb_strlen( strip_tags($ss), "UTF-8" );
	  $rec .= strval( $cnt );
	  $rec .= ",";
	  $rec .= strval( count($cats) );
	  $rec .= "\n";
	  fwrite( $fh,$rec );
	}
	
	$args = array(
	  'posts_per_page'   => 500,
	  'post_type'		 => 'page'
    ); 
    $my_pages = get_posts( $args );
	
	foreach ($my_pages as $p){
	  $rec = strval($p->ID);
	  $rec .= ",page,,,";
	  $rec .= $p->post_title;
	  $rec .= ",";
	  $ss   = str_replace( array("\r\n", "\r", "\n"), '', $p->post_content );
      $cnt  = mb_strlen( strip_tags($ss), "UTF-8" );
	  $rec .= strval( $cnt );
	  $rec .= ",";
	  $rec .= strval( count($cats) );
	  $rec .= "\n";
	  fwrite( $fh,$rec );
	}
	
	fclose( $fh );
  else:
	$ret .= "file open error";
  endif;
	
  return $ret;
}
// 2213 --->

//<-------------------------------------------------------------------------->
//<--- 2300は22xxのショートコード  --->
//<--- 2301
add_shortcode('mysc_intro', 'my_intro');
function my_intro($atts){ 
  $ret  = my_get_block_html_begin();
  $ret .= "<span class=\"my-article-header\">";
  $ret .= my_intro_parts($atts);
  $ret .= "</span>";
  $ret .= my_get_block_html_end();

//  my_debug_shortcode_echo( "mysc_intro.txt",$ret );

  return $ret;
}
// 2301 --->
//<--- 2302
add_shortcode('mysc_search_form', 'my_search_form');
function my_search_form($atts){
  $ret  = my_get_block_html_begin();
  $ret .= "<span class=\"my-article-header\">";
  $ret .= my_search_form_parts($atts);
  $ret .= "</span>";
  $ret .= my_get_block_html_end();

//  my_debug_shortcode_echo( "mysc_search_form.txt",$ret );

  return $ret;
}
// 2302 --->
//<--- 2303
add_shortcode('mysc_date', 'my_date');
function my_date($atts){ 
  $ret  = my_get_block_html_begin();
  $ret .= "<span class=\"my-article-header\">";
  $ret .= my_date_parts($atts);
  $ret .= "</span>";
  $ret .= my_get_block_html_end();

//  my_debug_shortcode_echo( "mysc_date.txt",$ret );

	return $ret;
}
// 2303 --->
//<--- 2304
add_shortcode('mysc_article_header', 'my_article_header');
function my_article_header($atts){
  $ret  = my_get_block_html_begin();
  $ret .= "<span class=\"my-article-header\">";
  $ret .= my_intro_parts($atts);
  $ret .= my_search_form_parts($atts);
  $ret .= my_date_parts( $atts );
  $ret .= "</span>";
  $ret .= my_get_block_html_end();

//  my_debug_shortcode_echo( "mysc_article_header.txt",$ret );
	
  return $ret;
}
// 2304 --->
// <--- 2305
add_shortcode('mysc_bread_crumb', 'my_bread_crumb');
function my_bread_crumb($atts){
  $ret  = my_get_block_html_begin();
  $ret .= "<span class=\"my-article-header\">";
  $ret .= my_intro_parts($atts);
  $ret .= my_search_form_parts($atts);
  $ret .= my_date_parts( $atts );
  $ret .= "</span>";
  $ret .= "<span class=\"my-bread-crumb-block\">";
  $ret .= my_bread_crumb_parts( $atts );
  $ret .= "</span>";
  $ret .= my_get_block_html_end();

//  my_debug_shortcode_echo( "mysc_bread_crumb.txt",$ret );

  return $ret;
}
// 2305 --->
//<--- 2306
add_shortcode('mysc_home', 'my_home');
function my_home($atts){ 
  $ret  = my_get_block_html_begin();
  $ret .= my_home_parts($atts);
  $ret .= my_get_block_html_end();

//  my_debug_shortcode_echo( "mysc_home.txt",$ret );

  return $ret;
}
// 2306 --->
//<--- 2307
add_shortcode('mysc_mail', 'my_mail');
function my_mail($atts){ 
  $ret  = my_get_block_html_begin();
  $ret .= my_mail_parts($atts);
  $ret .= my_get_block_html_end();

//  my_debug_shortcode_echo( "mysc_home.txt",$ret );

  return $ret;
}
// 2307 --->
//<--- 2308
add_shortcode('mysc_embedded_contents', 'my_embedded_contents');
function my_embedded_contents($atts){ 
  $ret  = my_get_block_paragraph_begin();
  $ret .= my_embedded_contents_parts($atts);
  $ret .= my_get_block_paragraph_end();

//  my_debug_shortcode_echo( "mysc_embedded_contents.txt",$ret );

  return $ret;
}
// 2308 --->
//<--- 2311
add_shortcode('mysc_show_child_category_on_parent', 'my_show_child_category_on_parent');
function my_show_child_category_on_parent($atts){ 
  $ret  = my_get_block_paragraph_begin();
  $ret .= my_show_child_category_parts($atts);
  $ret .= my_get_block_paragraph_end();

//  my_debug_shortcode_echo( "mysc_show_child_category_on_parent.txt",$ret );

  return $ret;
}
// 2311 --->
//<--- 2312
add_shortcode('mysc_article_list', 'my_article_list');
function my_article_list($atts){ 
  $ret  = my_get_block_paragraph_begin();
  $ret .= my_article_list_parts($atts);
  $ret .= my_get_block_paragraph_end();

  my_debug_shortcode_echo( "mysc_article_list.txt",$ret );

  return $ret;
}
// 2312 --->
//<--- 2313
add_shortcode('mysc_article_list_csv', 'my_article_list_csv');
function my_article_list_csv($atts){ 
  $ret  = my_article_list_csv_parts($atts);

  return $ret;
}
// 2313 --->
	
add_filter( 'run_wptexturize', '__return_false' );

//ソースコード行番号の最大値(デフォルト:99)
add_filter('max_code_row_count', function ($value){
  return 300; //最大行数を入力
});

お問合せ・御要望

お問合せ
Verified by MonsterInsights
タイトルとURLをコピーしました