// Yahweh Mission Dashboard Integration — WPCode snippet version // Paste this into a new PHP Snippet in WPCode, set to run "Auto Insert" / // "Everywhere", and activate it. Functionally identical to the plugin // version — just packaged as a snippet since this host strips .php files // out of uploaded plugin zips. if (!function_exists('ymi_get_api_url')) { function ymi_get_api_url() { return rtrim(get_option('ymi_dashboard_api_url', ''), '/'); } } // ---- Settings page: Settings -> Yahweh Mission ---- add_action('admin_menu', function () { add_options_page('Yahweh Mission Dashboard', 'Yahweh Mission', 'manage_options', 'yahweh-mission', 'ymi_render_settings_page'); }); add_action('admin_init', function () { register_setting('ymi_settings', 'ymi_dashboard_api_url', array( 'sanitize_callback' => 'esc_url_raw', 'default' => '', )); }); function ymi_render_settings_page() { if (!current_user_can('manage_options')) { return; } $api_url = get_option('ymi_dashboard_api_url', ''); ?>

Yahweh Mission Dashboard

Connects this site to the Yahweh Mission Dashboard so published children, gifts, and projects appear here automatically via the [ymi_children], [ymi_gift_catalog], and [ymi_child_profile] shortcodes.

The base URL where the Yahweh Mission Dashboard is deployed — no trailing slash.

Connection check

