mirror of
https://gh.wpcy.net/https://github.com/CaptainCore/captaincore.git
synced 2026-04-22 20:45:45 +08:00
27 lines
738 B
PHP
Executable file
27 lines
738 B
PHP
Executable file
<?php
|
|
|
|
$arguments = array(
|
|
'post_type' => 'captcore_website',
|
|
'posts_per_page' => '-1',
|
|
);
|
|
|
|
$websites = get_posts( $arguments );
|
|
|
|
foreach ( $websites as $website ) {
|
|
|
|
$provider = get_post_meta( $website->ID, 'provider', true );
|
|
$address = get_post_meta( $website->ID, 'address', true );
|
|
|
|
if ( $provider == '' ) {
|
|
|
|
if ( strpos( $address, '.kinsta.' ) !== false ) {
|
|
echo 'Assigning kinsta to provider for ' . get_the_title( $website->ID ) . "\n";
|
|
update_post_meta( $website->ID, 'provider', 'kinsta' );
|
|
}
|
|
|
|
if ( strpos( $address, '.wpengine.com' ) !== false ) {
|
|
echo 'Assigning wpengine to provider for ' . get_the_title( $website->ID ) . "\n";
|
|
update_post_meta( $website->ID, 'provider', 'wpengine' );
|
|
}
|
|
}
|
|
}
|