Forum Replies Created

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • jivedig
    Member

    Rock on. Thanks Steve (and Jason)!

    jivedig
    Member

    It’s definitely not working the same for me though. When I click an existing featured image in the Featured Image metabox, it opens the featured image modal with the existing featured image already selected, so I can edit title/alt/desc/etc.

    When I click the existing image in the Piklist file upload field it opens the modal with no image selected. So I have to find and re-select my image in order to edit the title/alt/desc.

    Are you seeing differently? Maybe this only happens on term meta?

    jivedig
    Member

    Thanks! Without spending a ton of time, I found a workaround.
    This checks if there is an image, then creates a button that sends you to the edit image page.

    $cat_id = isset($_GET['tag_ID']) && ! empty($_GET['tag_ID']) ? absint($_GET['tag_ID']) : '';
    $image  = '';
    if ( $cat_id ) {
    	$image = get_term_meta( $cat_id, 'll_term_image', true );
    }
    if ( $image ) {
    	echo '<p><a target="_blank" class="button" href="' . get_edit_post_link( $image ) . '">Edit current image in new window</a></p>';
    }

    Mind you, this is term meta on categories for me. But you get the idea.

    jivedig
    Member

    Sorry i’m probably not explaining correctly.

    Attached a screenshot to hopefully clarify.

    Attachments:
    You must be logged in to view attached files.
    jivedig
    Member

    Even if there were multiple images, clicking on the already uploaded image should bring me to the modal where i can edit the title/alt/caption associated with that image. Same window as when you click an existing image in the media uploader. See attached screenshot for the modal that I would expect to open when clicking an already uploaded file.

    Attachments:
    You must be logged in to view attached files.
    in reply to: Frontend forms in template files #6095
    jivedig
    Member

    You may need to set a custom scope and manually update the CPT via the piklist action.

    'scope' => 'update_daves_cpt',

    Then:

    add_action( 'piklist_save_field-connect_resource_to_step', 'update_daves_cpt', 10, 1 );
    function update_daves_cpt( $fields ) {
    // Manually do some awesomeness
    }

    Note: add the same scope to all the fields you want for the CPT update

    in reply to: Frontend forms in template files #6093
    jivedig
    Member

    No time to test now, but I was going to suggest using the value parameter to preload values when you don’t want to use the query var.

    in reply to: Frontend forms in template files #6091
    jivedig
    Member

    Dave, something is not right. Can you paste your code here? Or even DM it in our Genesis Slack group so I can test?

    You should absolutely have the <form> wrap. I never _not_ had it work.

    in reply to: Front end form, update a CPT #6067
    jivedig
    Member

    I don’t think you need the cpt name in the query string. WP uses unique ID’s regardless of post_type. I have this working with just ?_post[ID]=57 on a CPT.

    in reply to: Frontend forms in template files #6066
    jivedig
    Member

    Howdy Dave! I was hoping i’d spark some Piklist interest in you 😉
    You’ve got an interesting use case here, i’d be curious to test it out as well at some point.

    Here’s a quick tip, don’t use the shortcode in a template… do this:
    piklist::render('forms/job');

    The only way i’ve tested editing an existing post is adding a query var to the url e.g( example.com/my-form-page/?_post[ID]=123 )
    I was hoping to find a way to ‘load’ a form with post values where the ID comes from somewhere else. Naturally we could grab the values ourselves and put them in the field ‘value’ parameter, but that’s very manual (CMB2 style).

    in reply to: Redirect on form submit #6013
    jivedig
    Member

    Pardon the jump in here, but totally relevant. When using a front end form to create a new post/cpt, how can we redirect to the new post? Along the same lines, just returning the post ID of the newly created post would be great for other things as well. Possible?

    in reply to: on_post_status when editing post with front end form #5951
    jivedig
    Member

    FWIW, this is how I’m successfully doing this now.

    $edit_post_data      = isset($_GET['_post']) ? $_GET['_post'] : null;
    $edit_post_id        = isset($edit_post_data['ID']) ? absint($edit_post_data['ID']) : -1;
    $edit_post_status    = get_post_status($edit_post_id);
    $edit_post_published = ( 'publish' === $edit_post_status ) ? true : false;
    
    // Hide field if editing a published post
    if ( ! $edit_post_published ) {
        // My piklist field(s)
    }
    in reply to: Front End Form Taxonomy Not Saving #5931
    jivedig
    Member

    Just jumping in to say that this is working fine for me.

    piklist('field', array(
        'type'        => 'radio',
        'scope'       => 'taxonomy',
        'field'       => 'program_type',
        'choices' => piklist(get_terms('program_type', array(
                'hide_empty' => false,
            )), array(
                'term_id',
                'name',
            )
        ),
        'required' => true,
    ));
    in reply to: Metabox, file upload field with custom scope error #5862
    jivedig
    Member

    @jason: PHEW! I’m deep in this plugin, and LOVING Piklist. So happy I happened to sit at your table at WordCamp US 🙂
    Without custom scope Piklist would lose a lot of its power IMO.
    Thanks!

    in reply to: Metabox, file upload field with custom scope error #5860
    jivedig
    Member

    @jason Thanks. I’ll give it a try. Now i’m nervous that my whole project is based on custom scope. How far into dangerous territory am I (re Piklist)?

Viewing 15 posts - 1 through 15 (of 24 total)