post_type ) { return; } wp_enqueue_script( 'eventwright-editor', EVWR_URL . 'assets/js/editor.js', array( 'wp-plugins', 'wp-editor', 'wp-edit-post', 'wp-element', 'wp-components', 'wp-data', 'wp-core-data', 'wp-i18n', 'wp-api-fetch', 'wp-compose' ), EVWR_VERSION, true ); wp_set_script_translations( 'eventwright-editor', 'eventwright' ); wp_localize_script( 'eventwright-editor', 'eventwrightEditor', array( 'siteTimezone' => eventwright_site_timezone_string(), 'timezones' => timezone_identifiers_list(), 'currency' => Settings::get( 'currency_symbol' ), 'weekStart' => (int) get_option( 'start_of_week', 1 ), 'rsvpDefault' => (bool) Settings::get( 'rsvp_default' ), 'attendeesUrl' => admin_url( 'edit.php?post_type=' . Post_Types::ATTENDEE . '&evwr_event=' ), ) ); wp_enqueue_style( 'eventwright-editor', EVWR_URL . 'assets/css/admin.css', array(), EVWR_VERSION ); } /** * New events start with RSVP on when the site default says so. * * @param int $post_id Post. * @param \WP_Post $post Post. * @param bool $update Update. */ public static function defaults_for_new( $post_id, $post, $update ) { if ( $update || 'auto-draft' !== $post->post_status ) { return; } if ( Settings::get( 'rsvp_default' ) ) { update_post_meta( $post_id, '_evwr_rsvp_enabled', true ); } } }