• I’ve tried following the PHP code in the manage subscribe page according to the guide, but it didn’t work. Does anyone know how to make it?

    add_filter( ‘mailpoet_manage_subscription_page_form_fields’, ‘mp_remove_manage_fields’, 10); function mp_remove_manage_fields( $form ) { unset($form[2]); // Status Dropdown unset($form[4]); // List Selection Dropdown return $form; }

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support B C. a11n

    (@battouly)

    Hi @bill111,

    I’ve tried following the PHP code in the manage subscribe page according to the guide, but it didn’t work. Does anyone know how to make it?

    I understand you are looking to remove individual fields from the Manage Subscription form? What happens when you applied the code below?

    add_filter( 'mailpoet_manage_subscription_page_form_fields', 'mp_remove_manage_fields', 10); function mp_remove_manage_fields( $form ) { unset($form[2]); // Status Dropdown unset($form[4]); // List Selection Dropdown return $form; }

    The above code is expected to remove the fields if your forms look exactly like the one in the documentation (5 fields). If say you don’t have the field “Country”, you will change the index ID of the List Selection from this:

    unset($form[4]); // List Selection Dropdown to this:

    unset($form[3]); // List Selection Dropdown

    The same applies to when you don’t have other fields. Just starting to count from 0 for the ID.

    I hope this helps!

    Could anybody assist me where I should add this code?

    • This reply was modified 11 months, 2 weeks ago by jeoparadised.

    Adding the code via Code Snippet to the page shows no effect

    [mailpoet_manage_subscription]
    
    [code_snippet id=5 php=true]

    Plugin Support Feten L. a11n

    (@fetenlakhal)

    Hi there!

    Thank you for patience.

    Have you tried to add the following code to the Code Snippets plugin?

    add_filter( 'mailpoet_manage_subscription_page_form_fields', 'mp_remove_manage_fields', 10);
    function mp_remove_manage_fields( $form ) {	
    
    	unset($form[2]); // Status Dropdown
    	unset($form[4]); // List Selection Dropdown
    
    	return $form;
    }

    If yes, please send us a screenshot of where you have added the code.

    Also, if you need help with custom code, we recommend reaching out to someone from?Codeable.

    Thanks!

    jeoparadised

    (@jeoparadised)

    The snippet is activated.

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    For your first screenshot, it looks like you’ve added the snippet as an HTML snippet. The code is PHP code, so would need to be added as a PHP snippet:

    As for your second screenshot, where were you adding the [mailpoet_manage_subscription]? (Where is that “Inspector” page from your screenshot?)

    Generally, you would just add the [mailpoet_manage_subscription] shortcode in the page editor for the custom Manage Subscription page you created (and only add the other snippet in the Code Snippets plugin, not to the page itself):

    As mentioned previously, if you need assistance with adding/editing custom code like this, we recommend reaching out to someone from?Codeable.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to remove the Status dropdown and List Selection checkboxes?’ is closed to new replies.