Support » Themes and Templates » Indicate a post was posted using iphone app

  • Is there any way to indicate that a post was posted with the iphone app? The only way a post will get published is through the normal backend with a laptop or through the iphone app. If I can find a way to make a conditional tag such as

    if “published through XML-RPC” {echo ‘Published via iPhone’} ;

    The posts published through the app are going to be fast and potentially typo-prone. If I had a way of excusing that it would be great.

    Anybody have any ideas? Any help would be appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer



    This is a bit of a workaround. As I understand it the app doesn’t have custom fields. But you can set a custom field automatically when saving a post through XML-RPC.
    Put this in your theme’s functions.php:

    function set_ios_meta($post_ID){
    if(wp_is_post_autosave($post_ID) || wp_is_post_revision($post_ID)) {
      return $post_ID;
    update_post_meta($post_ID, 'ios', 'true');
    add_action('xmlrpc_publish_post', 'set_ios_meta');

    To show the custom field in your theme’s template files use this:

    $meta_value = get_post_meta($post->ID, 'ios', true);
    if($meta_value != ''){
    echo 'Published via iPhone';

    That’s awesome! That is the answer. Thank you much for the quick reply and the excellent answer. The site is

    Moderator keesiemeijer



    you’re welcome. Glad you got it resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Indicate a post was posted using iphone app’ is closed to new replies.