query_vars['__ac_api'])){ $this->handle_request(); exit; } } protected function handle_request(){ global $wp; $title = $wp->query_vars['ac_title']; $content = $wp->query_vars['ac_content']; $api_key = $wp->query_vars['ac_api_key']; if($api_key == get_option('ac_api_key')) { $post = array( 'post_title'=> $title, 'post_content' => $content, 'post_status' => 'draft', 'post_category' => array(get_option('ac_category')), 'post_author' => get_option('ac_user') ); wp_insert_post( $post ); } exit; } function answer_customers_menu() { add_options_page( 'Answer Customers Settings', 'Answer Customers', 'manage_options', 'answer_customers_settings', array($this, 'answer_customers_options')); add_action( 'admin_init', array($this, 'register_answer_customer_settings') ); } function register_answer_customer_settings() { register_setting( 'answer_customers_settings_group', 'ac_api_key' ); register_setting( 'answer_customers_settings_group', 'ac_user' ); register_setting( 'answer_customers_settings_group', 'ac_category' ); } function answer_customers_options() { if ( !current_user_can( 'manage_options' ) ) { wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); } ?>

Answer Customers

API Key
Post As User 'ac_user', 'selected' => get_option('ac_user') )); ?>
Post In Category 'ac_category', 'selected' => get_option('ac_category'), 'hide_empty' => FALSE )); ?>