Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hey @urshadow,

    Thanks for reaching out to us.

    Since there are multiple fields added to your comment form, it’s hard to know what code they have used and based on which plugin starts first, their code would be placed first or last.

    You will need custom code to exactly align the way you want and this is beyond the scope of our support. However, you can find example code at https://github.com/ibericode/mc4wp-snippets/blob/master/integrations/wp-comment-form/output-after-submit-button.php which you can use to learn how to place the subscription field after the submit button.

    Thread Starter urshadow

    (@urshadow)

    Thanks @hchouhan

    Thread Starter urshadow

    (@urshadow)

    Hi @hchouhan

    I slightly modified the code provided by you to position the checkbox as per my liking, I just wanted to get it checked by you if you believe this can create any problems?

    add_action( 'template_redirect', function() {
    
    	// make sure mc4wp is activated
    	if( ! function_exists( 'mc4wp' ) ) { return; }
    
    	// get integration manager
    	$integrations = mc4wp('integrations');
    	if( ! $integrations instanceof MC4WP_Integration_Manager ) {
    		return;
    	}
    
    	// get comment form integration
    	$comment_form_integration = $integrations->get('wp-comment-form');
    	remove_filter( 'comment_form_submit_field', array( $comment_form_integration, 'add_checkbox_before_submit_button' ), 90 );
    	add_action( 'comment_form_submit_field', array( $comment_form_integration, 'add_checkbox_before_submit_button' ), 9 );
    } );
    Plugin Contributor Lap

    (@lapzor)

    Nothing that jumps out to me / seems to be fine, but the best way to find out is by testing it yourself as this kind of custom code is out of scope for our free support.

    Kind regards,

    Thread Starter urshadow

    (@urshadow)

    Thanks @lapzor!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Location of interest choice under WP comment form’ is closed to new replies.