admin管理员组文章数量:1414863
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 )
);
}
本文标签: actionstrying to add extra field using hooks
版权声明:本文标题:actions - trying to add extra field using hooks 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745209158a2647782.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论