Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Subscribe to topics not send email

@liderxlt

Participant

Update with more information, I am using the wpallimport plugin, it allows to use PHP functions.

Which allow to add hooks before, during and after importing.
All the information here >> http://www.wpallimport.com/documentation/advanced/action-reference/

<?php

add_action( 'pmxi_saved_post', 'soflyy_forum_data', 10, 3 );

function soflyy_forum_data( $post_id, $xml_record, $is_update ) {
	$exped = array('1','3','5','7','9','11');//ID OF THE FILE OF TOPIC
	$actualiz = array('2','4','6','8','10','12');//ID OF THE FILE OF REPLY
	$import_id = ( isset( $_GET['id'] ) ? $_GET['id'] : ( isset( $_GET['import_id'] ) ? $_GET['import_id'] : 'new' ) );

	if ( in_array($import_id,$exped) ) {
		// Topics import - 1 esel id de la importacion
		$parent_forum = get_post_meta( $post_id, '_bbp_forum_id', true );
		if ( $parent_forum != 0 ) {
			$args = array(
				'ID' => $post_id,
				'post_parent' => $parent_forum
				);
			wp_update_post( $args );
			update_post_meta( $post_id, '_bbp_topic_id', $post_id );
			update_post_meta( $post_id, 'post_alter_id', $post_id );
			update_post_meta( $post_id, '_bbp_last_active_time', date( "Y-m-d H:i:s", time() ) );
		}
	} elseif ( in_array($import_id,$actualiz) ) {
		// Replies import - 2 esel id de la importacion
		$old_topic_id = get_post_meta( $post_id, '_bbp_topic_id', true );
		$post = get_posts( array(
			'post_type' => 'topic',
			'meta_key' => '_old_topic_id',
			'meta_value' => $old_topic_id
			) );
		if ( $post ) {
			$new_topic_id = $post[0]->ID;
			$args = array(
				'ID' => $post_id,
				'post_parent' => $new_topic_id
				);
			wp_update_post( $args );
			update_post_meta( $post_id, '_bbp_topic_id', $new_topic_id );
			update_post_meta( $post_id, '_edit_last', 1 );
			
			//wp_update_post( $post_id,'post_parent',$new_topic_id );
		}
	}
}
?>

I have tried adding hooks like

add_action( 'pmxi_update_post_meta','bbp_notify_subscribers',10,3);
add_action( 'bbp_new_reply','bbp_notify_topic_subscribers', 10, 3 );
add_action( 'bbp_new_reply','bbp_notify_topic_subscribers', 10, 3 );

But without success.

I hope this information is useful.

regards…

Skip to toolbar