Tribe__Events__Aggregator__Record__Abstract::update_source_name( string $source_name )
Updates the source name on the import record and its parent (if the parent exists)
Contents
Parameters
- $source_name
-
(string) (Required) Source name to set on the import record.
Source
File: src/Tribe/Aggregator/Record/Abstract.php
public function update_source_name( $source_name ) {
// if we haven't received a source name, bail
if ( empty( $source_name ) ) {
return;
}
$this->update_meta( 'source_name', $source_name );
if ( empty( $this->post->post_parent ) ) {
return;
}
$parent_record = Tribe__Events__Aggregator__Records::instance()->get_by_post_id( $this->post->post_parent );
if ( tribe_is_error( $parent_record ) ) {
return;
}
$parent_record->update_meta( 'source_name', $source_name );
}