- Timestamp:
- 03/29/2020 04:27:09 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/classes/class-bp-activity-activity.php
r12586 r12604 269 269 } else { 270 270 if ( empty( $this->component ) ) { 271 $this->errors->add( 'bp_activity_missing_component' );271 $this->errors->add( 'bp_activity_missing_component', __( 'You need to define a component parameter to insert activity.', 'buddypress' ) ); 272 272 } else { 273 $this->errors->add( 'bp_activity_missing_type' );273 $this->errors->add( 'bp_activity_missing_type', __( 'You need to define a type parameter to insert activity.', 'buddypress' ) ); 274 274 } 275 276 return $this->errors; 277 } 278 } 279 280 /** 281 * Use this filter to make the content of your activity required. 282 * 283 * @since 6.0.0 284 * 285 * @param bool $value True if the content of the activity type is required. 286 * False otherwise. 287 * @param string $type The type of the activity we are about to insert. 288 */ 289 $type_requires_content = (bool) apply_filters( 'bp_activity_type_requires_content', $this->type === 'activity_update', $this->type ); 290 if ( $type_requires_content && ! $this->content ) { 291 if ( 'bool' === $this->error_type ) { 292 return false; 293 } else { 294 $this->errors->add( 'bp_activity_missing_content', __( 'Please enter some content to post.', 'buddypress' ) ); 275 295 276 296 return $this->errors;
Note: See TracChangeset
for help on using the changeset viewer.