admin管理员组文章数量:1291095
I am trying to trigger the echo when the form button will click. but not able to do this. if I don't use form and direct echo there. this is working. but when I use a form, it's not working.
can anyone help me with this?
<?php
add_action( 'add_meta_boxes', 'meta_box_cusotm_buttons' );
function meta_box_cusotm_buttons(){ // --- Parameters: ---
add_meta_box(
'sync-with-server-metabox', // ID attribute of metabox
'Server Action', // Title of metabox visible to user
'meta_box_callback', // Function that prints box in wp-admin
'website', // Show box for posts, pages, custom, etc.
'side', // Where on the page to show the box
'high' // Priority of box in display order
);
}
function meta_box_callback( $post ){
if(isset($_POST['connectToServer'])){
echo 'Hello';
}
?>
<form action="" method="post">
<input name="connectToServer" type="submit" value="submit" />
</form>
<?php
}
本文标签: hooksHow to use custom form on addmetaboxes callback
版权声明:本文标题:hooks - How to use custom form on add_meta_boxes callback 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741523746a2383345.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论