Skip to content

Commit

Permalink
Start of WPSEO_Replace_Vars class set-up
Browse files Browse the repository at this point in the history
-> Deprecate functions only used by the replace function and move them to the class
-> Move related help texts to the class
-> Add method to register help texts for additional variables
  • Loading branch information
jrfnl committed May 23, 2014
1 parent 80f5272 commit 38f329f
Show file tree
Hide file tree
Showing 4 changed files with 513 additions and 198 deletions.
152 changes: 6 additions & 146 deletions admin/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,75 +157,16 @@ function title_metas_help_tab() {
'content' => '<p>' . __( 'The title &amp; metas settings for WordPress SEO are made up of variables that are replaced by specific values from the page when the page is displayed. The tabs on the left explain the available variables.', 'wordpress-seo' ) . '</p>',
)
);

$replace_singleton = WPSEO_Replace_Vars::get_instance();

$screen->add_help_tab(
array(
'id' => 'title-vars',
'title' => __( 'Basic Variables', 'wordpress-seo' ),
'content' => '
<h2>' . __( 'Basic Variables', 'wordpress-seo' ) . '</h2>
<table class="yoast_help">
<tr>
<th>%%date%%</th>
<td>' . __( 'Replaced with the date of the post/page', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%title%%</th>
<td>' . __( 'Replaced with the title of the post/page', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%parent_title%%</th>
<td>' . __( 'Replaced with the title of the parent page of the current page', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%sitename%%</th>
<td>' . __( 'The site\'s name', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%sitedesc%%</th>
<td>' . __( 'The site\'s tagline / description', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%excerpt%%</th>
<td>' . __( 'Replaced with the post/page excerpt (or auto-generated if it does not exist)', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%excerpt_only%%</th>
<td>' . __( 'Replaced with the post/page excerpt (without auto-generation)', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%tag%%</th>
<td>' . __( 'Replaced with the current tag/tags', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%category%%</th>
<td>' . __( 'Replaced with the post categories (comma separated)', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%category_description%%</th>
<td>' . __( 'Replaced with the category description', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%tag_description%%</th>
<td>' . __( 'Replaced with the tag description', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%term_description%%</th>
<td>' . __( 'Replaced with the term description', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%term_title%%</th>
<td>' . __( 'Replaced with the term name', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%searchphrase%%</th>
<td>' . __( 'Replaced with the current search phrase', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%sep%%</th>
<td>' . __( 'The separator defined in your theme\'s <code>wp_title()</code> tag.', 'wordpress-seo' ) . '</td>
</tr>
</table>',
<h2>' . __( 'Basic Variables', 'wordpress-seo' ) . '</h2>' .
$replace_singleton->get_basic_help_texts(), //actual help text
)
);

Expand All @@ -234,89 +175,8 @@ function title_metas_help_tab() {
'id' => 'title-vars-advanced',
'title' => __( 'Advanced Variables', 'wordpress-seo' ),
'content' => '
<h2>' . __( 'Advanced Variables', 'wordpress-seo' ) . '</h2>
<table class="yoast_help">
<tr>
<th>%%pt_single%%</th>
<td>' . __( 'Replaced with the post type single label', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%pt_plural%%</th>
<td>' . __( 'Replaced with the post type plural label', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%modified%%</th>
<td>' . __( 'Replaced with the post/page modified time', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%id%%</th>
<td>' . __( 'Replaced with the post/page ID', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%name%%</th>
<td>' . __( 'Replaced with the post/page author\'s \'nicename\'', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%userid%%</th>
<td>' . __( 'Replaced with the post/page author\'s userid', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%currenttime%%</th>
<td>' . __( 'Replaced with the current time', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%currentdate%%</th>
<td>' . __( 'Replaced with the current date', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%currentday%%</th>
<td>' . __( 'Replaced with the current day', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%currentmonth%%</th>
<td>' . __( 'Replaced with the current month', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%currentyear%%</th>
<td>' . __( 'Replaced with the current year', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%page%%</th>
<td>' . __( 'Replaced with the current page number (i.e. page 2 of 4)', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%pagetotal%%</th>
<td>' . __( 'Replaced with the current page total', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%pagenumber%%</th>
<td>' . __( 'Replaced with the current page number', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%caption%%</th>
<td>' . __( 'Attachment caption', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%focuskw%%</th>
<td>' . __( 'Replaced with the posts focus keyword', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%term404%%</th>
<td>' . __( 'Replaced with the slug which caused the 404', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%cf_&lt;custom-field-name&gt;%%</th>
<td>' . __( 'Replaced with a posts custom field value', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%ct_&lt;custom-tax-name&gt;%%</th>
<td>' . __( 'Replaced with a posts custom taxonomies, comma separated.', 'wordpress-seo' ) . '</td>
</tr>
<tr>
<th>%%ct_desc_&lt;custom-tax-name&gt;%%</th>
<td>' . __( 'Replaced with a custom taxonomies description', 'wordpress-seo' ) . '</td>
</tr>
</table>', //actual help text
<h2>' . __( 'Advanced Variables', 'wordpress-seo' ) . '</h2>' .
$replace_singleton->get_advanced_help_texts(), //actual help text
)
);
}
Expand Down
Loading

0 comments on commit 38f329f

Please sign in to comment.