如何在wordpress中使用clone ajax和jquery创建元框

我想使用clone ajax和jquery在post(在Admin post面板中)创建4个元框。 我还需要添加“添加更多”和“删除”function。

你好试试这个代码我试过这个。 它的工作它在Post中创建四个元框(管理面板wordpress)

add_action( 'add_meta_boxes', 'dynamic_add_custom_box' ); /* Do something with the data entered */ add_action( 'save_post', 'dynamic_save_postdata' ); /* Adds a box to the main column on the Post and Page edit screens */ function dynamic_add_custom_box() { add_meta_box( 'dynamic_sectionid', __( 'Food & Drinks Menu', 'myplugin_textdomain' ), 'dynamic_inner_custom_box', 'post'); } /* Prints the box content */ function dynamic_inner_custom_box() { global $post; // Use nonce for verification wp_nonce_field( plugin_basename( __FILE__ ), 'dynamicMeta_noncename' ); ?> 
ID,'fd_menu',true); $c = 0; if ( count( $fd_menu ) > 0 ) { if(is_array($fd_menu)){ foreach( $fd_menu as $fd_item ) { if ( isset( $fd_item['fd_name'] ) && $fd_item['fd_name']!="" ) { printf( '

' , $c,$fd_item['fd_name'], $fd_item['fd_price'],$fd_item['fd_quantity'] ,$fd_item['fd_dec'], __( 'Remove' ) ); $c = $c +1; } }} } ?>