/** * Pass variables to js for use with the term-scraper * * @return array */ public function localize_term_scraper_script() { $term_id = filter_input(INPUT_GET, 'tag_ID'); $term = get_term_by('id', $term_id, $this->get_taxonomy()); $taxonomy = get_taxonomy($term->taxonomy); $term_formatter = new WPSEO_Metabox_Formatter(new WPSEO_Term_Metabox_Formatter($taxonomy, $term, WPSEO_Options::get_option('wpseo_titles'))); return $term_formatter->get_values(); }
/** * Pass variables to js for use with the post-scraper * * @return array */ public function localize_post_scraper_script() { $post = $this->get_metabox_post(); $permalink = ''; if (is_object($post)) { $permalink = get_sample_permalink($post->ID); $permalink = $permalink[0]; } $post_formatter = new WPSEO_Metabox_Formatter(new WPSEO_Post_Metabox_Formatter($post, WPSEO_Options::get_option('wpseo_titles'), $permalink)); return $post_formatter->get_values(); }