actions - trying to add extra field using hooks

I am trying to add an extra field on the backend menu of Edit Subscription menu (SUMO Subscription (plugin) -> List o

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 badge
Add a comment  | 

1 Answer 1

Reset to default 0

I'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 )
  );
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745209159a4616736.html

相关推荐

  • actions - trying to add extra field using hooks

    I am trying to add an extra field on the backend menu of Edit Subscription menu (SUMO Subscription (plugin) -> List o

    5小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信