Support » Plugin: Jetpack by WordPress.com » Custom shortcode in Post by Email

  • Resolved preethamchandra

    (@preethamchandra)


    Hi,

    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’);

    VS

    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.

    http://wordpress.org/plugins/jetpack/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic

    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.

    Thanks for answering.

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

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic

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

    hi,

    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.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic

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

    You can also read more about shortcode attributes here:
    http://codex.wordpress.org/Function_Reference/shortcode_atts
    http://codex.wordpress.org/Function_Reference/add_shortcode

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

    Plugins and Hacks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom shortcode in Post by Email’ is closed to new replies.