I published a post on my blog and something went wrong in transmission and the post was not pushed to email, facebook, linkedin etc. But now that the post is published, i can't go back and tick the checkboxes taht allow me to post to facebook. What do i need to hack in the following code in order to allow me to toggle the checkboxes?
private function get_metabox_form_connected( $connections_data ) {
global $post;
$all_done = $this->publicize->post_is_done_sharing();
$all_connections_done = true;
ob_start();
?>
<div id="publicize-form" class="hide-if-js">
<ul>
<?php
foreach ( $connections_data as $connection_data ) {
$all_connections_done = $all_connections_done && $connection_data['done'];
?>
<li>
<label for="wpas-submit-<?php echo esc_attr( $connection_data['unique_id'] ); ?>">
<input
type="checkbox"
name="wpas[submit][<?php echo esc_attr( $connection_data['unique_id'] ); ?>]"
id="wpas-submit-<?php echo esc_attr( $connection_data['unique_id'] ); ?>"
class="wpas-submit-<?php echo esc_attr( $connection_data['service_name'] ); ?>"
value="1"
<?php
checked( true, $connection_data['enabled'] );
disabled( false, $connection_data['toggleable'] );
?>
/>
<?php if ( $connection_data['enabled'] && ! $connection_data['toggleable'] ) : // Need to submit a value to force a global connection to POST ?>
<input
type="hidden"
name="wpas[submit][<?php echo esc_attr( $connection_data['unique_id'] ); ?>]"
value="1"
/>
<?php endif; ?>
<?php echo esc_html( $this->connection_label( $connection_data['service_label'], $connection_data['display_name'] ) ); ?>
</label>
</li>
<?php
}
$title = get_post_meta( $post->ID, $this->publicize->POST_MESS, true );
if ( ! $title ) {
$title = '';
}
$all_done = $all_done || $all_connections_done;
?>
</ul>
<label for="wpas-title"><?php _e( 'Custom Message:', 'jetpack' ); ?></label>
<span id="wpas-title-counter" class="alignright hide-if-no-js">0</span>
<textarea name="wpas_title" id="wpas-title"<?php disabled( $all_done ); ?>><?php echo esc_textarea( $title ); ?></textarea>
<a href="#" class="hide-if-no-js button" id="publicize-form-hide"><?php esc_html_e( 'OK', 'jetpack' ); ?></a>
<input type="hidden" name="wpas[0]" value="1" />
</div>
<?php if ( ! $all_done ) : ?>
<div id="pub-connection-tests"></div>
<?php endif; ?>
<?php // #publicize-form
return ob_get_clean();
}
https://www.ryadel.com/en/wordpress-re-enable-publicize-already-published-posts-via-jetpack-publicize/ recommends hacking the UI template - but that will get overwritten every time you update the plugin.
https://cfxdesign.com/how-to-re-publicize-posts-with-jetpack/ has another approach - it adds functionality to remove the post meta data that Jetpack uses to determine that the post has already been published.
(And with the premium or professional plans, Jetpack apparently also offers that feature themselves.)