• Resolved Allixria

    (@allixria)


    I would like to know if it’s possible somehow to “associate” the post ID of the post where the shortcode was generated, and save it as custom field in post meta.

    Example: In a “single” page of a custom post type, I use the shortcode with pre-filled “to” id with the current post author. I would like to push the postID also, and have it saved to the “new” message (as hidden field) ?

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Allixria

    (@allixria)

    I am using this one : fep_shortcode_message_to

    The one you point to doesn’t seem to show for whatever reason.

    I need to add custom parameters to this shortcode and then being able to have access to them in your hook ‘fep_action_message_after_send’

    I could modify the core in your class form and inject a hidden field with a GET variable but it is still a core modif and I don’t like that..

    Thank you very much for your insight!

    for fep_shortcode_new_message_form Form will not show if current user can not send message to “to” user. So non logged in user or if logged in user and “to” user is same then no form will be shown.

    For your case you can use fep_after_form_fields action hook to output a hidden field and access them using fep_action_message_after_send hook when message sent.

    Thread Starter Allixria

    (@allixria)

    You are a life-saver!

    About your other shortcode, I am logged in as Administrator.. And I made sure to check this role in “new message” sending access.

    Not working :
    echo do_shortcode('[fep_shortcode_new_message_form to="'. $post->post_author . '" subject="I am making an offer"]');

    And the one I am using (working) :
    echo do_shortcode('[fep_shortcode_message_to to="'. $post->post_author . '" subject="I am making an offer" text="Make an Offer" class="pm_offer"]');

    Thread Starter Allixria

    (@allixria)

    Oh.. The primary step is kind of missing..

    How can I append the new parameters to the shortcode?

    Thanks!

    Thread Starter Allixria

    (@allixria)

    Nevermind about the primary step, I could make it work by placing the

    add_action('fep_after_form_fields', 'iv_pm_after_form_fields', 10,3);

    right before the shortcode generation instead of in functions.php file.

    It seems your suggested shortcode to display inline message form isn’t working with userIDs.. Only with usernames..

    So.. Everything is fine now, thank you very much!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Additional parameters to shortcode’ is closed to new replies.