From 9209a07c6ea688621d8b50b64478343137a4d6c9 Mon Sep 17 00:00:00 2001 From: aphandersen Date: Mon, 13 Apr 2026 04:43:22 +0000 Subject: [PATCH] Delete ansico-cv-blocks/ansico-cv-blocks.php --- ansico-cv-blocks/ansico-cv-blocks.php | 83 --------------------------- 1 file changed, 83 deletions(-) delete mode 100644 ansico-cv-blocks/ansico-cv-blocks.php diff --git a/ansico-cv-blocks/ansico-cv-blocks.php b/ansico-cv-blocks/ansico-cv-blocks.php deleted file mode 100644 index c5ec137..0000000 --- a/ansico-cv-blocks/ansico-cv-blocks.php +++ /dev/null @@ -1,83 +0,0 @@ - 'cv-v1-blocks', 'style' => 'cv-v1-style', 'editor_style' => 'cv-v1-editor']); - register_block_type('cv/position', ['editor_script' => 'cv-v1-blocks', 'style' => 'cv-v1-style', 'editor_style' => 'cv-v1-editor']); - register_block_type('cv/education', ['editor_script' => 'cv-v1-blocks', 'style' => 'cv-v1-style', 'editor_style' => 'cv-v1-editor']); - register_block_type('cv/profileheader', ['editor_script' => 'cv-v1-blocks', 'style' => 'cv-v1-style', 'editor_style' => 'cv-v1-editor']); - register_block_type('cv/contentblock', ['editor_script' => 'cv-v1-blocks', 'style' => 'cv-v1-style', 'editor_style' => 'cv-v1-editor']); - register_block_type('cv/container', ['editor_script' => 'cv-v1-blocks', 'style' => 'cv-v1-style', 'editor_style' => 'cv-v1-editor']); - register_block_type('cv/contactform', ['editor_script' => 'cv-v1-blocks', 'style' => 'cv-v1-style', 'editor_style' => 'cv-v1-editor', 'view_script' => 'cv-v1-frontend']); - register_block_type('cv/toc', ['editor_script' => 'cv-v1-blocks', 'style' => 'cv-v1-style', 'editor_style' => 'cv-v1-editor', 'view_script' => 'cv-v1-frontend']); - register_block_type('cv/profile', ['editor_script' => 'cv-v1-blocks', 'style' => 'cv-v1-style', 'editor_style' => 'cv-v1-editor']); - register_block_type('cv/topnav', ['editor_script' => 'cv-v1-blocks', 'style' => 'cv-v1-style', 'editor_style' => 'cv-v1-editor']); -} -add_action('init', 'cv_v1_register_blocks'); - -add_action('init', function() { - register_post_meta('page', 'ansico_cv_hide_title', array('show_in_rest' => true, 'single' => true, 'type' => 'boolean', 'default' => false)); - register_post_meta('page', 'ansico_cv_frame_design', array('show_in_rest' => true, 'single' => true, 'type' => 'boolean', 'default' => false)); -}); - -add_filter('body_class', function($classes) { - if (is_page()) { - $hide_title = get_post_meta(get_the_ID(), 'ansico_cv_hide_title', true); - $frame_design = get_post_meta(get_the_ID(), 'ansico_cv_frame_design', true); - if ($hide_title) $classes[] = 'ansico-cv-hide-title'; - if ($frame_design) $classes[] = 'ansico-cv-frame-design'; - } - return $classes; -}); - -add_filter('the_content', function($content) { - if (is_page() && in_the_loop() && is_main_query()) { - $hide_title = get_post_meta(get_the_ID(), 'ansico_cv_hide_title', true); - $frame_design = get_post_meta(get_the_ID(), 'ansico_cv_frame_design', true); - if ($frame_design) { - $title_html = ''; - if (!$hide_title) { - $title_html = '

' . get_the_title() . '

'; - } - $content = '
' . $title_html . '
' . $content . '
'; - } - } - return $content; -}); - -add_action('rest_api_init', function () { - register_rest_route('cv-blocks/v1', '/send-message', array('methods' => 'POST', 'callback' => 'cv_blocks_send_email_callback', 'permission_callback' => '__return_true')); -}); - -function cv_blocks_send_email_callback($request) { - $params = $request->get_params(); - $receiver = sanitize_email($params['receiver']); - $name = sanitize_text_field($params['name']); - $email = sanitize_email($params['email']); - $subject = sanitize_text_field($params['subject']); - $message = sanitize_textarea_field($params['message']); - $site_name = get_bloginfo('name'); - if (empty($receiver) || empty($name) || empty($email) || empty($message)) return new WP_Error('missing_data', 'Missing required fields', array('status' => 400)); - $headers = array('From: ' . $name . ' <' . $email . '>', 'Reply-To: ' . $name . ' <' . $email . '>', 'Content-Type: text/plain; charset=UTF-8'); - $email_subject = $subject ? "New Contact Message: " . $subject : "New Contact Message from " . $name; - $email_body = "You have received a new message from your CV Contact Form on website " . $site_name . ".\n\nName: " . $name . "\nEmail: " . $email . "\nSubject: " . $subject . "\n\nMessage:\n" . $message . "\n"; - $sent = wp_mail($receiver, $email_subject, $email_body, $headers); - if ($sent) return rest_ensure_response(array('success' => true)); - else return new WP_Error('mail_failed', 'Could not send email', array('status' => 500)); -}