/** * Build the options page for mapping fields for the NPRML fields pushed with a post to local custom meta fields. */ function nprstory_add_field_mapping_page() { ?> <form action="options.php" method="post"> <div>Use this page to map your custom WordPress Meta fields to fields sent the NPR API. <P>Clicking the <strong>Use Custom Settings</strong> checkbox will enable these mappings. If you wish to use the default mapping for a field, select — default — and we will use the obvious WordPress field. </div> <p> <div>Select for the Meta fields for the <strong> <?php echo nprstory_get_push_post_type(); ?> </strong> post type</div> <?php settings_fields('ds_npr_api_push_mapping'); //do_settings_section('ds_npr_api_push_mapping'); do_settings_sections('ds_npr_api_push_mapping'); ?> <input name="Submit" type="submit" value="<?php esc_attr_e('Save Changes'); ?> " /> </form> <?php }
/** * callback for byline mapping */ function nprstory_api_mapping_byline_callback() { $push_post_type = nprstory_get_push_post_type(); $keys = nprstory_get_post_meta_keys($push_post_type); nprstory_show_keys_select('ds_npr_api_mapping_byline', $keys); }
function test_nprstory_get_push_post_type() { $ret = nprstory_get_push_post_type(); $this->assertEquals('post', $ret); # Should return the value of ds_npr_push_post_type option if it is set update_option('ds_npr_push_post_type', 'test_post'); $ret = nprstory_get_push_post_type(); $this->assertEquals($ret, 'test_post'); }