カスタムフィールドで記事の公開日時を制御したい
-
カスタムフィールドで記事の公開日時を制御したく、以下のページ記載のコードをほぼそのままfunction.phpに記載したのですが、うまくいきません。
https://gist.github.com/pimpmywp/4405428#file-class-pm-schedule-post-php
上記サイト記載のclass-pm-schedule-post.php内容も、how2use.phpの内容も両方ともfunction.phpに記載し、カスタムフィールドで日付を入力して保存すると、以下のエラーメッセージが表示され、公開日時として反映されない状態です。
Warning: strtotime() expects parameter 1 to be string, array given in /XXXX/functions.php on line 739
Warning: Cannot modify header information – headers already sent by (output started at /XXXX/functions.php:739) in /XXXX/public_html/wp-admin/post.php on line 197
Warning: Cannot modify header information – headers already sent by (output started at /XXXX/functions.php:739) in /XXXX/public_html/wp-includes/pluggable.php on line 1171
739行目は「 $date = strtotime( $date );」と記述しています。
日時はhttp://www.gnu.org/software/tar/manual/html_chapter/tar_7.html を参考に、strtotimeで認識できるものをいくつか試しましたが、現象はわかりませんでした。
PHPのバージョンはは、PHP5.6.18です。php初心者につき、なにか御門違いな勘違いがあるかもしれませんが、お判りなる方がいらっしゃいましたら、よろしくお願い致します。
- トピック「カスタムフィールドで記事の公開日時を制御したい」には新たに返信することはできません。