| @@ -9,8 +9,9 @@ | ||
| 9 | 9 | |
| 10 | 10 | namespace ThinkRank\Abilities\Content; |
| 11 | 11 | |
| 12 | 12 | use ThinkRank\Abilities\Ability_Base; |
| 13 | +use ThinkRank\SEO\Object_Redirect; | |
| 13 | 14 | |
| 14 | 15 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | 16 | exit; // Exit if accessed directly. |
| 16 | 17 | } |
| @@ -103,12 +104,17 @@ | ||
| 103 | 104 | [ 'status' => 404 ] |
| 104 | 105 | ); |
| 105 | 106 | } |
| 106 | 107 | |
| 108 | + $redirect = Object_Redirect::get( 'term', $term_id ); | |
| 109 | + | |
| 107 | 110 | $data = [ |
| 108 | 111 | 'title' => (string) get_term_meta( $term_id, '_thinkrank_seo_title', true ), |
| 109 | 112 | 'description' => (string) get_term_meta( $term_id, '_thinkrank_meta_description', true ), |
| 110 | 113 | 'canonical_url' => (string) get_term_meta( $term_id, '_thinkrank_canonical_url', true ), |
| 114 | + // Not term meta: the rule in Pro's redirections table is the value. | |
| 115 | + 'redirect_url' => $redirect['url'], | |
| 116 | + 'redirect_type' => $redirect['type'], | |
| 111 | 117 | 'focus_keyword' => (string) get_term_meta( $term_id, '_thinkrank_focus_keyword', true ), |
| 112 | 118 | 'robots_meta_enabled' => get_term_meta( $term_id, '_thinkrank_robots_meta_enabled', true ), |
| 113 | 119 | 'robots_meta' => $this->decode_json_field( get_term_meta( $term_id, '_thinkrank_robots_meta', true ) ), |
| 114 | 120 | 'advanced_robots_meta' => $this->decode_json_field( get_term_meta( $term_id, '_thinkrank_advanced_robots_meta', true ) ), |