0
彼がこのコードを正しく実行しているかどうかを確認したいのですが、自分のウェブサイト用に作成する連絡先フォームのショートコードを作成してください。WordpressショートコードIssus v3
私はwp codexを見てきました。クラスを使用したいので、もしこれがうまくいくなら、このコードを思いついたのです。
<?php
class MyPlugin {
// Conact Form shortcode
public static function allb_contact_form($atts, $content = " " ) {
//[contact_form]
//get the attribute_escape
$atts = shortcode_atts(
array(),
$atts,
'contact_form'
);
//return HTML
ob_start();
include 'lib/inc/thmeplates/contact-form.php';
return ob_get_clean();
}
}
add_shortcode('contact_form', array($this , 'allb_contact_form'));
しかし、私にはエラーメッセージは表示されません。 1人の男がコードの外側にadd_shortcode('contact_form', array($this , 'allb_contact_form'));
を置くように言った。
@Yiviあなたが仲間ありがとうございます –