I am trying to add an extra field on the backend menu of
Edit Subscription menu (SUMO Subscription (plugin) -> List of Subscription -> Edit Subscription)
I am sending you a screenshot for where exactly I would like to add it.
do_action( 'sumosubscriptions_admin_after_general_details' , $post->ID );
// 10 is the priority, higher means executed first
// 1 is number of arguments the function can accept
add_action('sumosubscriptions_admin_after_general_details', 'custom_domain', 10, 1);
function custom_domain($post) {
// do something
<input type="text" name="Domain" value="<?php echo $name;?>">
}
I know it's possibly an easy one problem but I haven't succeed to find a solution. Thanks in advance for your help!
I am trying to add an extra field on the backend menu of
Edit Subscription menu (SUMO Subscription (plugin) -> List of Subscription -> Edit Subscription)
I am sending you a screenshot for where exactly I would like to add it.
do_action( 'sumosubscriptions_admin_after_general_details' , $post->ID );
// 10 is the priority, higher means executed first
// 1 is number of arguments the function can accept
add_action('sumosubscriptions_admin_after_general_details', 'custom_domain', 10, 1);
function custom_domain($post) {
// do something
<input type="text" name="Domain" value="<?php echo $name;?>">
}
I know it's possibly an easy one problem but I haven't succeed to find a solution. Thanks in advance for your help!
Share Improve this question edited Aug 26, 2019 at 10:50 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Aug 26, 2019 at 9:56 ZabzukiZabzuki 31 bronze badge1 Answer
Reset to default 0I'm not familiar with the subscription plugin you're using. But as you're attaching a custom function to a action hook, you should most likely echo or print the html you want to be displayed at that particular point. Like this,
function custom_domain( $post_id ) {
// if this is saved as post_meta then get it with get_post_meta( $post_id, 'some_meta_key', true );
$domain = 'someurl';
printf(
'<input type="text" name="Domain" value="%s">',
esc_url( $domain )
);
}