get_rest_url(), ) ); // Frontend only scripts. // if ( ! is_admin() ) { // wp_register_script( // 'ugb-block-frontend-js', // plugins_url( 'dist/frontend_blocks.js', STACKABLE_FILE ), // apply_filters( 'stackable_frontend_js_dependencies', array() ), // STACKABLE_VERSION // ); // wp_localize_script( 'ugb-block-frontend-js', 'stackable', array( // 'restUrl' => get_rest_url(), // ) ); // } } /** * This is an earlier conditional css loader in the frontend so that we * can load the frontend styles in the head. This is to prevent CLS. * * This is a newer implementation of the * load_frontend_scripts_conditionally function. We don't remove the old * one to keep it as a fallback. * * @return void * * @since 3.0.7 */ public function load_frontend_scripts_conditionally_head() { // Only do this in the frontend. if ( $this->is_main_script_loaded || is_admin() ) { return; } // Only do this for singular posts. $post_id = get_the_ID(); if ( is_singular() && ! empty( $post_id ) ) { global $post; if ( ! empty( $post ) && ! empty( $post->post_content ) ) { // Check if we have a stackable block in the content. if ( stripos( $post->post_content, '