8)); if (is_wp_error($response)) { echo '

Could not reach the dashboard: ' . esc_html($response->get_error_message()) . '

'; } elseif (wp_remote_retrieve_response_code($response) === 200) { echo '

Connected — the dashboard responded successfully.

'; } else { echo '

Dashboard responded with HTTP ' . esc_html(wp_remote_retrieve_response_code($response)) . '.

'; } ?>
.ymi-children-grid,.ymi-gift-grid{--ymi-navy:#0b1e3d;--ymi-blue:#2454d9;--ymi-blue-soft:#e4ecfc;--ymi-sea:#1fa6c9;--ymi-grey:#64748b;--ymi-line:#dde3ea;display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:20px;margin:24px 0;} .ymi-child-card{display:flex;flex-direction:column;background:#fff;border:1px solid var(--ymi-line);border-radius:10px;overflow:hidden;text-decoration:none;color:inherit;transition:box-shadow .15s ease;} .ymi-child-card:hover{box-shadow:0 4px 16px rgba(11,30,61,.1);} .ymi-child-card__photo{aspect-ratio:1/1;background:var(--ymi-blue-soft);display:flex;align-items:center;justify-content:center;overflow:hidden;} .ymi-child-card__photo img{width:100%;height:100%;object-fit:cover;} .ymi-child-card__initial{font-size:2.5rem;font-weight:600;color:var(--ymi-blue);} .ymi-child-card__body{padding:14px 16px;} .ymi-child-card__name{margin:0 0 4px;font-size:1.05rem;color:var(--ymi-navy);} .ymi-child-card__meta{margin:0 0 8px;font-size:.85rem;color:var(--ymi-grey);} .ymi-child-card__bio{margin:0;font-size:.85rem;color:var(--ymi-navy);opacity:.8;} .ymi-child-profile{--ymi-navy:#0b1e3d;--ymi-blue:#2454d9;--ymi-blue-soft:#e4ecfc;--ymi-grey:#64748b;display:grid;grid-template-columns:minmax(220px,280px) 1fr;gap:32px;margin:24px 0;} .ymi-child-profile__photo{aspect-ratio:1/1;background:var(--ymi-blue-soft);border-radius:10px;display:flex;align-items:center;justify-content:center;overflow:hidden;} .ymi-child-profile__photo img{width:100%;height:100%;object-fit:cover;} .ymi-child-profile__cta{margin-top:20px;} .ymi-gift-card{background:#fff;border:1px solid var(--ymi-line);border-radius:10px;padding:18px 20px;display:flex;flex-direction:column;} .ymi-gift-card__category{font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--ymi-sea);font-weight:700;} .ymi-gift-card__name{margin:6px 0 8px;color:var(--ymi-navy);} .ymi-gift-card__description{flex:1;font-size:.88rem;color:var(--ymi-grey);margin:0 0 16px;} .ymi-gift-card__footer{display:flex;align-items:center;justify-content:space-between;gap:12px;} .ymi-gift-card__price{font-weight:700;color:var(--ymi-navy);} .ymi-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px 16px;border-radius:6px;background:var(--ymi-blue,#2454d9);color:#fff!important;text-decoration:none;font-weight:600;font-size:.9rem;} .ymi-btn--outline{background:transparent;border:1px solid var(--ymi-blue,#2454d9);color:var(--ymi-blue,#2454d9)!important;} .ymi-notice{background:#fdf6d8;border:1px solid #e8d98a;border-radius:6px;padding:10px 14px;font-size:.9rem;} .ymi-empty{color:#64748b;font-style:italic;} @media (max-width:640px){.ymi-child-profile{grid-template-columns:1fr;}} '; }); // ---- API client (cached) ---- if (!function_exists('ymi_api_get')) { function ymi_api_get($path, $cache_key, $ttl = 300) { $base = ymi_get_api_url(); if (empty($base)) { return new WP_Error('ymi_not_configured', 'The Yahweh Mission Dashboard URL has not been configured yet. Set it under Settings -> Yahweh Mission.'); } $cached = get_transient($cache_key); if ($cached !== false) { return $cached; } $response = wp_remote_get($base . $path, array('timeout' => 10)); if (is_wp_error($response)) { return $response; } if (wp_remote_retrieve_response_code($response) !== 200) { return new WP_Error('ymi_bad_response', 'The dashboard returned an unexpected response.'); } $data = json_decode(wp_remote_retrieve_body($response), true); if (!is_array($data)) { return new WP_Error('ymi_bad_json', 'The dashboard response could not be read.'); } set_transient($cache_key, $data, $ttl); return $data; } } if (!function_exists('ymi_not_configured_notice')) { function ymi_not_configured_notice() { if (current_user_can('manage_options')) { return '

The Yahweh Mission Dashboard is not connected yet. Configure it in Settings.

'; } return ''; } } if (!function_exists('ymi_error_notice')) { function ymi_error_notice($error) { if (current_user_can('manage_options')) { return '

Could not load content from the dashboard: ' . esc_html($error->get_error_message()) . '

'; } return ''; } } // ---- [ymi_children] ---- add_shortcode('ymi_children', function ($atts) { $atts = shortcode_atts(array('limit' => 0), $atts, 'ymi_children'); $children = ymi_api_get('/api/children?gender=either&country=all&minAge=1&maxAge=22', 'ymi_children_all'); if (is_wp_error($children)) { return $children->get_error_code() === 'ymi_not_configured' ? ymi_not_configured_notice() : ymi_error_notice($children); } if ((int) $atts['limit'] > 0) { $children = array_slice($children, 0, (int) $atts['limit']); } if (empty($children)) { return '

No children are currently available for sponsorship.

'; } ob_start(); ?>
<?php echo esc_attr($child['name']); ?>

yrs ·

''), $atts, 'ymi_child_profile'); $id = !empty($atts['id']) ? $atts['id'] : (isset($_GET['ymi_child']) ? sanitize_text_field(wp_unslash($_GET['ymi_child'])) : ''); if (empty($id)) { return '

No child specified.

'; } $api_url = ymi_get_api_url(); if (empty($api_url)) { return ymi_not_configured_notice(); } $cache_key = 'ymi_child_' . md5($id); $child = get_transient($cache_key); if ($child === false) { $response = wp_remote_get($api_url . '/api/children/' . rawurlencode($id), array('timeout' => 10)); if (is_wp_error($response)) { return ymi_error_notice($response); } if (wp_remote_retrieve_response_code($response) !== 200) { return '

This child profile is no longer available.

'; } $child = json_decode(wp_remote_retrieve_body($response), true); set_transient($cache_key, $child, 300); } if (!is_array($child)) { return '

This child profile is no longer available.

'; } ob_start(); ?>
<?php echo esc_attr($child['name']); ?>

yrs ·

Sponsor

already has a sponsor. Thank you!

get_error_code() === 'ymi_not_configured' ? ymi_not_configured_notice() : ymi_error_notice($gifts); } if (empty($gifts)) { return '

No gifts are available right now.

'; } $api_url = ymi_get_api_url(); ob_start(); ?>

Sponsor a Child

Content coming soon.

SPONSOR A CHILD

Give a Child the Chance to Learn, Grow, and Dream Again

Every child deserves more than survival. They deserve education, care, protection, encouragement, and the chance to believe that their future can be different.

Through Yahweh Mission International, your sponsorship helps support children who are facing poverty, hardship, and limited access to basic needs. Your gift can help provide school support, food, clothing, medical care, and the love and encouragement a child needs to move forward with hope.

When you sponsor a child, you are not simply making a donation. You are becoming part of a child’s journey.

Children will appear here soon — check back!

This is a title

Experienced and professionally trained cleaning specialists committed to delivering reliable and high-quality cleaning services..

This is a title

Experienced and professionally trained cleaning specialists committed to delivering reliable and high-quality cleaning services..

This is a title

Experienced and professionally trained cleaning specialists committed to delivering reliable and high-quality cleaning services..

This is a title

Experienced and professionally trained cleaning specialists committed to delivering reliable and high-quality cleaning services..

This is a title

Experienced and professionally trained cleaning specialists committed to delivering reliable and high-quality cleaning services..

This is a title

Experienced and professionally trained cleaning specialists committed to delivering reliable and high-quality cleaning services..

Everything You Need to Know About Sponsoring a Child

Child sponsorship is a long-term commitment to help a child living in poverty receive education, nutritious food, medical care, emotional support, and opportunities to build a brighter future. Your sponsorship allows Yahweh Mission International to provide consistent care while walking alongside the child and their family.

Yes. Your sponsorship is connected to a specific child, allowing you to follow their journey through updates, photographs, and personal communication whenever appropriate and in line with our child protection policies.

Your sponsorship helps provide essential support such as education, school supplies, nutritious meals, healthcare, clothing, spiritual encouragement, and family assistance where needed. Every child’s needs are different, so support is provided according to what will benefit the child most.

Yes. Sponsors receive regular updates that may include photographs, a personal letter from the child, progress reports, and, when available, a thank-you video from the child or our mission team.

Absolutely. We encourage sponsors to send messages of hope and encouragement. Every message is carefully reviewed and translated when necessary to ensure safe, meaningful communication.

KNOW MORE ABOUT US

Frequently Asked Questions