diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index a6d9362..1947b1d 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2007,18 +2007,6 @@ function template_preprocess_feed_icon(&$variables) {
}
/**
- * Returns HTML for a "more" link, like those used in blocks.
- *
- * @param $variables
- * An associative array containing:
- * - url: The URL of the main page.
- * - title: A descriptive verb for the link, like 'Read more'.
- */
-function theme_more_link($variables) {
- return '
' . l(t('More'), $variables['url'], array('attributes' => array('title' => $variables['title']))) . '
';
-}
-
-/**
* Returns HTML for an indentation div; used for drag and drop tables.
*
* @param $variables
@@ -2746,9 +2734,6 @@ function drupal_common_theme() {
'variables' => array('url' => NULL, 'title' => NULL),
'template' => 'feed-icon',
),
- 'more_link' => array(
- 'variables' => array('url' => NULL, 'title' => NULL)
- ),
'progress_bar' => array(
'variables' => array('label' => NULL, 'percent' => NULL, 'message' => NULL),
'template' => 'progress-bar',
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php
index 980424c..4b33277 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php
@@ -133,9 +133,9 @@ public function build() {
if ($category = $this->categoryStorageController->load($cid)) {
$result = $this->connection->queryRange('SELECT i.* FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON ci.iid = i.iid WHERE ci.cid = :cid ORDER BY i.timestamp DESC, i.iid DESC', 0, $this->configuration['block_count'], array(':cid' => $category->cid));
$more_link = array(
- '#theme' => 'more_link',
- '#url' => 'aggregator/categories/' . $category->cid,
- '#title' => t("View this category's recent news."),
+ '#type' => 'more_link',
+ '#href' => 'aggregator/categories/' . $category->cid,
+ '#attributes' => array('title' => t("View this category's recent news.")),
);
$read_more = drupal_render($more_link);
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php
index fa34b8a..49793e9 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php
@@ -135,9 +135,9 @@ public function build() {
if ($feed = $this->storageController->load($this->configuration['feed'])) {
$result = $this->connection->queryRange("SELECT * FROM {aggregator_item} WHERE fid = :fid ORDER BY timestamp DESC, iid DESC", 0, $this->configuration['block_count'], array(':fid' => $feed->id()));
$more_link = array(
- '#theme' => 'more_link',
- '#url' => 'aggregator/sources/' . $feed->id(),
- '#title' => t("View this feed's recent news."),
+ '#type' => 'more_link',
+ '#href' => 'aggregator/sources/' . $feed->id(),
+ '#attributes' => array('title' => t("View this feed's recent news.")),
);
$read_more = drupal_render($more_link);
$items = array();
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index 29decd5..2cef632 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -564,7 +564,11 @@ function forum_block_view_pre_render($elements) {
$result = $elements['#query']->execute();
if ($node_title_list = node_title_list($result)) {
$elements['forum_list'] = $node_title_list;
- $elements['forum_more'] = array('#theme' => 'more_link', '#url' => 'forum', '#title' => t('Read the latest forum topics.'));
+ $elements['forum_more'] = array(
+ '#type' => 'more_link',
+ '#href' => 'forum',
+ '#attributes' => array('title' => t('Read the latest forum topics.')),
+ );
}
return $elements;
}
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index a860f3f..7f7eb28 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -1142,9 +1142,9 @@ function theme_node_recent_block($variables) {
$output = drupal_render($table);
if (user_access('access content overview')) {
$more_link = array(
- '#theme' => 'more_link',
- '#url' => 'admin/content',
- '#title' => t('Show more content'),
+ '#type' => 'more_link',
+ '#href' => 'admin/content',
+ '#attributes' => array('title' => t('Show more content')),
);
$output .= drupal_render($more_link);
}
diff --git a/core/modules/system/css/system.theme.css b/core/modules/system/css/system.theme.css
index 6b34538..0b33d7f 100644
--- a/core/modules/system/css/system.theme.css
+++ b/core/modules/system/css/system.theme.css
@@ -119,7 +119,7 @@ abbr.form-required, abbr.tabledrag-changed, abbr.ajax-changed {
}
/**
- * Markup generated by theme_more_link().
+ * Markup generated by #type 'link'.
*/
.more-link {
text-align: right; /* LTR */
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 8ca0273..426ffbd 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -536,6 +536,15 @@ function system_element_info() {
$types['link'] = array(
'#pre_render' => array('drupal_pre_render_link'),
);
+ // A "more" link, like those used in blocks.
+ $types['more_link'] = $types['link'] + array(
+ '#title' => t('More'),
+ '#theme_wrappers' => array(
+ 'container' => array(
+ '#attributes' => array('class' => 'more-link'),
+ ),
+ ),
+ );
$types['fieldset'] = array(
'#value' => NULL,
'#process' => array('form_process_group', 'ajax_process_form'),
diff --git a/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php b/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php
index 2e5417d..e2bddaa 100644
--- a/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php
+++ b/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php
@@ -42,7 +42,7 @@ public function onRequest(GetResponseEvent $event) {
// theme_test_request_listener_page_callback() to test that even when the
// theme system is initialized this early, it is still capable of
// returning output and theming the page as a whole.
- $GLOBALS['theme_test_output'] = theme('more_link', array('url' => 'user', 'title' => 'Themed output generated in a KernelEvents::REQUEST listener'));
+ $GLOBALS['theme_test_output'] = theme('theme_test_foo', array('foo' => 'Themed output generated in a KernelEvents::REQUEST listener'));
}
}