Answers for "display product page title in field cf7"

PHP
0

display product page title in field cf7

wpcf7_add_shortcode( 'cf7_extra_fields', 'cf7_extra_fields_func', true );
function cf7_extra_fields_func( $atts ) {
   $html = '';
   $html .= '<input type="hidden" name="page-title" value="'.get_the_title().'" />';
   $html .= '<input type="hidden" name="page-url" value="'.get_the_permalink().'" />';
   return $html;
}
Posted by: Guest on December-10-2020

Code answers related to "display product page title in field cf7"

Browse Popular Code Answers by Language