**Desired outcome:**
Converting hashtags within post content to WordPress tags using mobile apps (and not just web admin posts)?
The following code ([sourced from stack overflow](https://stackoverflow.com/questions/58362466/add-a-wordpress-taxonomy-tag-for-hashtags-in-wordpress-content)) works when posting from web WP Admin Backend, can it be modified to also work when posting from official mobile apps such as ‘Jetpack App’ and ‘WordPress App’?
function post_published_notification( $ID, $post ) {
$content = $post->post_content;
preg_match_all(‘/( #\w+)/’, $content, $matches, PREG_PATTERN_ORDER);
if(isset($matches[1])){
foreach($matches[1] as $matchKey){
wp_set_post_tags( $ID, trim($matchKey), true);
}
}
}
add_action( ‘publish_post’, ‘post_published_notification’, 10, 2 );
What are your thoughts? Possible?
[ad_2]
I’ve never used Jetpack, so I’m not sure how posts are being handled using it. A quick search gave me the following article, but I’m not sure if it’s helpful for you: [Jetpack Content Options](https://jetpack.com/support/content-options/). If it’s not the case yet, it could be that you have to enable theme support.
My other guess is that a custom post type is being used that doesn’t respond to the specific function. If you’re able to provide us with a link of a post you’ve created using Jetpack, I can checkout the source code to see the post type.
You’ll want to have that same action fire when a post is created through the REST API, that’s what the apps use.
Add this below the existing action, it should work for what you want:
add_action( ‘rest_after_insert_post’, ‘post_published_notification’, 10, 2 );