Filter uncanny-automator-pro

peepso_activity_post_content

Filters the content of a PeepSo activity post before it's displayed.

add_filter( 'peepso_activity_post_content', $callback, 10, 2 );

Description

Filters the content of an activity post in PeepSo before it's saved. Developers can modify the activity post's text, add custom formatting, or perform other content manipulations. This hook fires after the initial content is prepared but before the post is updated in the database.


Usage

add_filter( 'peepso_activity_post_content', 'your_function_name', 10, 2 );

Parameters

$content (mixed)
This parameter contains the content of the activity post that is being filtered.
$id (mixed)
This parameter holds the content of the activity post that will be displayed or processed.

Return Value

The filtered value.


Examples

/**
 * Example filter for peepso_activity_post_content.
 * This filter appends a disclaimer to the end of any PeepSo activity post
 * created by Uncanny Automator.
 */
add_filter(
	'peepso_activity_post_content',
	function( $content, $id ) {
		// Check if the post is an activity post and not some other post type.
		// In a real scenario, you might want to do more robust checks based on $id
		// or other available context if PeepSo provides it.
		if ( ! is_string( $content ) || empty( $content ) ) {
			return $content; // Return original content if it's not a string or empty
		}

		// Append a simple disclaimer.
		$disclaimer = '<p><small>This post was automatically generated by Uncanny Automator.</small></p>';
		$content   .= $disclaimer;

		return $content;
	},
	10, // Priority
	2  // Accepted args
);

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

uncanny-automator-pro/src/integrations/peepso/actions/peepso-createactivitypost.php:176

return;
		}

		if ( 1 === absint( $a_act_data['act_module_id'] ) ) {
			update_user_meta( $user_id, 'peepso_last_used_post_privacy', $privacy );
		}

		$filtered_content = apply_filters( 'peepso_activity_post_content', $content, $id );
		wp_update_post(
			array(
				'ID'           => $id,
				'post_content' => $filtered_content,
			)
		);


Scroll to Top