amitrahav
Forum Replies Created
Viewing 7 replies - 1 through 7 (of 7 total)
-
when will it be?
how can i fix it for deploy website now?
Forum: Plugins
In reply to: [CMB2] Metabox configuration is required to have an ID parameterThanx for the quick response!
guess the readme file was a bit confusing on this…every thing works fine!
Forum: Plugins
In reply to: [CMB2] Metabox configuration is required to have an ID parameteradd_action( 'cmb2_init', 'cmb2_add_geninfo' ); function cmb2_add_geninfo() { $prefix = '_startup_'; $info = new_cmb2_box( array( 'id' => $prefix . 'presentation', 'title' => __( 'Presentation', 'cmb2' ), 'object_types' => array( 'startup' ), 'context' => 'normal', ) ); $idea = $info->add_field( array( 'name' => __( 'Idea', 'cmb2' ), 'id' => $prefix . 'idea', 'on_front' => true, // Optionally designate a field to wp-admin only 'type' => 'wysiwyg', 'options' => array( 'textarea_rows' => 20, 'media_buttons' => true, ), ) ); $model = $info->add_field( array( 'name' => __( 'Business Model', 'cmb2' ), 'id' => $prefix . 'business_model', 'type' => 'wysiwyg', 'options' => array( 'textarea_rows' => 50, 'media_buttons' => true, ), ) ); }
the fields setup is fine
Forum: Plugins
In reply to: [CMB2] Metabox configuration is required to have an ID parameterand then at the page.php:
<?php echo do_shortcode(' [cmb-form id="_startup_idea"]' ); ?>
Forum: Plugins
In reply to: [CMB2] Metabox configuration is required to have an ID parameter<?php /* * Plugin Name: CMB2 - Front-end Shortcode * Description: Display CMB2 metabox forms on the front-end using a shortcode * Author: jtsternberg * Author URI: https://dsgnwrks.pro * Version: 0.1.0 */ /** * Shortcode to display a CMB2 form for a post ID. * Adding this shortcode to your WordPress editor would look something like this: * * [cmb-form id="test_metabox" post_id=2] * * The shortcode requires a metabox ID, and (optionally) can take * a WordPress post ID (or user/comment ID) to be editing. * * @param array $atts Shortcode attributes * @return string Form HTML markup */ function jt_cmb2_do_frontend_form_shortcode( $atts = array() ) { global $post; /** * Make sure a WordPress post ID is set. * We'll default to the current post/page */ if ( ! isset( $atts['post_id'] ) ) { $atts['post_id'] = $post->ID; } // If no metabox id is set, yell about it if ( empty( $atts['id'] ) ) { return 'Please add an "id" attribute to specify the CMB2 form to display.'; } $metabox_id = esc_attr( $atts['id'] ); $object_id = absint( $atts['post_id'] ); // echo(cmb2_get_metabox_form($metabox_id)); // Get our form $form = cmb2_get_metabox_form( $metabox_id, $object_id ); return $form; } add_shortcode( 'cmb-form', 'jt_cmb2_do_frontend_form_shortcode' );
just like the example
having the same problem.
works fine on local machine.
I want the checkbox will appear only in the checkout page after the mail input
Viewing 7 replies - 1 through 7 (of 7 total)