カスタム投稿フィールド

以下秀丸からののテンポラリなコピペ

このテーマはアフリエイト向けに作成されているからカスタムフィールド部分が色々と追加されている。こういうのを使ってしまううと勉強にはNGだな。エディタだってそうだ、デザインエディタで作成してしまうとそれに縛られる。だから素のWordPressが必要だ。

デバッグ
チケットを発行する(そういう管理方法を導入)

Simplicity | 内部SEO施策済みのシンプルな無料Wordpressテーマ

これを追い詰められなければ仕事はない 😛

いやーん、ここが分からないピー?

よくわからないぞ!

wordpress
「wordpress」の記事一覧です。
Amazon APIのアクセスキーもしくはシークレットキーもしくはトラッキングIDが設定されていません。「Cocoon設定」の「API」タブから入力してください。

●エラー(このエラーメッセージでググると、そのURLの表示のエラーがそのまま出てくるが?)
同じエラーメッセージが繰り返されるようだ(多分ループ中だな)。

—————-  以下抜粋となって 表示される –more–とかは不要なようだ —-これは処理済みだがワーニングとして表示されているとみてよいだろうか?
WordPressで自分でこの関数を使用するなら5.5.0からは違う関数で処理すべきということだ。
機能的には問題ない。また表示されるところもメインで使われるところではないかも。

—- 抜粋はここまでだ —————————————————————–

Deprecated: wp_make_content_images_responsive の使用はバージョン 5.5.0 から非推奨になっています !
代わりに wp_filter_content_tags() を使ってください。 in /home/kuroyan/www/shop/wp-includes/functions.php on line 4773

※function.phpにはこの関数はない。よくあるそこが影響を受けているからだ。

※現在のWordPressの版:5.51
WordPressの左メニュー→ツールに現在の版表示がある。

●ソースの場所(関連すべて含む)(
/home/kuroyan/www/shop/wp-includes/deprecated.php

//– 以下はFTPでルートを見ればある
wp-config.php: shop.lgs.jp/wp-config.php

※説明があるURL: https://deep-blog.jp/engineer/14845/

https://gatespace.jp/2012/07/20/wordpress-debugging/
define(‘WP_DEBUG’, true); // デバッグモードを有効化
if (WP_DEBUG) { // デバッグモードの時だけ
define(‘WP_DEBUG_LOG’, true); // debug.log ファイルに記録
define(‘WP_DEBUG_DISPLAY’, false); // ブラウザ上に表示しない
@ini_set(‘display_errors’,0); // ブラウザ上に表示しない
}

●関数の違いを理解する

以下に5.5.0と記載がある。ここで版の判断をしているようだ。

function wp_make_content_images_responsive( $content ) {
_deprecated_function( __FUNCTION__, ‘5.5.0’, ‘wp_filter_content_tags()’ );

// This will also add the `loading` attribute to `img` tags, if enabled.
return wp_filter_content_tags( $content );
}

●対応
これもいい情報だ
https://wordpress.org/plugins/debug-bar/

メッセージで検索したら以下で見つかった。
以下URLでに関連が見つかった
https://developer.wordpress.org/reference/functions/wp_make_content_images_responsive/

—— 以下はまとまり
https://tenman.info/labo/snip/archives/tag/deprecated_function_trigger_error

WORDPRESS SNIPPET
ワードプレスをカスタマイズしよう
タグ:DEPRECATED_FUNCTION_TRIGGER_ERROR

プライマリーナビゲーション
CSS
Templates
日本語とテーマ
MEMO
TOC
labo > WordPress Snippet > blog > deprecated_function_trigger_error
DEBUG.LOGから、WORDPRESSのDEPRECATED: FUNCTIONを消す
WordPress3.3から3.4にかけて大量の非推奨関数が発生しましたが、表示に直接影響を与える関数が多く、
旧バージョンとの互換性を維持するために、テーマなどでは、あえて非推奨関数を含んで使っている状況にあります。

debug.logには、必ず非推奨関数のエラーが記述されるので、実際のエラーを特定する妨げになる事もあると思います。

以下のコードを記述する事で、debug.logへワードプレスの非推奨関数のエラーを書き出さなくする事が出来ます。

Add themes/functions.php

add_filter( ‘deprecated_function_trigger_error’, ‘__return_false’ );
add_filter( ‘deprecated_file_trigger_error’, ‘__return_false’ );

–仕組み
wp-includes/functions.php

/**
* Marks a function as deprecated and informs when it has been used.
*
* There is a hook deprecated_function_run that will be called that can be used
* to get the backtrace up to what file and function called the deprecated
* function.
*
* The current behavior is to trigger a user error if WP_DEBUG is true.
*
* This function is to be used in every function that is deprecated.
*
* @package WordPress
* @subpackage Debug
* @since 2.5.0
* @access private
*
* @uses do_action() Calls ‘deprecated_function_run’ and passes the function name, what to use instead,
* and the version the function was deprecated in.
* @uses apply_filters() Calls ‘deprecated_function_trigger_error’ and expects boolean value of true to do
* trigger or false to not trigger error.
*
* @param string $function The function that was called
* @param string $version The version of WordPress that deprecated the function
* @param string $replacement Optional. The function that should have been called
*/
function _deprecated_function( $function, $version, $replacement= null ) {

do_action( ‘deprecated_function_run’, $function, $replacement, $version );

// Allow plugin to filter the output error trigger
if ( WP_DEBUG && apply_filters( ‘deprecated_function_trigger_error’, true ) ) {
if ( ! is_null($replacement) )
trigger_error( sprintf( __(‘%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.’), $function, $version, $replacement ) );
else
trigger_error( sprintf( __(‘%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.’), $function, $version ) );
}
}
/**
* Marks a file as deprecated and informs when it has been used.
*
* There is a hook deprecated_file_included that will be called that can be used
* to get the backtrace up to what file and function included the deprecated
* file.
*
* The current behavior is to trigger a user error if WP_DEBUG is true.
*
* This function is to be used in every file that is deprecated.
*
* @package WordPress
* @subpackage Debug
* @since 2.5.0
* @access private
*
* @uses do_action() Calls ‘deprecated_file_included’ and passes the file name, what to use instead,
* the version in which the file was deprecated, and any message regarding the change.
* @uses apply_filters() Calls ‘deprecated_file_trigger_error’ and expects boolean value of true to do
* trigger or false to not trigger error.
*
* @param string $file The file that was included
* @param string $version The version of WordPress that deprecated the file
* @param string $replacement Optional. The file that should have been included based on ABSPATH
* @param string $message Optional. A message regarding the change
*/
function _deprecated_file( $file, $version, $replacement= null, $message= ” ) {

do_action( ‘deprecated_file_included’, $file, $replacement, $version, $message );

// Allow plugin to filter the output error trigger
if ( WP_DEBUG && apply_filters( ‘deprecated_file_trigger_error’, true ) ) {
$message= empty( $message ) ? ” : ‘ ‘ . $message;
if ( ! is_null( $replacement ) )
trigger_error( sprintf( __(‘%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.’), $file, $version, $replacement ) . $message );
else
trigger_error( sprintf( __(‘%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.’), $file, $version ) . $message );
}
}
To prevent the notices from displaying for functions, the ‘deprecated_function_trigger_error’ filter hook should return false. To prevent notices from displaying for files, the ‘deprecated_file_trigger_error’ filter hook should return false.

著作権表示 © 2020 WordPress Snippet | Designed with the チャイルドテーマ Site Emulsion /

No tags for this post.
タイトルとURLをコピーしました