コード例 #1
0
function herocreative_rentcafe_options_page()
{
    if (!current_user_can('manage_options')) {
        wp_die('You do not have suggicient permissions to access this page.');
    }
    global $plugin_url;
    global $options;
    global $display_json;
    if (isset($_POST['herocreative_form_submitted'])) {
        $hidden_field = esc_html($_POST['herocreative_form_submitted']);
        if ($hidden_field == 'Y') {
            $herocreative_companycode = esc_html($_POST['herocreative_companycode']);
            $herocreative_propertycode = esc_html($_POST['herocreative_propertycode']);
            $herocreative_data = herocreative_rentcafe_get_data($herocreative_companycode, $herocreative_propertycode);
            $options['herocreative_companycode'] = $herocreative_companycode;
            $options['herocreative_propertycode'] = $herocreative_propertycode;
            $options['herocreative_data'] = $herocreative_data;
            update_option('herocreative_data', $options);
        }
    }
    $options = get_option('herocreative_rentcafe');
    if ($options != '') {
        $herocreative_companycode = $options['herocreative_companycode'];
        $herocreative_proprtycode = $options['herocreative_propertycode'];
        $herocreative_data = $options['herocreative_data'];
    }
    require 'inc/options-page-wrapper.php';
}
コード例 #2
0
function rentcafe_shortcode($atts)
{
    $rentcafe_company_code = get_option('rentcafe_company_code');
    $rentcafe_property_code = get_option('rentcafe_property_code');
    $property_data = herocreative_rentcafe_get_data($rentcafe_company_code, $rentcafe_property_code);
    herocreative_rent_cafe_css_js();
    ob_start();
    include sprintf('%s/includes/rentcafe-template.php', dirname(__FILE__));
    return ob_get_clean();
}