コード例 #1
0
/**
* Add the input field to the form
*
* @param int $form_id
* @param null|int $post_id
* @param array $form_settings
*/
function delminco_render_user_country_code_hook($form_id, $post_id, $form_settings)
{
    $suplyer_country_code = get_user_meta($post_id, 'billing_country', 1);
    $country_array = country_array();
    //var_dump($suplyer_country_code);
    ?>

    <div class="wpuf-label">
        <label><?php 
    echo __('Country Name', 'deminco');
    ?>
</label>
    </div>
  
    <div class="wpuf-fields">
        <select name="billing_country"><?php 
    //echo esc_attr( $value );
    ?>
            <?php 
    foreach ($country_array as $key => $name) {
        if ($suplyer_country_code == $key) {
            echo '<option value="' . $key . '"selected >' . $name . '</option>';
        } else {
            echo '<option value="' . $key . '">' . $name . '</option>';
        }
    }
    ?>
        </select>
    </div>
    <?php 
}
コード例 #2
0
										</td>
										<td><a href="<?php 
        echo get_the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></td>
										<td><?php 
        the_time(get_option('date_format'));
        ?>
</td>
										<td>
											<?php 
        $user_id = get_the_author_ID();
        $country_array = country_array();
        $country_code = get_usermeta($user_id, 'billing_country', 1);
        echo '<span class="f16 country-flag"><span class="flag ' . strtolower($country_code) . '"></span>' . '  ' . $country_array[$country_code] . '</span>';
        ?>
										</td>
										<td><?php 
        echo $post->ID;
        ?>
</td>
									</tr>
								<?php 
    }
    ?>
							</tbody>
						</table>
					<?php