| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- // Register Newsletter Custom Post Type
- require 'tsu_newsletter_custom_post.php';
- // Create Endpoint for Ajax Request with email data from Newsletter
- require 'tsu_newsletter_create_api_endpoint.php';
- // i18n strings
- function lang_strings() {
- do_action('wpml_register_single_string', 'aiac', 'Wprowadź poprawny adres e-mail.', 'Wprowadź poprawny adres e-mail.', false, 'pl');
- do_action('wpml_register_single_string', 'aiac', 'Adres e-mail...', 'Adres e-mail...', false, 'pl');
- do_action('wpml_register_single_string', 'aiac', 'ZAPISUJĘ SIĘ', 'ZAPISUJĘ SIĘ', false, 'pl');
- do_action('wpml_register_single_string', 'aiac', 'Nie udało się nawiązać połączenia.', 'Nie udało się nawiązać połączenia.', false, 'pl');
- }
- add_action('init', 'lang_strings');
- // Register Custom Block Category
- add_filter( 'block_categories_all', function($categories) {
-
- // Set Category Slug
- $new_slug = 'tsu-category';
- // Set Category Title
- $new_title = 'To się uda';
- $has_category = false;
- foreach($categories as $category) {
- if($category === [ 'slug' => $new_slug, 'title' => $new_title]) {
- $has_category = true;
- }
- }
- if(!$has_category) {
- $categories[] = array(
- 'slug' => $new_slug,
- 'title' => $new_title
- );
- };
-
- return $categories;
- });
- // Register Newsletter Custom Block
- add_action( 'init', 'add_newsletter_block' );
- function add_newsletter_block() {
- register_block_type( __DIR__ . '/build' );
- }
|