// 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(); ?>

Home

Content coming soon.

Trusted by Supporters Across the Globe

Turning Possibilities Into Opportunities For Every Child

The Yahweh Mission is a global nonprofit dedicated to breaking the cycle of poverty through child sponsorship, education, nutrition, and community development — anchored in faith and love.

Generosity That Reaches Real Lives
Every Gift Reaches the Field
I have seen where the giving truly goes — children learning, families finding their footing, a community beginning to believe in tomorrow. This is a mission that shows up and does the work.
Faith · Hope · Transformation
A Yahweh Mission Supporter

Where Possibilities Become Opportunities

About us

At Yahweh Mission, We Believe No Child Should Be Left Without Hope — and No Family Should Face Hardship Alone

We are a faith-rooted nonprofit reaching children and families in the places the world too often forgets — bringing education, daily care, and the kind of hope that changes a life from the inside out. What begins as a single act of giving becomes a lasting opportunity for someone who needs it most.

Rooted in the Community
Where It Matters

Our mission lives among the people it serves — listening, understanding, and meeting real needs with care that’s personal, consistent, and built to last.

Driven by Compassion
Faithful in Every Effort

Every program we run is guided by a simple conviction: that kindness, when given freely, can transform a child’s future and lift an entire community along with it.

WHAT SETS US APART

A Mission Built on Trust, Compassion, and Real Impact

We bring together honest stewardship, faithful people, and care delivered where it’s needed most — so that every act of giving becomes a lasting change in someone’s life.

Transparent &Trustworthy

We hold ourselves accountable for every gift entrusted to us, carrying out our work with honesty, integrity, and deep respect for those who give and those we serve.

Faithful With Every Gift
Compassion Without Borders

Wherever a child is overlooked or a family is struggling, our heart is to follow. Our mission is not bound by distance — it is driven by need.

Wherever Help Is Needed
Rooted in Real Communities

We don’t serve from afar. We work on the ground, among the people we care for, building relationships and change that truly lasts.

Present Where It Matters
Ready to Turn Your Compassion Into Lasting Change?
SERVICES

The Ways We Bring Hope to Those Who Need It Most

Every program we run is built around a single belief — that real change begins when a child is given the chance to learn, grow, and dream beyond their circumstances.

01.
Education for Every Child

We open the door to learning for children who would otherwise be left behind, equipping them with the knowledge, confidence, and opportunity to shape a future of their own.

02.
Care for Families in Need

Hardship rarely touches a child alone. We walk alongside whole families — meeting urgent needs and helping them find stable, lasting footing.

03.
Hope That Reaches the Ground

Our work happens where it's needed, not from a distance. We serve communities directly and faithfully, turning generosity into care that people can see and feel.

Your Kindness Can Help a Child Rise Above Hardship

A consistent gift gives a child more than relief — it gives them the steady care, education, and hope they need to build a future beyond the circumstances they were born into.

See How Your Giving Helps →