コード例 #1
0
ファイル: type.post_type.php プロジェクト: pcuervo/odc
    function axiom_post_type_show_meta_box()
    {
        global $post, $AXIOM_GLOBALS;
        $post_type = axiom_admin_get_current_post_type();
        $override_key = axiom_get_override_key($post_type, 'post_type');
        // Use nonce for verification
        echo '<input type="hidden" name="meta_box_post_nonce" value="' . esc_attr(wp_create_nonce(basename(__FILE__))) . '" />';
        echo '<input type="hidden" name="meta_box_post_type" value="' . esc_attr($post_type) . '" />';
        $custom_options = apply_filters('axiom_filter_post_load_custom_options', get_post_meta($post->ID, 'post_custom_options', true), $post_type, $post->ID);
        $mb = $AXIOM_GLOBALS['post_meta_box'];
        $post_options = array_merge($AXIOM_GLOBALS['options'], $mb['fields']);
        ?>
		
		<script type="text/javascript">
			jQuery(document).ready(function() {
				// Prepare global values for the review procedure
				AXIOM_GLOBALS['ajax_url']	= "<?php 
        echo admin_url('admin-ajax.php');
        ?>
";
				AXIOM_GLOBALS['ajax_nonce']	= "<?php 
        echo wp_create_nonce('ajax_nonce');
        ?>
";
			});
		</script>
		
		<?php 
        do_action('axiom_action_post_before_show_meta_box', $post_type, $post->ID);
        axiom_options_page_start(array('data' => $post_options, 'add_inherit' => true, 'show_page_layout' => false, 'override' => $override_key));
        foreach ($post_options as $id => $option) {
            if (!isset($option['override']) || !in_array($override_key, explode(',', $option['override']))) {
                continue;
            }
            $option = apply_filters('axiom_filter_post_show_custom_field_option', $option, $id, $post_type, $post->ID);
            $meta = isset($custom_options[$id]) ? apply_filters('axiom_filter_post_show_custom_field_value', $custom_options[$id], $option, $id, $post_type, $post->ID) : '';
            do_action('axiom_action_post_before_show_custom_field', $post_type, $post->ID, $option, $id, $meta);
            axiom_options_show_field($id, $option, $meta);
            do_action('axiom_action_post_after_show_custom_field', $post_type, $post->ID, $option, $id, $meta);
        }
        axiom_options_page_stop();
        do_action('axiom_action_post_after_show_meta_box', $post_type, $post->ID);
        ?>
		</div>
		<?php 
    }
コード例 #2
0
ファイル: core.options.php プロジェクト: pcuervo/odc
 function axiom_options_page()
 {
     global $AXIOM_GLOBALS;
     axiom_options_page_start();
     foreach ($AXIOM_GLOBALS['to_data'] as $id => $field) {
         axiom_options_show_field($id, $field);
     }
     axiom_options_page_stop();
 }
コード例 #3
0
ファイル: type.taxonomy.php プロジェクト: pcuervo/odc
    function axiom_taxonomy_show_custom_fields($tax_obj = null)
    {
        global $AXIOM_GLOBALS;
        ?>
  
		<table border="0" cellpadding="0" cellspacing="0" class="form-table">
		<tr class="form-field" valign="top">  
			<td span="2">
		<div class="section section-info ">
			<h3 class="heading"><?php 
        _e('Custom settings for this taxonomy (and nested):', 'axiom');
        ?>
</h3>
			<div class="option">
				<div class="controls">
					<div class="info">
						<?php 
        _e('Select parameters for showing posts from this taxonomy and all nested taxonomies.', 'axiom');
        ?>
<br />
						<?php 
        _e('Attention: In each nested taxonomy you can override this settings.', 'axiom');
        ?>
					</div>
				</div>
			</div>
		</div>
		<?php 
        $tax_type = is_object($tax_obj) ? $tax_obj->taxonomy : $tax_obj;
        $override_key = axiom_get_override_key($tax_type, 'taxonomy');
        // Use nonce for verification
        echo '<input type="hidden" name="meta_box_taxonomy_nonce" value="' . esc_attr(wp_create_nonce(basename(__FILE__))) . '" />';
        echo '<input type="hidden" name="meta_box_taxonomy_type" value="' . esc_attr($tax_type) . '" />';
        $custom_options = axiom_taxonomy_load_custom_options($tax_obj, $tax_type);
        do_action('axiom_action_taxonomy_before_show_meta_box', $tax_type, $tax_obj);
        axiom_options_page_start(array('data' => $AXIOM_GLOBALS['options'], 'add_inherit' => true, 'show_page_layout' => false, 'override' => $override_key));
        foreach ($AXIOM_GLOBALS['options'] as $id => $option) {
            if (!isset($option['override']) || !in_array($override_key, explode(',', $option['override']))) {
                continue;
            }
            $option = apply_filters('axiom_filter_taxonomy_show_custom_field_option', $option, $id, $tax_type, $tax_obj);
            $meta = isset($custom_options[$id]) ? apply_filters('axiom_filter_taxonomy_show_custom_field_value', $custom_options[$id], $option, $id, $tax_type, $tax_obj) : '';
            do_action('axiom_action_taxonomy_before_show_custom_field', $tax_type, $tax_obj, $option, $id, $meta);
            axiom_options_show_field($id, $option, $meta);
            do_action('axiom_action_taxonomy_after_show_custom_field', $tax_type, $tax_obj, $option, $id, $meta);
        }
        axiom_options_page_stop();
        do_action('axiom_action_taxonomy_after_show_meta_box', $tax_type, $tax_obj);
        ?>
			</td>
		</tr>
		</table>
		<?php 
    }