Exemplo n.º 1
0
function deseret_connect_actions_handler()
{
    global $wpdb;
    if (isset($_GET['connect'])) {
        deseret_connect_connect($_GET['connect']);
    }
    if (isset($_GET['disconnect'])) {
        deseret_connect_disconnect($_GET['disconnect']);
    }
    if (isset($_GET['action']) && $_GET['action'] == 'run-now') {
        deseret_connect_cron_hook();
        $redirect = admin_url('admin.php?page=deseret_connect-config&success=true');
        wp_redirect($redirect);
    }
    if (isset($_POST['settings'])) {
        $deseret_connect_opts = get_option(DESERET_CONNECT_OPTIONS);
        $deseret_connect_opts['pending'] = $_POST['pending'];
        $deseret_connect_opts['api_key'] = $_POST['api_key'];
        $deseret_connect_opts['author_name'] = $_POST['author_name'];
        $deseret_connect_opts['post_type'] = $_POST['post_type'];
        $deseret_connect_opts['include_canonical'] = $_POST['include_canonical'];
        update_option(DESERET_CONNECT_OPTIONS, $deseret_connect_opts);
        wp_redirect(admin_url('admin.php?page=deseret_connect-config&updated=true'));
    }
}
Exemplo n.º 2
0
function deseret_connect_unix_cron()
{
    deseret_connect_cron_hook();
}