当前位置: 首页>>代码示例>>PHP>>正文


PHP get_delete_post_link函数代码示例

本文整理汇总了PHP中get_delete_post_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_delete_post_link函数的具体用法?PHP get_delete_post_link怎么用?PHP get_delete_post_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_delete_post_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: column_title

 function column_title($item)
 {
     $editHref = home_url() . '/wp-admin/post.php?post=' . $item->ID . '&action=edit';
     //Build row actions
     $actions = array('edit' => '<a href="' . $editHref . '">' . __('Edit') . '</a>', 'delete' => "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($item->ID) . "'>" . __('Trash') . "</a>");
     return '<a class="row-title" href="' . home_url() . '/wp-admin/post.php?post=' . $item->ID . '&action=edit">' . $item->post_title . '</a>' . $this->row_actions($actions);
 }
开发者ID:uoyknaht,项目名称:kc,代码行数:7,代码来源:film-register-film-list-table.class.php

示例2: addData

 /**
  * Add additional data to the response object
  */
 private function addData()
 {
     $this->data['delete_link'] = get_delete_post_link($this->data['id'], '', true);
     $this->data['nav_status'] = isset($this->data['nav_status']) ? 'hide' : 'show';
     $this->data['np_status'] = isset($this->data['nested_pages_status']) ? 'hide' : 'show';
     $this->data['link_target'] = isset($this->data['link_target']) ? '_blank' : 'none';
 }
开发者ID:raminabsari,项目名称:phonicsschool,代码行数:10,代码来源:NewLinkHandler.php

示例3: column_post_title

 public function column_post_title($item)
 {
     $actions = array('edit' => '<a class="" title="Edit Form" href="' . get_edit_post_link($item->ID) . '">Edit</a>', 'delete' => '<a class="submitdelete" title="Delete Form" href="' . get_delete_post_link($item->ID, '', true) . '">Delete</a>');
     $form_title = empty($item->post_title) ? "(no title)" : $item->post_title;
     $title = '<strong><a class="row-title" title="Edit Form" href="' . get_edit_post_link($item->ID) . '">' . $form_title . '</a></strong>';
     return sprintf('%1$s %2$s', $title, $this->row_actions($actions));
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:7,代码来源:class-forms-table.php

示例4: answers_meta_box_content

    /**
     * Render Meta Box content.
     */
    public function answers_meta_box_content()
    {
        $ans_args = array('post_type' => 'answer', 'post_status' => 'publish', 'post_parent' => get_the_ID(), 'showposts' => 10, 'orderby' => 'date', 'order' => 'DESC');
        $ans_args = apply_filters('ap_meta_box_answers_query_args', $ans_args);
        $answers = get_posts($ans_args);
        if (!empty($answers)) {
            foreach ($answers as $ans) {
                ?>

			<div class="answer clearfix">
				<div class="author">
					<span><?php 
                echo get_avatar($ans->post_author, 30);
                ?>
</span>
					<strong><?php 
                echo ap_user_display_name($ans->post_author);
                ?>
</strong>
				</div>
				<div class="answer-content">
					<div class="submitted-on">
						<?php 
                printf(__('%sAnswered about %s ago%s', 'ap'), '<span class="when">', '</span>', ap_human_time(get_the_time('U', $ans)));
                ?>

					</div>
					<p><?php 
                echo $ans->post_content;
                ?>
</p>
					<div class="row-actions">
						<span><a href="<?php 
                echo get_edit_post_link($ans->ID);
                ?>
"><?php 
                _e('Edit', 'ap');
                ?>
</a></span>
						<span> | <a href="#"><?php 
                _e('Hide', 'ap');
                ?>
</a></span>
						<span class="delete vim-d vim-destructive"> | <a href="<?php 
                echo get_delete_post_link($ans->ID);
                ?>
"><?php 
                _e('Trash', 'ap');
                ?>
</a></span>
					</div>
				</div>
			</div>
		<?php 
            }
        } else {
            _e('No answers yet', 'ap');
        }
        wp_reset_postdata();
    }
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:63,代码来源:meta_box.php

示例5: custom_publish_meta_box

 function custom_publish_meta_box($post)
 {
     $slider_id = $post->ID;
     $post_status = get_post_status($slider_id);
     $delete_link = get_delete_post_link($slider_id);
     $nonce = wp_create_nonce('ssp_slider_nonce');
     include muneeb_ssp_view_path(__FUNCTION__);
 }
开发者ID:katelawroski,项目名称:wordpresssite,代码行数:8,代码来源:ssp_slider_post_type.php

示例6: column_post_title

 function column_post_title($post)
 {
     $actions = array();
     if (current_user_can($this->post_type_obj->cap->edit_post, $post)) {
         $actions['edit'] = sprintf('<a href="%s">%s</a>', esc_url(get_edit_post_link($post->ID)), esc_html($this->post_type_obj->labels->edit_item));
     }
     if (current_user_can($this->post_type_obj->cap->delete_post, $post)) {
         $actions['delete'] = sprintf('<a href="%s">%s</a>', esc_url(get_delete_post_link($post->ID)), esc_html__('Trash', 'jetpack'));
     }
     $actions['view'] = sprintf('<a href="%s">%s</a>', esc_url(get_permalink($post->ID)), esc_html($this->post_type_obj->labels->view_item));
     return wptexturize($post->post_title) . $this->row_actions($actions);
 }
开发者ID:moushegh,项目名称:blog-source-configs,代码行数:12,代码来源:omnisearch-posts.php

示例7: saveRedirect

 /**
  * Save the item as a redirect post type
  */
 private function saveRedirect()
 {
     $new_link = $this->post_update_repo->saveRedirect($this->data);
     if (!$new_link) {
         $this->sendErrorResponse();
     }
     $this->data['post'] = $_POST;
     $this->data['post']['id'] = $new_link;
     $this->data['post']['content'] = esc_url($_POST['url']);
     $this->data['post']['delete_link'] = get_delete_post_link($new_link, '', true);
     $this->addExtras($new_link);
     $this->response = array('status' => 'success', 'message' => __('Link successfully updated', 'nestedpages'), 'post_data' => $this->data['post']);
 }
开发者ID:dtwist,项目名称:wp-nested-pages,代码行数:16,代码来源:NewMenuItem.php

示例8: wc_tab_manager_product_tab_actions_meta_box

/**
 * Display the product tab actions meta box.
 *
 * Displays the product actions meta box - buttons for creating and deleting the tab
 *
 * @access public
 * @param object $post product post object
 */
function wc_tab_manager_product_tab_actions_meta_box($post)
{
    ?>
	<style type="text/css">
		#edit-slug-box, #major-publishing-actions, #minor-publishing-actions, #visibility, #submitdiv { display:none }
		.wc_product_tab_actions li {
			border-bottom: 1px solid #DDDDDD;
			border-top: 1px solid #FFFFFF;
			line-height: 1.6em;
			margin: 0;
			padding: 6px 0;
		}
		.wc_product_tab_actions li:last-child {
		    border-bottom: 0 none;
		}
	</style>
	<ul class="wc_product_tab_actions">
		<li class="wide"><input type="submit" class="button button-primary tips" name="publish" value="<?php 
    _e('Save Tab', WC_Tab_Manager::TEXT_DOMAIN);
    ?>
" data-tip="<?php 
    _e('Save/update the tab', WC_Tab_Manager::TEXT_DOMAIN);
    ?>
" /></li>

		<?php 
    do_action('woocommerce_tab_manager_product_tab_actions', $post->ID);
    ?>

		<li class="wide">
		<?php 
    if (current_user_can("delete_post", $post->ID)) {
        if (!EMPTY_TRASH_DAYS) {
            $delete_text = __('Delete Permanently', WC_Tab_Manager::TEXT_DOMAIN);
        } else {
            $delete_text = __('Move to Trash', WC_Tab_Manager::TEXT_DOMAIN);
        }
        ?>
		<a class="submitdelete deletion" href="<?php 
        echo esc_url(get_delete_post_link($post->ID));
        ?>
"><?php 
        echo esc_attr($delete_text);
        ?>
</a><?php 
    }
    ?>
		</li>
	</ul>
	<?php 
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:59,代码来源:writepanel-product-tab_actions.php

示例9: ui_get_action_links

 /**
  * Get action links for this post.
  *
  * @param string $container_field Ignored.
  * @return array of action link HTML.
  */
 function ui_get_action_links($container_field = '')
 {
     $actions = array();
     if (current_user_can('edit_post', $this->container_id)) {
         $actions['edit'] = '<span class="edit"><a href="' . $this->get_edit_url() . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>';
         if (constant('EMPTY_TRASH_DAYS')) {
             $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($this->container_id) . "'>" . __('Trash') . "</a>";
         } else {
             $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url(admin_url("post.php?action=delete&amp;post=" . $this->container_id), 'delete-post_' . $this->container_id) . "' onclick=\"if ( confirm('" . esc_js(sprintf(__("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), get_the_title($this->container_id))) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
         }
     }
     $actions['view'] = '<span class="view"><a href="' . get_permalink($this->container_id) . '" title="' . esc_attr(sprintf(__('View "%s"', 'broken-link-checker'), get_the_title($this->container_id))) . '" rel="permalink">' . __('View') . '</a>';
     return $actions;
 }
开发者ID:slaFFik,项目名称:l10n-ru,代码行数:20,代码来源:post.php

示例10: _icl_trash_restore_prompt

function _icl_trash_restore_prompt()
{
    global $sitepress;
    if (isset($_GET['lang'])) {
        $post = get_post(intval($_GET['post']));
        if ($post->post_status == 'trash') {
            $post_type_object = get_post_type_object($post->post_type);
            $ret = '<p>';
            $ret .= sprintf(__('This translation is currently in the trash. You need to either <a href="%s">delete it permanently</a> or <a href="%s">restore</a> it in order to continue.'), get_delete_post_link($post->ID, '', true), wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&amp;action=untrash', $post->ID)), 'untrash-' . $post->post_type . '_' . $post->ID));
            $ret .= '</p>';
            wp_die($ret);
        }
    }
}
开发者ID:bidhanbaral,项目名称:fotodep_store,代码行数:14,代码来源:functions.php

示例11: delete_post_link

 /**
  * Display edit post link for post.
  *
  * @since 1.0.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 $id Optional. Post ID.
  */
 function delete_post_link($link = null, $before = '', $after = '', $id = 0)
 {
     if (!($post = get_post($id))) {
         return;
     }
     if (!($url = get_delete_post_link($post->ID))) {
         return;
     }
     if (null === $link) {
         $link = __('Delete This', 'pronamic_framework');
     }
     $post_type_obj = get_post_type_object($post->post_type);
     $link = '<a class="post-delete-link" href="' . $url . '">' . $link . '</a>';
     echo $before . apply_filters('delete_post_link', $link, $post->ID) . $after;
 }
开发者ID:joffcrabtree,项目名称:wp-pronamic-framework,代码行数:25,代码来源:link-template.php

示例12: answer_row_actions

 /**
  * Add action links below question/answer content in wp post list.
  * @param  string  $column  Current column name.
  * @param  integer $post_id Current post id.
  */
 public function answer_row_actions($column, $post_id)
 {
     global $post, $mode;
     if ('answer_content' != $column) {
         return;
     }
     $question = get_post($post->post_parent);
     echo '<a href="' . get_permalink($post->post_parent) . '" class="row-title">' . $question->post_title . '</a>';
     $content = get_the_excerpt();
     // Get the first 80 words from the content and added to the $abstract variable.
     preg_match('/^([^.!?\\s]*[\\.!?\\s]+){0,40}/', strip_tags($content), $abstract);
     // Pregmatch will return an array and the first 80 chars will be in the first element
     echo $abstract[0] . '...';
     // First set up some variables
     $actions = array();
     $post_type_object = get_post_type_object($post->post_type);
     $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID);
     // Actions to delete/trash.
     if (current_user_can($post_type_object->cap->delete_post, $post->ID)) {
         if ('trash' == $post->post_status) {
             $_wpnonce = wp_create_nonce('untrash-post_' . $post_id);
             $url = admin_url('post.php?post=' . $post_id . '&action=untrash&_wpnonce=' . $_wpnonce);
             $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash', 'anspress-question-answer')) . "' href='" . $url . "'>" . __('Restore', 'anspress-question-answer') . '</a>';
         } elseif (EMPTY_TRASH_DAYS) {
             $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash', 'anspress-question-answer')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash', 'anspress-question-answer') . '</a>';
         }
         if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) {
             $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently', 'anspress-question-answer')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently', 'anspress-question-answer') . '</a>';
         }
     }
     if ($can_edit_post) {
         $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, '', true) . '" title="' . esc_attr(sprintf(__('Edit &#8220;%s&#8221;', 'anspress-question-answer'), $post->title)) . '" rel="permalink">' . __('Edit', 'anspress-question-answer') . '</a>';
     }
     // Actions to view/preview.
     if (in_array($post->post_status, array('pending', 'draft', 'future')) && $can_edit_post) {
         $actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post->ID))) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;', 'anspress-question-answer'), $post->title)) . '" rel="permalink">' . __('Preview', 'anspress-question-answer') . '</a>';
     } elseif ('trash' != $post->post_status) {
         $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(__('View &#8220;%s&#8221; question', 'anspress-question-answer')) . '" rel="permalink">' . __('View', 'anspress-question-answer') . '</a>';
     }
     if (ap_flagged_post_meta($post->ID)) {
         $actions['flag'] = '<a href="#" data-query="ap_clear_flag::' . wp_create_nonce('clear_flag_' . $post->ID) . '::' . $post->ID . '" class="ap-ajax-btn flag-clear" data-cb="afterFlagClear">' . __('Clear flag', 'anspress-question-answer') . '</a>';
     }
     // Echo the 'actions' HTML, let WP_List_Table do the hard work.
     $WP_List_Table = new WP_List_Table();
     echo $WP_List_Table->row_actions($actions);
 }
