' . esc_html__( 'ADStn Auto Poster', 'adstn-auto-poster' ) . '',
array( $this, 'render_meta_box' ),
$post_type,
'side',
'high'
);
}
}
/**
* Render Metabox HTML.
*
* @param WP_Post $post
*/
public function render_meta_box( $post ) {
wp_nonce_field( 'adstn_metabox_nonce_action', 'adstn_metabox_nonce' );
$settings = get_option( 'adstn_settings', array() );
$api_client = new ADStn_API_Client( $settings );
$is_connected = $api_client->is_connected();
$auto_publish_meta = get_post_meta( $post->ID, '_adstn_auto_publish', true );
// Default to checked (1) if not set
$auto_publish = ( '' === $auto_publish_meta || '1' === $auto_publish_meta );
$custom_message = get_post_meta( $post->ID, '_adstn_custom_message', true );
$is_published = get_post_meta( $post->ID, '_adstn_published', true );
$published_at = get_post_meta( $post->ID, '_adstn_published_at', true );
$last_error = get_post_meta( $post->ID, '_adstn_last_error', true );
$connected_user = isset( $settings['connected_user'] ) ? $settings['connected_user'] : array();
?>