説明

について wpforms_form_pages_content_before アクションは、サイトのフロントエンドにフォームが表示される前に発生します。

パラメータ

このアクションはパラメーターを受け付けない。

詳細情報

について wpforms_form_pages_content_before で作成されたフォームに対してのみ発生します。 Form Pagesアドオン.出力レンダリングプロセスの初期段階で実行される。

代替案としては、次のようなものがある。 wpforms_form_pages_content_after同様の機能である。

ソース

wpforms-form-pages/templates/single-form.php

この例では、フォームを表示する前に、フルデジタルカタログへのリンクを掲載します。

/**
 * Output something before your Form Pages form(s) using the Fires before a form is displayed on the site’s frontend, only if the form exists, contains fields, and was created with the <strong>Form Pages</strong> addon.
 action.
 * 
 * @link  https://wpforms.com/developers/wpforms_form_pages_content_before/
 */
function wpf_dev_form_pages_content_before( ) {
      
  
    // Run code or see example echo statement below.
    _e( 'If you would like to download our digital catalog, <a href="http://yourlinkurl.com/" target="_blank">click here</a>.', 'plugin-domain' );
  
}
add_action( 'wpforms_form_pages_content_before', 'wpf_dev_form_pages_content_before');
wpforms_form_pages_content_beforeアクションを使うことで、フォームが表示される前に何かを出力することができます。