[Plugin: Twitter Tools] Default hashtags blog post tweets not being read
-
When using Twitter Tools and Twitter Tools – Hashtags, I’ve set the default hashtags (and verified that it was stored). However, the default hashtags field is not populated in new blog posts.
I tracked the issue down to line 21 of twitter-tools-hashtags.php:
empty($post->ID) ? $hashtags = get_option('aktt_hash_tags') : $hashtags = get_post_meta($post->ID, '_aktt_hash_meta', true);
I think the problem is that
empty($post->ID)
is being used to see if this is a newly created post or if this is a saved post (draft, published, or otherwise).If this is a new post, then use the default hashtags.
If this is a saved post, then used the stored _aktt_hash_meta valueHowever,
empty($post->ID)
should always evaluate to false because even newly created posts have an ID. I cross checked this by inserted some debug statements and then doing some research which turned up line 152 in wp-admin/post.php (https://svn.automattic.com/wordpress/tags/3.0/wp-admin/post.php)if ( empty($post->ID) ) wp_die( __('You attempted to edit an item that doesn’t exist. Perhaps it was deleted?') );
I tried a couple of different things for attempting to detect if a post was new or not, but wasn’t able to come up with anything that works. My one thought was to check the value of
get_post_meta($post->ID, '_aktt_hash_meta', false)
to see if it would return as a string because “The function returns an empty string if the key has not yet been set, regardless of the value of $single.” …per https://codex.www.ads-software.com/Function_Reference/get_post_meta but it’s returning an array, which means that the key has already been set when you create the new post, so that won’t work.I guess the questions are: am I the only one having this issue (I don’t think so, but I try not to assume), can you validate the issue, and is it going to be fixed?
As a side note,
attribute_escape
has been depreciated in favor ofesc_attr
- The topic ‘[Plugin: Twitter Tools] Default hashtags blog post tweets not being read’ is closed to new replies.