Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter KeineKaefer

    (@keinekaefer)

    Dear Chad,

    here are two more suggestions:

    1.)
    The painting of the checkboxes is distorted by a line break. At the moment, a checkbox is painted like:

    “Subscribe newsletter?
    checkbox”

    It should be like:
    “checkbox Subscribe newsletter?”

    You might reconsider the line (378 in wp-members-dialog.php) “$form = $form . ‘<div class=”div_’ . $class . ‘”>’;” for checkboxes.

    Why not painting tos and checkboxes in the same way?

    2.)
    On my ‘user-edit’ page the user can change the agreement to the tos.
    I don’t understand the line (360 in wp-members-dialog.php) “if( $wpmem_fields[$row][2] == ‘tos’ && $toggle == ‘edit’ && ( get_user_meta($userdata->ID, ‘tos’, true ) ) )”.

    When should the user have the right to change the agreement to the tos at all? If the user could cancel the agreement, she/he must be suspended immediately.

    Best regards.

    Thread Starter KeineKaefer

    (@keinekaefer)

    Dear Chad,

    after looking in your code (wp-members-dialog.php, starting line 417) the problem is that you are checking if the form has not yet been submitted with ‘! $_POST’.

    This is quite general. I use the plugin in a template that submits a form before the wpmem register form will be shown.

    Why don’t you check for some wpmem $_POST variables like
    $submitted = ( isset( $_POST[‘a’] ) and ( $_POST[‘a’] === ‘register’ or $_POST[‘a’] === ‘update’ ) ); ?

    Everybody could have this problem if for some reasons a form was submitted before (e.g. another plugin).

    Best regards!

    Forum: Hacks
    In reply to: Always use wp_enqueue_script?
    Thread Starter KeineKaefer

    (@keinekaefer)

    Hey bcworkz and pekz0r,

    thank you very much for your answers. You are very kind.

    Now I really understand the concept better.

    Best regards. 🙂

    Forum: Hacks
    In reply to: Always use wp_enqueue_script?
    Thread Starter KeineKaefer

    (@keinekaefer)

    bcworkz,

    thank you very much for your answer. Now I understand why to enqueue the scripts.

    I have one follow up question:
    Is it really necessary to use wp_localize_script for creating Javascript variables? What are the drawbacks when creating these variables with a PHP-script?

    Thank you in advance.

    Forum: Hacks
    In reply to: Always use wp_enqueue_script?
    Thread Starter KeineKaefer

    (@keinekaefer)

    Hey @mercime,

    thank you very much for your response. I’m not really happy with your answer because you basically just referring to what is written in the manual.

    However, I have not the slightest clue why it should be necessary to a register a script that creates a Javascript variable like ‘Amount = 5;’ or code like ‘if ( e.which === 13 ) { $(e.target).closest(‘form’).submit(); }’.

    As I said I conditionally add these scripts. In order to do so I would need a lot of repetitive code with database queries in functions.php.

    Do you really propose that I should boost the complexity of the project and not even know why I’m doing this?

    Thank you in advance and best regards!

Viewing 5 replies - 1 through 5 (of 5 total)