1. Home
  2. Knowledge Base
  3. Password Protected Categories
  4. Advanced Usage
  5. How to change the submit button to a <button> element

How to change the submit button to a <button> element

By default, the plugin uses a <input type="submit" /> element for the login form’s submit button.

If you want to change this for a button element, you can add the following code to your theme’s functions.php file:

function ppc_change_login_submit_button( $form ) {
    return preg_replace( '/<input type="submit"(.*)value="(.*)"(.*)\/>/iU', '<button type="submit"$1value="$2"$3>$2</button>', $form, 1 );
}
add_filter( 'ppc_category_login_form', 'ppc_change_login_submit_button' );

 

Was this article helpful?

Related Articles