サポート » テーマ » Log Deprecated Noticesインストールしましたが、修正方法がわかりません

  • Z.com byGMO

    (@takeaki-nagashima)


    テーマ作成初心者です。
    Log Deprecated Noticesをインストールしたら、下記2点があがってきました。
    見つかったのはよいものの、どのように修正すればよいのかわかりません。
    どなたか、ご指導お願いいたします。

    1.Argument in add_theme_page()
    Used in wp-content/themes/kotenhanagara/functions.php on line 305.

    2.Argument in current_user_can()
    An admin menu page is using user levels instead of capabilities. There is likely a related log item with specifics.

    ————————————————————–
    ちなみに、functions.php 305行目:
    add_theme_page(‘Custom header and footer’,’Header & Footer’,8,’custom_handf’,’kotenhanagara_fc_settings_page’);

4件の返信を表示中 - 1 - 4件目 (全4件中)
  • ユーザーレベルは、WordPress ver.2.0以前のもので、ver.3.0以降は非推奨になっているからだと思われます。
    http://wpdocs.sourceforge.jp/ユーザーの種類と権限

    add_theme_pageの引数の、数字の8になっている部分を、「edit_themes」等の適切な権限を設定してあげれば良いと思います。

    add_theme_pageは、twelveやthirteenでは使われていないので、elevenを参考に

    $theme_page = add_theme_page(
    		__( 'Theme Options', 'twentyeleven' ),   // Name of page
    		__( 'Theme Options', 'twentyeleven' ),   // Label in menu
    		'edit_theme_options',                    // Capability required
    		'theme_options',                         // Menu slug, used to uniquely identify the page
    		'twentyeleven_theme_options_render_page' // Function that renders the options page
    	);
    トピック投稿者 Z.com byGMO

    (@takeaki-nagashima)

    Fumito MIZUNOさん、
    3.0から非推奨になったんですね!りょうかいです、どうもありがとうございました。

    トピック投稿者 Z.com byGMO

    (@takeaki-nagashima)

    nobitaさん、

    コード参考にさせていただきます。
    ありがとうございました!

4件の返信を表示中 - 1 - 4件目 (全4件中)
  • トピック「Log Deprecated Noticesインストールしましたが、修正方法がわかりません」には新たに返信することはできません。