fix content for mec
All checks were successful
All checks were successful
This commit is contained in:
parent
7e8346cf7b
commit
e9446037a4
2 changed files with 10 additions and 2 deletions
|
@ -267,9 +267,9 @@ abstract class Event extends Post {
|
||||||
add_filter( 'activitypub_object_content_template', array( self::class, 'remove_ap_permalink_from_template' ), 2, 2 );
|
add_filter( 'activitypub_object_content_template', array( self::class, 'remove_ap_permalink_from_template' ), 2, 2 );
|
||||||
$excerpt = $this->retrieve_excerpt();
|
$excerpt = $this->retrieve_excerpt();
|
||||||
// BeforeFirstRelease: decide whether this should be a admin setting.
|
// BeforeFirstRelease: decide whether this should be a admin setting.
|
||||||
$fallback_to_content = true;
|
$fallback_to_content = false;
|
||||||
if ( is_null( $excerpt ) && $fallback_to_content ) {
|
if ( is_null( $excerpt ) && $fallback_to_content ) {
|
||||||
$excerpt = parent::get_content();
|
$excerpt = $this->get_content();
|
||||||
}
|
}
|
||||||
remove_filter( 'activitypub_object_content_template', array( self::class, 'remove_ap_permalink_from_template' ) );
|
remove_filter( 'activitypub_object_content_template', array( self::class, 'remove_ap_permalink_from_template' ) );
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,14 @@ final class Modern_Events_Calendar_Lite extends Event {
|
||||||
$this->mec_event = new MEC_Event( $wp_object );
|
$this->mec_event = new MEC_Event( $wp_object );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the content without the plugins rendered shortcodes.
|
||||||
|
*/
|
||||||
|
public function get_content(): string {
|
||||||
|
$content = wpautop( $this->wp_object->post_content );
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the end time from the event object.
|
* Get the end time from the event object.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue