コード例 #1
0
ファイル: admin-custom.php プロジェクト: eferrao/sp-wordpress
function colabsthemes_metabox_create($post, $callback)
{
    global $post;
    $template_to_show = $callback['args'];
    $colabs_metaboxes = get_option('colabs_custom_template');
    $seo_metaboxes = get_option('colabs_custom_seo_template');
    if (empty($seo_metaboxes) and 'seo' == $template_to_show) {
        return;
    }
    if (get_option('seo_colabs_hide_fields') != 'true' and 'seo' == $template_to_show) {
        $colabs_metaboxes = $seo_metaboxes;
    }
    $output = colabs_custom_meta_generator($post, $colabs_metaboxes);
    echo $output;
}
コード例 #2
0
function colabs_display_meta_box($post)
{
    global $post, $property_details, $key;
    ?>
	
  <div class="panel-wrap">	
    <div class="form-wrap">
      <?php 
    wp_nonce_field('colabs_property_details_nounce', $key . '_wpnonce', false, true);
    if ($terms = wp_get_object_terms($post->ID, 'property_status')) {
        $property_status = sanitize_title(current($terms)->slug);
    } else {
        $property_status = apply_filters('default_property_status', 'sale');
    }
    $property_status_selector = apply_filters('property_status_selector', array('sale' => __('For Sale', 'colabsthemes'), 'rent' => __('For Rent', 'colabsthemes'), 'sold' => __('Recently Sold', 'colabsthemes'), 'not-sale' => __('Not for Sale', 'colabsthemes')), $property_status);
    $type_box = '';
    foreach ($property_status_selector as $value => $label) {
        $type_box .= '<input type="radio" name="property-status" class="colabs_input_radio" value="' . esc_attr($value) . '" ' . checked($property_status, $value, false) . '>';
        $type_box .= '<span style="display:inline" class="colabs_input_radio_desc">' . esc_html($label) . '</span>';
        $type_box .= '<div class="colabs_spacer"></div>';
    }
    ?>
      <table class="colabs_metaboxes_table">
        <tbody>
        <tr>		
          <th class="colabs_metabox_names"><label for="property-status"><?php 
    _e('Status', 'colabsthemes');
    ?>
</label></th>
          <td><?php 
    echo $type_box;
    ?>
</td>
        </tr>
        <tr class="rent" style="display:none;">		
          <th class="colabs_metabox_names"><label for="price_period"><?php 
    _e('Price Period', 'colabsthemes');
    ?>
</label></th>
          <td>
            <select name="property_price_periode" id="colabsthemes_property_price_periode" class="colabs_input_select">
              <option value="day" <?php 
    selected(get_post_meta($post->ID, 'property_price_periode', true), 'day', true);
    ?>
><?php 
    _e('Day', 'colabsthemes');
    ?>
</option>
              <option value="month" <?php 
    selected(get_post_meta($post->ID, 'property_price_periode', true), 'month', true);
    ?>
><?php 
    _e('Month', 'colabsthemes');
    ?>
</option>
              <option value="year" <?php 
    selected(get_post_meta($post->ID, 'property_price_periode', true), 'year', true);
    ?>
><?php 
    _e('Year', 'colabsthemes');
    ?>
</option>
            </select>
            <span class="colabs_metabox_desc description"><?php 
    _e('Property price periode only for rent status.', 'colabsthemes');
    ?>
</span></td>
        </tr>
        </tbody>
      </table>  
      <?php 
    echo colabs_custom_meta_generator($post, $property_details);
    ?>
    
    </div>
  </div>	
	<?php 
}