Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: Serialize checkbox data #6941
    bshep
    Member

    Thanks – the reason I needed the array is that I’m using the Admin Columns plugin to show my site admins a column with multiple values, and Admin Columns’ “multiple values” setting only works with an array. As far as other use, I’m fine with the way it is.

    in reply to: Session variable with form redirect #6483
    bshep
    Member

    Got it working, but not sure I fully understand it. Right now I have my front-end form redirect set to empty by using ”. This tacks on my session variable as below in my functions file:

    add_filter( ‘wp_redirect’, ‘my_stick_new_post_id_in_redirect’, 10, 2 );
    function my_stick_new_post_id_in_redirect ( $location, $status ) {
    return( $location.$_SESSION[“myv_apply_returl”] );
    }

    My only remaining issue is that this fires on every form submit – how could I get it to work only when I need it? Would I need to put an id on the submit button, or does that have anything to do with the above code?

    in reply to: Session variable with form redirect #6456
    bshep
    Member

    Still having issues with this. When combining it with jquery to disable the submit button (to prevent duplicate sumbissions), the redirect doesn’t work.

    If there was a way to dynamically populate the forms “Redirect: ” comment, that would solve the problem. Anyone know of a way to do this?

    in reply to: Session variable with form redirect #6357
    bshep
    Member

    I was able to get this working by adding the following to the bottom of the form, where $returl is my referring url, but would still like to know if there’s a better way…

    if (isset($_POST[‘submit’])) { ?>
    <script type=”text/javascript”>
    window.location.href = ‘<?php echo $returl ?>’;
    </script>
    <?php } ?>

    in reply to: meta data used in dynamic select choices #6248
    bshep
    Member

    Thanks – I actually just figured this out by modifying some code I used with CMB2 previously. I added the following to the top of my PikList metafields file:

    $args = array(
    ‘blog_id’ => $GLOBALS[‘blog_id’],
    ‘meta_key’ => ‘last_name’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘ASC’,
    ‘fields’ => ‘all’,
    );

    $entries = get_users( $args );

    $user_options = array();
    if ( $entries ) {
    foreach ( $entries as $entry ) {
    $name = get_user_meta($entry->ID,’last_name’,’single’) . ‘, ‘ . get_user_meta($entry->ID,’first_name’,’single’) . ‘ (‘ . $entry->user_login . ‘)’;
    $user_options[ $entry->ID ] = $name;
    }
    }

    Then referenced it in the select list with:

    ,’choices’ => array(” => ‘- Select -‘) + $user_options

    This gave me the format I needed.

    in reply to: Redirect on form submit #6019
    bshep
    Member

    Found this was related to another issue I was having because I didn’t have latest beta installed. My redirect in comment block is working now.

    in reply to: Required Field alert on front end #6018
    bshep
    Member

    I thought I had the latest, but didn’t (I even saw the notice about frontend forms working in 9.9x). After installing the latest version, it’s working. Thanks!

Viewing 7 posts - 1 through 7 (of 7 total)