本文整理汇总了PHP中get_edit_bookmark_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_edit_bookmark_link函数的具体用法?PHP get_edit_bookmark_link怎么用?PHP get_edit_bookmark_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_edit_bookmark_link函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_column_value_actions
/**
* Get column value of link actions
*
* This part is copied from the Link List Table class
*
* @since 1.4.2
*
* @param object $link
* @return string Actions
*/
private function get_column_value_actions($link)
{
$actions = array();
$edit_link = get_edit_bookmark_link($link);
$actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&link_id={$link->link_id}", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm( '" . esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name)) . "' ) ) { return true;}return false;\">" . __('Delete') . "</a>";
return implode(' | ', $actions);
}
开发者ID:xeiter,项目名称:timeplannr,代码行数:18,代码来源:actions.php
示例2: edit_bookmark_link
/**
* Display edit bookmark (literally a URL external to blog) link anchor content.
*
* @since 2.7.0
*
* @param string $link Optional. Anchor text.
* @param string $before Optional. Display before edit link.
* @param string $after Optional. Display after edit link.
* @param int $bookmark Optional. Bookmark ID.
*/
function edit_bookmark_link($link = '', $before = '', $after = '', $bookmark = null)
{
$bookmark = get_bookmark($bookmark);
if (!current_user_can('manage_links')) {
return;
}
if (empty($link)) {
$link = __('Edit This');
}
$link = '<a href="' . get_edit_bookmark_link($bookmark) . '">' . $link . '</a>';
/**
* Filter the bookmark edit link anchor tag.
*
* @since 2.7.0
*
* @param string $link Anchor tag for the edit link.
* @param int $link_id Bookmark ID.
*/
echo $before . apply_filters('edit_bookmark_link', $link, $bookmark->link_id) . $after;
}
开发者ID:rizkafitri,项目名称:WordPress-1,代码行数:30,代码来源:link-template.php
示例3: edit_bookmark_link
/**
* Display edit bookmark (literally a URL external to blog) link anchor content.
*
* @since 2.7.0
*
* @param string $link Optional. Anchor text.
* @param string $before Optional. Display before edit link.
* @param string $after Optional. Display after edit link.
* @param int $bookmark Optional. Bookmark ID.
*/
function edit_bookmark_link($link = '', $before = '', $after = '', $bookmark = null)
{
$bookmark = get_bookmark($bookmark);
if (!current_user_can('manage_links')) {
return;
}
if (empty($link)) {
$link = __('Edit This');
}
$link = '<a href="' . get_edit_bookmark_link($bookmark) . '" title="' . esc_attr__('Edit Link') . '">' . $link . '</a>';
echo $before . apply_filters('edit_bookmark_link', $link, $bookmark->link_id) . $after;
}
开发者ID:vpatrinica,项目名称:jfdesign,代码行数:22,代码来源:link-template.php
示例4: sanitize_bookmark
$link = sanitize_bookmark($link);
$link->link_name = esc_attr($link->link_name);
$link->link_category = wp_get_link_cats($link->link_id);
$short_url = str_replace('http://', '', $link->link_url);
$short_url = preg_replace('/^www\\./i', '', $short_url);
if ('/' == substr($short_url, -1)) {
$short_url = substr($short_url, 0, -1);
}
if (strlen($short_url) > 35) {
$short_url = substr($short_url, 0, 32) . '...';
}
$visible = $link->link_visible == 'Y' ? __('Yes') : __('No');
$rating = $link->link_rating;
$style = $alt % 2 ? '' : ' class="alternate"';
++$alt;
$edit_link = get_edit_bookmark_link();
?>
<tr id="link-<?php
echo $link->link_id;
?>
" valign="middle" <?php
echo $style;
?>
><?php
foreach ($link_columns as $column_name => $column_display_name) {
$class = "class=\"column-{$column_name}\"";
$style = '';
if (in_array($column_name, $hidden)) {
$style = ' style="display:none;"';
}
$attributes = "{$class}{$style}";
开发者ID:jinpingv,项目名称:website_wrapper,代码行数:31,代码来源:link-manager.php
示例5: admin_batch_page
//.........这里部分代码省略.........
<tr>
<td class="has-cb"><input class="item-select" type="checkbox" name="batch_items[taxonomies][' . esc_attr($type) . '][]" id="' . esc_attr($type) . '-' . $term->term_id . '" value="' . $term->term_id . '" ' . (!empty($term->selected) && $term->selected == true ? ' checked="checked"' : '') . '/></td>
<td><b><a href="' . $term_edit_link . '">' . $term->name . '</a></b><br /><span class="item-status-text">Post Count: ' . $term->count . '</span>';
if ($term->parent > 0) {
$parent = get_term($term->parent, $term->taxonomy);
$parent_edit_link = 'edit-tags.php?action=edit&taxonomy=' . $parent->taxonomy . '&tag_ID=' . $parent->term_id;
echo '<br /><span class="item-status-text">Child of: <a href="' . $parent_edit_link . '">' . $parent->name . '</a></span>';
}
echo '</td>
<td><span class="item-status-text">' . ($term->modified == 'new' ? __('New', 'cf-deploy') : __('Local & Remote Differ', 'cf-deploy')) . '</span></td>
</tr>';
}
echo $this->batch_items_table_footer();
} else {
echo '
<div class="message cf-mar-top-none"><p>' . __(sprintf('No new or modified %s found.', $tax->labels->name), 'cf-deploy') . '</p></div>';
}
echo '
</fieldset><!-- /' . $type . ' -->';
}
}
# batch contents: bookmarks
$bookmarks = $this->batch->get_comparison_data('bookmarks');
echo '
<fieldset class="cf-lbl-pos-left">
<legend>' . __('Links', 'cf-deploy') . '</legend>';
if (!empty($bookmarks)) {
echo $this->batch_items_table_header('bookmarks', 'short');
foreach ($bookmarks as $bookmark) {
$bmark_local_status = $bmark_remote_status = '--';
echo '
<tr>
<td class="has-cb"><input class="item-selected" type="checkbox" name="batch_items[bookmarks][]" id="bookmarks-' . $bookmark->link_id . '" value="' . $bookmark->link_id . '" ' . (!empty($bookmark->selected) && $bookmark->selected == true ? ' checked="checked"' : '') . '/></td>
<td><b><a href="' . get_edit_bookmark_link($bookmark->link_id) . '">' . esc_html($bookmark->link_name) . '</a></b><br /><span class="item-status-text">' . esc_html($bookmark->link_url) . '</span></td>
<td><span class="item-status-text">';
switch (true) {
case empty($bookmark->status['remote_status']):
echo __('New', 'cf-deploy');
break;
default:
echo __('Local & Remote differ', 'cf-deploy');
break;
}
echo '</span></td>
</tr>';
}
echo $this->batch_items_table_footer();
} else {
echo '
<div class="message cf-mar-top-none"><p>' . __('No new or modified Links found.', 'cf-deploy') . '</p></div>';
}
echo '
</fieldset><!-- bookmarks -->';
# Informational only items
# plugins
$plugins = $this->get_plugin_data();
echo '
<fieldset class="cf-lbl-pos-left">
<legend>' . __('Plugins', 'cf-deploy') . '</legend>';
if (!empty($plugins)) {
ob_start();
foreach ($plugins as $plugin) {
echo '
<tr>
<td><b>' . $plugin['Name'] . '</b> by ' . $plugin['Author'] . '<br /><span class="item-status-text">' . $plugin['Description'] . '</span></td>
<td>' . __('Active', 'cf-deploy') . '<br /><span class="item-status-text">' . __('Version', 'cf-deploy') . ': ' . $plugin['Version'] . '</span></td>
开发者ID:niko-lgdcom,项目名称:wp-install,代码行数:67,代码来源:admin.class.php
示例6: display_rows
function display_rows()
{
global $cat_id;
$alt = 0;
foreach ($this->items as $link) {
$link = sanitize_bookmark($link);
$link->link_name = esc_attr($link->link_name);
$link->link_category = wp_get_link_cats($link->link_id);
$short_url = url_shorten($link->link_url);
$visible = $link->link_visible == 'Y' ? __('Yes') : __('No');
$rating = $link->link_rating;
$style = $alt++ % 2 ? '' : ' class="alternate"';
$edit_link = get_edit_bookmark_link($link);
?>
<tr id="link-<?php
echo $link->link_id;
?>
" valign="middle" <?php
echo $style;
?>
>
<?php
list($columns, $hidden) = $this->get_column_info();
foreach ($columns as $column_name => $column_display_name) {
$class = "class='column-{$column_name}'";
$style = '';
if (in_array($column_name, $hidden)) {
$style = ' style="display:none;"';
}
$attributes = $class . $style;
switch ($column_name) {
case 'cb':
?>
<th scope="row" class="check-column">
<label class="screen-reader-text" for="cb-select-<?php
echo $link->link_id;
?>
"><?php
echo sprintf(__('Select %s'), $link->link_name);
?>
</label>
<input type="checkbox" name="linkcheck[]" id="cb-select-<?php
echo $link->link_id;
?>
" value="<?php
echo esc_attr($link->link_id);
?>
" />
</th>
<?php
break;
case 'name':
echo "<td {$attributes}><strong><a class='row-title' href='{$edit_link}' title='" . esc_attr(sprintf(__('Edit “%s”'), $link->link_name)) . "'>{$link->link_name}</a></strong><br />";
$actions = array();
$actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&link_id={$link->link_id}", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm( '" . esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name)) . "' ) ) { return true;}return false;\">" . __('Delete') . "</a>";
echo $this->row_actions($actions);
echo '</td>';
break;
case 'url':
echo "<td {$attributes}><a href='{$link->link_url}' title='" . esc_attr(sprintf(__('Visit %s'), $link->link_name)) . "'>{$short_url}</a></td>";
break;
case 'categories':
?>
<td <?php
echo $attributes;
?>
><?php
$cat_names = array();
foreach ($link->link_category as $category) {
$cat = get_term($category, 'link_category', OBJECT, 'display');
if (is_wp_error($cat)) {
echo $cat->get_error_message();
}
$cat_name = $cat->name;
if ($cat_id != $category) {
$cat_name = "<a href='link-manager.php?cat_id={$category}'>{$cat_name}</a>";
}
$cat_names[] = $cat_name;
}
echo implode(', ', $cat_names);
?>
</td><?php
break;
case 'rel':
?>
<td <?php
echo $attributes;
?>
><?php
echo empty($link->link_rel) ? '<br />' : $link->link_rel;
?>
</td><?php
break;
case 'visible':
?>
<td <?php
echo $attributes;
?>
><?php
//.........这里部分代码省略.........
开发者ID:dev-lav,项目名称:htdocs,代码行数:101,代码来源:class-wp-links-list-table.php
示例7: handle_row_actions
/**
* Generates and displays row action links.
*
* @since 4.3.0
* @access protected
*
* @param object $link Link being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row action output for links.
*/
protected function handle_row_actions($link, $column_name, $primary)
{
if ($primary !== $column_name) {
return '';
}
$edit_link = get_edit_bookmark_link($link);
$actions = array();
$actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&link_id={$link->link_id}", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm( '" . esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name)) . "' ) ) { return true;}return false;\">" . __('Delete') . "</a>";
return $this->row_actions($actions);
}
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:22,代码来源:class-wp-links-list-table.php
示例8: display_rows
function display_rows()
{
global $cat_id;
$alt = 0;
foreach ($this->items as $link) {
$link = sanitize_bookmark($link);
$link->link_name = esc_attr($link->link_name);
$link->link_category = wp_get_link_cats($link->link_id);
$short_url = str_replace('http://', '', $link->link_url);
$short_url = preg_replace('/^www\\./i', '', $short_url);
if ('/' == substr($short_url, -1)) {
$short_url = substr($short_url, 0, -1);
}
if (strlen($short_url) > 35) {
$short_url = substr($short_url, 0, 32) . '...';
}
$visible = $link->link_visible == 'Y' ? __('Yes') : __('No');
$rating = $link->link_rating;
$style = $alt++ % 2 ? '' : ' class="alternate"';
$edit_link = get_edit_bookmark_link($link);
?>
<tr id="link-<?php
echo $link->link_id;
?>
" valign="middle" <?php
echo $style;
?>
>
<?php
list($columns, $hidden) = $this->get_column_headers();
foreach ($columns as $column_name => $column_display_name) {
$class = "class='column-{$column_name}'";
$style = '';
if (in_array($column_name, $hidden)) {
$style = ' style="display:none;"';
}
$attributes = $class . $style;
switch ($column_name) {
case 'cb':
echo '<th scope="row" class="check-column"><input type="checkbox" name="linkcheck[]" value="' . esc_attr($link->link_id) . '" /></th>';
break;
case 'name':
echo "<td {$attributes}><strong><a class='row-title' href='{$edit_link}' title='" . esc_attr(sprintf(__('Edit “%s”'), $link->link_name)) . "'>{$link->link_name}</a></strong><br />";
$actions = array();
$actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&link_id={$link->link_id}", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm( '" . esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name)) . "' ) ) { return true;}return false;\">" . __('Delete') . "</a>";
$action_count = count($actions);
$i = 0;
echo '<div class="row-actions">';
foreach ($actions as $action => $linkaction) {
++$i;
$i == $action_count ? $sep = '' : ($sep = ' | ');
echo "<span class='{$action}'>{$linkaction}{$sep}</span>";
}
echo '</div>';
echo '</td>';
break;
case 'url':
echo "<td {$attributes}><a href='{$link->link_url}' title='" . sprintf(__('Visit %s'), $link->link_name) . "'>{$short_url}</a></td>";
break;
case 'categories':
?>
<td <?php
echo $attributes;
?>
><?php
$cat_names = array();
foreach ($link->link_category as $category) {
$cat = get_term($category, 'link_category', OBJECT, 'display');
if (is_wp_error($cat)) {
echo $cat->get_error_message();
}
$cat_name = $cat->name;
if ($cat_id != $category) {
$cat_name = "<a href='link-manager.php?cat_id={$category}'>{$cat_name}</a>";
}
$cat_names[] = $cat_name;
}
echo implode(', ', $cat_names);
?>
</td><?php
break;
case 'rel':
?>
<td <?php
echo $attributes;
?>
><?php
echo empty($link->link_rel) ? '<br />' : $link->link_rel;
?>
</td><?php
break;
case 'visible':
?>
<td <?php
echo $attributes;
?>
><?php
echo $visible;
?>
//.........这里部分代码省略.........
开发者ID:junxuan,项目名称:wordpress,代码行数:101,代码来源:default-list-tables.php
注:本文中的get_edit_bookmark_link函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论