开发者ID:erashu212,项目名称:anspress,代码行数:51,代码来源:class-list-table-hooks.php

示例13: job_application_save

        /**
         * Publish meta box
         */
        public function job_application_save($post)
        {
            $statuses = get_job_application_statuses();
            ?>
			<div class="submitbox" id="submitpost">
				<div id="minor-publishing">
					<div id="misc-publishing-actions">
						<div class="misc-pub-section misc-pub-post-status">
							<div id="post-status-select">
								<select name='post_status' id='post_status'>
									<?php 
            foreach ($statuses as $key => $label) {
                $selected = selected($post->post_status, $key, false);
                echo "<option{$selected} value='" . esc_attr($key) . "'>" . esc_html($label) . "</option>";
            }
            ?>
								</select>
							</div>
						</div>
					</div>
				</div>
				<div id="major-publishing-actions">
					<div id="delete-action">
						<a class="submitdelete deletion" href="<?php 
            echo get_delete_post_link($post->ID);
            ?>
"><?php 
            _e('Move to Trash');
            ?>
</a>
					</div>
					<div id="publishing-action">
						<span class="spinner"></span>
						<input name="save" class="button button-primary" type="submit" value="<?php 
            _e('Save', 'wp-job-manager-applications');
            ?>
">
					</div>
					<div class="clear"></div>
				</div>
			</div>
			<?php 
        }
开发者ID:vinodhip,项目名称:Function-22-Website,代码行数:46,代码来源:class-wp-job-manager-applications-writepanels.php

示例14: get_actions

 /**
  * @see CPAC_Column_Actions::get_actions()
  * @since 2.2.6
  */
 public function get_actions($item_id)
 {
     $actions = array();
     $post = get_post($item_id);
     $title = _draft_or_post_title();
     $post_type_object = get_post_type_object($post->post_type);
     $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID);
     $quickedit_enabled = false;
     $stored_columns = $this->get_storage_model()->get_stored_columns();
     foreach ($stored_columns as $column) {
         if ($column['type'] == 'title') {
             $quickedit_enabled = true;
         }
     }
     // taken from Wordpress core
     if ($can_edit_post && 'trash' != $post->post_status) {
         $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>';
         if ($quickedit_enabled) {
             $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline')) . '">' . __('Quick&nbsp;Edit') . '</a>';
         }
     }
     if (current_user_can($post_type_object->cap->delete_post, $post->ID)) {
         if ('trash' == $post->post_status) {
             $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&amp;action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
         } elseif (EMPTY_TRASH_DAYS) {
             $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
         }
         if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) {
             $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>";
         }
     }
     if ($post_type_object->public) {
         if (in_array($post->post_status, array('pending', 'draft', 'future'))) {
             if ($can_edit_post) {
                 $actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post->ID))) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
             }
         } elseif ('trash' != $post->post_status) {
             $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
         }
     }
     return $actions;
 }
