Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter charldarwin

    (@charldarwin)

    Hi, Thanks for answer.

    I couldn’t get the solution with the information you give me. There could be something wrong in my code, Could you tell me what’s the mistake i’m doing?

    I’m using two metabox (Specific Details and Basic Details) with two fields inside(address and extra-info)(phone and email) respectively.

    This is my code:

    if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) &&  $_POST['action'] == "new_post") {
    
        if (isset ($_POST['title'])) {
            $title =  $_POST['title'];
        } else {
            echo 'Please, Complete Title Field';
        }
    
        $tags = $_POST['post_tags'];
        $address = $_POST['address'];
        $extra_details = $_POST['exinfo'];
    
        $phone= $_POST['phone'];
        $email = $_POST['email'];
    
        $new_post = array(
        'post_title'    =>  $title,
        'post_content'  =>  $description,
        'post_tags'     =>  array($_POST['country']),
        'post_tags'     =>  array($_POST['city']),
        'tags_input'    =>  array($tags),
        'post_status'   =>  'publish',
        'post_type' =>  'events'
        );
    
        $pid = wp_insert_post($new_post);
        update_post_meta($pid, 'specific-details_address_1', array( $address ) );
        update_post_meta($pid, 'specific-details_extra-info_1', array( $extra_details ) );
    
        update_post_meta($pid, 'basic-details_phone-number_1', array( $phone) );
        update_post_meta($pid, 'basic-details_email_1', array( $email ) );
    
        if ($_FILES) {
            foreach ($_FILES as $file => $array) {
            $newupload = insert_attachment($file,$pid);
            }
        }
    
        wp_set_post_tags($pid, $_POST['post_tags']);
        wp_set_post_terms( $pid, $_POST['country'], 'tax-country', false );
        wp_set_post_terms( $pid, $_POST['city'], 'tax-city', false );
    
    }
    
    do_action('wp_insert_post', 'wp_insert_post');

    And this is my code in the form

    <form id="new_post_event" name="new_post" method="post" action="" class="event-entry" enctype="multipart/form-data">
                <div id="fe-block1" class="fe-block">
                    <fieldset name="name">
                        <label for="title">Title*:</label><br>
                        <input type="text" id="title" value="" tabindex="1" name="title" />
                    </fieldset>
                </div>
                <div id="fe-block2" class="fe-block">
                    <fieldset class="country">
                        <label for="country">Country:</label><br>
                        <?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'name' => 'country', 'orderby' => 'name', 'taxonomy' => 'country', 'selected' => $tag->parent, 'exclude_tree' => $tag->term_id, 'hierarchical' => true)); ?>
                    </fieldset>
                    <fieldset class="city">
                        <label for="city">City:</label><br>
                        <?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'name' => 'city', 'orderby' => 'name', 'taxonomy' => 'city', 'selected' => $tag->parent, 'exclude_tree' => $tag->term_id, 'hierarchical' => true)); ?>
                    </fieldset>
                    <fieldset name="address">
                        <label for="address">Address:</label><br>
                        <input type="text" id="address" value="" tabindex="13" name="address" />
                    </fieldset>
                    <fieldset name="phone">
                        <label for="phone">Phone:</label><br>
                        <input type="text" id="phone" value="" tabindex="13" name="phone" />
                    </fieldset>
                    <fieldset name="email">
                        <label for="email">Email:</label><br>
                        <input type="text" id="email" value="" tabindex="13" name="email" />
                    </fieldset>
                    <fieldset name="exinfo">
                        <label for="exinfo">Inf Details(max. 200 caract.):</label><br>
                        <textarea type="text" id="exinfo" value="" tabindex="26" name="exinfo"></textarea>
                    </fieldset>
                    <div class="submit">
                        <input type="submit" value="Send" tabindex="40" id="submit" name="submit" />
                    </div>
                    <input type="hidden" name="action" value="new_post" />
                    <?php wp_nonce_field( 'new-post' ); ?>
                </div>
            </form>

    All this code is in the same file front-form.php

    In functions.php I put this code:

    add_filter( 'wck_cfc_unserialize_fields_basic-events-details', 'wck_change_unserialize_arg' );
    function wck_change_unserialize_arg( $bool ){
    return true;
    }
    
    add_filter( 'wck_cfc_unserialize_fields_specific-events-details', 'wck_change_unserialize_arg_2' );
    function wck_change_unserialize_arg_2( $bool2 ){
    return true;
    }

    I hope you could help me to understand whats wrong with the code? I’m using The Custom Field creator from the wck plugin

    Thanks

    Thread Starter charldarwin

    (@charldarwin)

    Thanks for answer Angelo,

    I just look into both files and I can’t find any option to configure mail activation or to load custom messages from theme my login.

    Thanks for answer, I hope to get the solution as soon as posible.

    Hi jasnon, I’m getting the some problem, I would like to know if you could find a solution for it in other forums, I have been looking for info about it but I can’t solve it yet.

    But in my case is when I use it in a Modal Window.

Viewing 3 replies - 1 through 3 (of 3 total)