• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_edit_bookmark_link函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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&amp;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&amp;taxonomy=' . $parent->taxonomy . '&amp;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 &amp; 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 &amp; 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 &#8220;%s&#8221;'), $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&amp;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&amp;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 &#8220;%s&#8221;'), $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&amp;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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_edit_comment_link函数代码示例发布时间:2022-05-15
下一篇:
PHP get_edit_access函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap