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.
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.