WPCF7_ContactForm::shortcode()
Returns a WordPress shortcode for this contact form.
Метод класса: WPCF7_ContactForm{}
Хуки из метода
Возвращает
null
. Ничего.
Использование
$WPCF7_ContactForm = new WPCF7_ContactForm(); $WPCF7_ContactForm->shortcode( $args );
- $args **
- -
По умолчанию: ''
Код WPCF7_ContactForm::shortcode() WPCF7 ContactForm::shortcode CF7 5.7.5.1
public function shortcode( $args = '' ) { $args = wp_parse_args( $args, array( 'use_old_format' => false ) ); $title = str_replace( array( '"', '[', ']' ), '', $this->title ); if ( $args['use_old_format'] ) { $old_unit_id = (int) get_post_meta( $this->id, '_old_cf7_unit_id', true ); if ( $old_unit_id ) { $shortcode = sprintf( '[contact-form %1$d "%2$s"]', $old_unit_id, $title ); } else { $shortcode = ''; } } else { $shortcode = sprintf( '[contact-form-7 id="%1$d" title="%2$s"]', $this->id, $title ); } return apply_filters( 'wpcf7_contact_form_shortcode', $shortcode, $args, $this ); }