function test_nprstory_get_pull_post_type() { $post_type = DS_NPR_API::nprstory_get_pull_post_type(); $this->assertEquals('post', $post_type); update_option('ds_npr_pull_post_type', 'test_post_type'); $post_type = DS_NPR_API::nprstory_get_pull_post_type(); $this->assertEquals('test_post_type', $post_type); }
function ds_npr_bulk_action_update_dropdown() { $pull_post_type = DS_NPR_API::ds_npr_get_pull_post_type(); global $post_type; if ($post_type == $pull_post_type) { ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('<option>').val('updateNprStory').text('<?php _e('Update NPR Story'); ?> ').appendTo("select[name='action']"); jQuery('<option>').val('updateNprStory').text('<?php _e('Update NPR Story'); ?> ').appendTo("select[name='action2']"); }); </script> <?php } }
function nprstory_api_get_multi_settings_callback() { $run_multi = get_option('dp_npr_query_run_multi'); if ($run_multi) { DS_NPR_API::nprstory_cron_pull(); } //change the cron timer if (wp_next_scheduled('npr_ds_hourly_cron')) { wp_clear_scheduled_hook('npr_ds_hourly_cron'); } nprstory_error_log('NPR Story API plugin: updating the npr_ds_hourly_cron event timer'); wp_schedule_event(time(), 'ds_interval', 'npr_ds_hourly_cron'); }