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

    (@jeherve)

    Jetpack Mechanic πŸš€

    The plugin you mentioned gets triggered with the save_post hook. That action is triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email.

    If it doesn’t work in your case, I would suggest trying with a different XML-RPC client, to make sure the problem isn’t linked to your current client.

    Let me know how it goes.

    Thread Starter nsoltan

    (@nsoltan)

    Hi Jeremy! Do you mean the plugin you wrote? Currently neither that or the linked plugin are working while using the WordPress mobile app or importing posts through the python wp-library πŸ™

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic πŸš€

    The function might not work when importing posts since imports work a bit differently, and Publicize was built to ignore imported posts.

    It should however work with the mobile apps. When using the code snippet I published, could you try to save a new post as a draft in the app, and then publish it? Does it help?

    Thread Starter nsoltan

    (@nsoltan)

    Hi again! Using the online interface I see the # when creating a post. Publicize is publishing the post with the normal template just fine when posting via python and mobile, but no #.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic πŸš€

    Could you paste the snippet you used here, so I can run some tests on my end?

    Thanks!

    Thread Starter nsoltan

    (@nsoltan)

    function jeherve_publicize_hashtags() {
    	$post = get_post();
    	if ( ! empty( $post ) ) {
    
    		// Grab the tags of the post
    		$post_tags = get_the_tags( $post->ID );
    
    		// Append tags to custom message
    		if ( ! empty( $post_tags ) ) {
    
    			// Create list of tags with hashtags in front of them
    			$hash_tags = '';
    			foreach( $post_tags as $tag ) {
    				$hash_tags .= ' #' . $tag->name;
    			}
    
    			// Create our custom message
    			$custom_message = get_the_title() . ' ' . $hash_tags;
    			update_post_meta( $post->ID, '_wpas_mess', $custom_message );
    		}
    	}
    }
    
    // Save that message
    function jeherve_cust_pub_message_save() {
    	add_action( 'save_post', 'jeherve_publicize_hashtags' );
    }
    add_action( 'publish_post', 'jeherve_cust_pub_message_save' );
    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic πŸš€

    Could you let me know where you pasted that snippet? In a functionality plugin like this one?

    Thread Starter nsoltan

    (@nsoltan)

    Hi again!

    I used “Functionality”-plugin, I switched to the one you suggested, still the same (lack-of) effect πŸ™

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic πŸš€

    Thanks for sticking with me on this. I looked into this a bit more, and I’m afraid that’s an issue with how Jetpack synchronizes its data, as outlined here:
    https://github.com/Automattic/jetpack/issues/3267

    We’ll work on getting this fixed as it sometimes causes other issues when trying to customize Related Posts, but until that issue is closed I’m afraid I won’t have a way to work around this problem.

    Sorry not to be of more help.

    Thread Starter nsoltan

    (@nsoltan)

    Thank you for trying!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Publicize custom content’ is closed to new replies.