WPCF7_TagGenerator::add
Adds a form-tag generator instance.
Метод класса: WPCF7_TagGenerator{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WPCF7_TagGenerator = new WPCF7_TagGenerator(); $WPCF7_TagGenerator->add( $id, $title, $callback, $options );
- $id(обязательный)
- .
- $title(обязательный)
- .
- $callback(обязательный)
- .
- $options
- .
По умолчанию: ''
Код WPCF7_TagGenerator::add() WPCF7 TagGenerator::add CF7 6.0.6
public function add( $id, $title, $callback, $options = '' ) { $id = trim( $id ); if ( '' === $id or ! wpcf7_is_name( $id ) or ! is_callable( $callback ) ) { return false; } $options = wp_parse_args( $options, array( 'version' => '1', ) ); $this->panels[$id] = array( 'title' => $title, 'content' => 'tag-generator-panel-' . $id, 'options' => $options, 'callback' => $callback, ); if ( version_compare( $options['version'], '2', '<' ) ) { $message = sprintf( /* translators: 1: version, 2: tag generator title */ __( 'Use of tag generator instances older than version 2 is deprecated. Version %1$s instance (%2$s) detected.', 'contact-form-7' ), $options['version'], $title ); wp_trigger_error( __METHOD__, $message, E_USER_DEPRECATED ); } return true; }