开发者ID:xeiter,项目名称:timeplannr,代码行数:46,代码来源:actions.php

示例15: annowf_major_action_draft_markup

/**
 * Draft state markup for major actions.
 */
function annowf_major_action_draft_markup()
{
    global $anno_post_save;
    $post_id = anno_get_post_id();
    if (anno_user_can('trash_post')) {
        $wrap_class = '';
        ?>
		<div id="delete-action">
			<a class="submitdelete deletion" href="<?php 
        echo get_delete_post_link($post_id);
        ?>
"><?php 
        _ex('Move To Trash', 'Publishing box trash action link text', 'anno');
        ?>
</a>
		</div>
<?php 
    } else {
        $wrap_class = ' class="center-wrap"';
    }
    ?>
		<div id="publishing-action"<?php 
    echo $wrap_class;
    ?>
>
			<img src="<?php 
    echo esc_url(admin_url('images/wpspin_light.gif'));
    ?>
" class="ajax-loading" id="ajax-loading" alt="" />
			<input name="original_publish" type="hidden" id="original_publish" value="<?php 
    esc_attr_e($anno_post_save['review']);
    ?>
" />

			<?php 
    submit_button($anno_post_save['review'], 'primary', 'publish', false, array('tabindex' => '5', 'accesskey' => 'p'));
    ?>
		</div>
		<div class="clear"></div>
<?php 
}
开发者ID:nameofname,项目名称:momo-wordpress-theme,代码行数:44,代码来源:publishing-meta-box.php


注:本文中的get_delete_post_link函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。