' ); $screen = get_current_screen(); $screen_id = isset( $screen->id ) ? $screen->id : ''; return apply_filters( 'ariafse_editor_localize', array( 'is_ablocks_plugin' => defined( 'ABLOCKS_VERSION' ), 'get_screen_id' => $screen_id, 'disable_sections' => get_disable_section_fields(), 'pluginStatus' => is_ablocks_plugin_status(), 'pluginSlug' => 'ablocks', 'nonce' => wp_create_nonce( 'wp_rest' ), 'ariafse_wp_version_higher_6_3' => $version_compare, 'ariafse_wp_version_higher_6_5' => is_wp_version_compatible( '6.5' ), 'activationUrl' => esc_url( add_query_arg( array( 'plugin_status' => 'all', 'paged' => '1', 'action' => 'activate', 'plugin' => rawurlencode( 'ablocks/ablocks.php' ), '_wpnonce' => wp_create_nonce( 'activate-plugin_ablocks/ablocks.php' ), ), admin_url( 'plugins.php' ) ) ), ) ); } /** * Enqueue Editor Scripts. */ function enqueue_editor_block_styles(): void { // Disable Core Block Patterns. remove_theme_support( 'core-block-patterns' ); $file_prefix = defined( 'ARIAFSE_DEBUG' ) && ARIAFSE_DEBUG ? '' : '.min'; $css_uri = get_uri() . 'assets/css/'; // Add support for block styles. add_theme_support( 'wp-block-styles' ); // Enqueue editor styles. /** @psalm-suppress UndefinedFunction */ // phpcs:ignore PossiblyFalseArgument, Generic.Commenting.DocComment.MissingShort -- Function exist in helpers.php if ( wp_version_compare( '6.2.99', '<=' ) ) { add_editor_style( $css_uri . 'duotone' . $file_prefix . '.css' ); } add_editor_style( $css_uri . 'editor' . $file_prefix . '.css' ); add_editor_style( $css_uri . 'gutenberg' . $file_prefix . '.css' ); } add_action( 'after_setup_theme', ARIAFSE_NS . 'enqueue_editor_block_styles' ); /** * Enqueue Editor Scripts. */ function aria_fse_setup(): void { /* * Make theme available for translation. * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfifteen * If you're building a theme based on aria-fse, use a find and replace * to change 'aria-fse' to the name of your theme in all the template files */ load_theme_textdomain( 'aria-fse', get_uri() . 'languages' ); } add_action( 'after_setup_theme', ARIAFSE_NS . 'aria_fse_setup' ); /** * Pattern categories. */ function pattern_categories(): void { register_block_pattern_category( 'pages', array( 'label' => esc_html__( 'Pages', 'aria-fse' ) ) ); register_block_pattern_category( 'contact', array( 'label' => esc_html__( 'Contact', 'aria-fse' ) ) ); register_block_pattern_category( 'pricing', array( 'label' => esc_html__( 'Pricing', 'aria-fse' ) ) ); } add_action( 'init', ARIAFSE_NS . 'pattern_categories' );