wp_insert_post()
.
To do this I’ve tested on 2 different filter hooks in my custom plugin. My debug logs show that the function is called & the template is being updated. (tribe_events_editor_default_template
& tribe_events_editor_default_classic_template
) It works fine when using the default “Add New” link.
However, I am still seeing the blocks created on my new Event & looking through the plugin code I cannot figure out why.
Here is my custom filter hook callback functions:
function wwg_events_editor_template( $template, $post_type, $args ) {
error_log( 'Postype: ' . $post_type );
if ( $post_type === Tribe__Events__Main::POSTTYPE ) {
error_log( 'Before: ' . print_r($template, TRUE) );
$template = [];
$template[] = [
'core/paragraph',
[
'placeholder' => __( 'Add Description...', 'the-events-calendar' ),
],
];
error_log( 'After: ' . print_r($template, TRUE) );
}
return $template;
}
add_filter( 'tribe_events_editor_default_template', 'wwg_events_editor_template', 500, 3 );
function wwg_events_class_editor_template( $template ) {
error_log( 'Postype: ' . $post_type );
if ( $post_type === Tribe__Events__Main::POSTTYPE ) {
error_log( 'Before: ' . print_r($template, TRUE) );
$template = [];
$template[] = [
'core/paragraph',
[
'placeholder' => __( 'Add Description...', 'the-events-calendar' ),
],
];
error_log( 'After: ' . print_r($template, TRUE) );
}
return $template;
}
add_filter( 'tribe_events_editor_default_classic_template', 'wwg_events_class_editor_template', 500 );
Here is what is generated on a new event post:
<!-- wp:tribe/event-datetime /-->
<!-- wp:tribe/featured-image /-->
<!-- wp:tribe/event-links /-->
<!-- wp:tribe/classic-event-details /-->
<!-- wp:tribe/event-venue /-->
<!-- wp:tribe/tickets --><div class="wp-block-tribe-tickets">
</div><!-- /wp:tribe/tickets -->
<!-- wp:tribe/rsvp /-->
<!-- wp:tribe/attendees /-->
]]>Also, is it ok to use past templates such as 2021 or 2022? Or is it always advised to use the most recent?
]]>Also, is it ok to use past templates such as 2021 or 2022? Or is it always advised to use the most recent?
]]>Also, is it ok to use past templates such as 2021 or 2022? Or is it always advised to use the most recent?
]]>Basically the “traccia il tuo ordine” and the links in the footer color are set to #444 but they should be white like all other email.
To solve this instead of using the default template i tried adding the email type
add_filter( 'viwec_accept_email_type', function ($email_types) {
$email_types[] = 'customer_partial_shipped_order';
return $email_types;
}, 9999 );
But it is not added to email types.
I revert back to the default template and set the a link color to white with custom css a{color: #ffffff !important}
But since the color is set in the style i think it is ignored. This is the css of “traccia il tuo ordine”
<a class="xmprfx_track-button" target="_blank" style="word-break: break-word; background: #005b9a; padding: 10px 15px; text-decoration: none; display: inline-block; border-radius: 20px; margin-top: 2px; text-align: center; min-height: 10px; font-size: 14px; color: #444;" bgcolor="#005b9a" rel="noopener noreferrer">Traccia il tuo ordine</a>
Hope to solve the problem
Best regards,
Massimo
How do I change which Ona Template is used as the ‘Default Template’ for Pages. It can be inconvenient to need to do this step for each newly created page.
For Example:
I wish for all Pages to use a ‘Default Template’ that points to ‘Header & Footer Only’ Template.
Thank you
Is there any way to set the Page Builder Full Width (Neve) for the Default template in the Page Attribute section?
Because sometimes wordpress automatic change it to this default template, and my site view is broken. If i change it back to Page Builder Full Width (Neve), everything will be fine.
Thanks
Ben
I would like to write a support question. After i posted, i noticed this is the review site. Sorry
Thanks
Ben