$value) { //$screens[] = $key; //} //foreach ( $screens as $screen ) { /* only editors or administrator can display forms */ if( current_user_can('edit_others_pages') ) { $title_box = __( 'Display ACF Form', 'acf_frontend_display' ); /* display ACF frontend metabox */ add_meta_box( 'myplugin_sectionid', $title_box, 'afd_frontend_meta_box_callback', $screen, 'side' ); } //} } add_action( 'add_meta_boxes', 'afd_frontend_add_meta_box'); function afd_frontend_meta_box_callback( $post ) { global $post; if($post->post_type != 'acf'){ echo 'to set display form properties go to ACF form'; return false; } /* check is globals are defined (in first fieldgroup) */ /* TODO use new function from API afd_attached_forms_array */ // Add an nonce field so we can check for it later. wp_nonce_field( 'afd_frontend_meta_box', 'afd_frontend_meta_box_nonce' ); /* * Use get_post_meta() to retrieve an existing value * from the database and use the value for the form. */ $value_render = get_post_meta( $post->ID, '_meta_afd_form_render_box_key', true ); $value_alpaca = get_post_meta( $post->ID, '_meta_afd_form_render_box_alpaca', true ); if(esc_attr( $value_render ) == 'true'){ $checked = 'checked=checked'; }else{ $checked = ''; } if( (afd_form_permision() == true) || ($post->post_type == 'acf') ){ echo '