Ready to get started?Download WordPress


Jetpack by WordPress.com
[resolved] Custom shortcode in Post by Email (6 posts)

  1. preethamchandra
    Posted 11 months ago #


    I am extensively using post by email feature and its brilliant.

    I was thinking is there anyway we can add custom shortcode to modify a value.

    Usual code of shortcode
    function footag_func( $atts ) {
    return "foo = {$atts['foo']}";
    add_shortcode('footag', 'footag_func');



    shortcode in post by email

    [category x,y,z] is different than footag.

    category shortcode is setting some value in post.

    I have created custom meta box, is there anyway i can set this using shortcode ?

    or even being able to call a function in functions.php with parameters would do.


  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 11 months ago #

    You can use just any shortcodes in the emails you send via Post By Email; the shortcode will be processed when the post is displayed on your site.

    If, however, you want to create a function that will fill in some meta data before the post is actually displayed on your site, I'm afraid that won't be possible. The emails are processed on WordPress.com servers, so you would not be able to alter the default behaviour of Post By Email with some code on your site.

    I hope this helps.

  3. preethamchandra
    Posted 11 months ago #

    Thanks for answering.

    Just a thought
    Is there anyway to call the function defined in functions.php without using shortcode?

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 11 months ago #

    I'm not sure I understand your question. Could you give me more details about what you're trying to achieve?

  5. preethamchandra
    Posted 11 months ago #


    I have created some meta boxes.

    Lets assume meta1 and meta2.

    What is what to do is,

    in post by email


    Post Contents

    [category x,y,z]
    [custommeta meta1="hello" meta2="world"]


    This in turn should the set the value of my meta.

    if shortcode is not possible, any other way to get this done.

  6. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 11 months ago #

    Ok, I understand now. To create shortcodes using multiple attributes, you can use this shortcode generator:

    You can also read more about shortcode attributes here:

    If you're having trouble creating your own shortcode, you can start a new thread in the Hacks sub-forums:


You must log in to post.

About this Plugin

About this Topic