/**
  * Runs the yoast exporter class to possibly init the file download.
  */
 private function do_yoast_export()
 {
     check_admin_referer(WPSEO_Export::NONCE_ACTION, WPSEO_Export::NONCE_NAME);
     if (!current_user_can('manage_options')) {
         return;
     }
     $wpseo_post = filter_input(INPUT_POST, 'wpseo');
     $include_taxonomy = !empty($wpseo_post['include_taxonomy']);
     $export = new WPSEO_Export($include_taxonomy);
     if ($export->has_error()) {
         add_action('admin_notices', array($export, 'set_error_hook'));
     }
 }
Ejemplo n.º 2
0
/**
 * Create an export and return the URL
 */
function wpseo_get_export()
{
    $include_taxonomy = filter_input(INPUT_POST, 'include_taxonomy') === 'true';
    $export = new WPSEO_Export($include_taxonomy);
    wpseo_ajax_json_echo_die($export->get_results());
}
Ejemplo n.º 3
0
/**
 * Create an export and return the URL
 */
function wpseo_get_export()
{
    check_ajax_referer('wpseo-export');
    $include_taxonomy = WPSEO_Utils::filter_input(INPUT_POST, 'include_taxonomy') === 'true' ? true : false;
    $export = new WPSEO_Export($include_taxonomy);
    wpseo_ajax_json_echo_die($export->get_results());
}
Ejemplo n.º 4
0
/**
 * Create an export and return the URL
 */
function wpseo_get_export()
{
    if (!current_user_can('manage_options')) {
        die('-1');
    }
    $include_taxonomy = filter_input(INPUT_POST, 'include_taxonomy') === 'true';
    $export = new WPSEO_Export($include_taxonomy);
    wpseo_ajax_json_echo_die($export->get_results());
}