本文整理汇总了PHP中get_edit_post_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_edit_post_link函数的具体用法?PHP get_edit_post_link怎么用?PHP get_edit_post_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_edit_post_link函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: work_complete
function work_complete($job_id, $update = false)
{
global $iclTranslationManagement, $sitepress, $wpdb;
$job = $iclTranslationManagement->get_translation_job($job_id);
if ($job->manager_id == $job->translator_id) {
return;
}
$manager = new WP_User($job->manager_id);
$translator = new WP_User($job->translator_id);
// get current user admin language
$user_language = $sitepress->get_user_admin_language($manager->ID);
if (empty($user_language)) {
$user_language = $sitepress->get_admin_language();
}
$lang_from = $wpdb->get_var($wpdb->prepare("SELECT name FROM {$wpdb->prefix}icl_languages_translations WHERE language_code='%s' AND display_language_code='%s'", $job->source_language_code, $user_language));
$lang_to = $wpdb->get_var($wpdb->prepare("SELECT name FROM {$wpdb->prefix}icl_languages_translations WHERE language_code='%s' AND display_language_code='%s'", $job->language_code, $user_language));
$tj_url = get_option('siteurl') . '/wp-admin/admin.php?page=' . ICL_PLUGIN_FOLDER . '/menu/translation-management.php&sm=jobs';
$doc_url = get_edit_post_link($job->original_doc_id);
if ($iclTranslationManagement->settings['notification']['completed'] == ICL_TM_NOTIFICATION_IMMEDIATELY) {
$mail['to'] = $manager->user_email;
if ($update) {
$mail['subject'] = sprintf(__('Translator has updated translation job for %s', 'sitepress'), get_bloginfo('name'));
$mail['body'] = sprintf(__("Translator (%s) has updated translation of job \"%s\" for %s to %s.\n%s\n\nView translation jobs: %s", 'sitepress'), $translator->display_name, $job->original_doc_title, $lang_from, $lang_to, $doc_url, $tj_url);
} else {
$mail['subject'] = sprintf(__('Translator has completed translation job for %s', 'sitepress'), get_bloginfo('name'));
$mail['body'] = sprintf(__("Translator (%s) has completed translation of job \"%s\" for %s to %s.\n%s\n\nView translation jobs: %s", 'sitepress'), $translator->display_name, $job->original_doc_title, $lang_from, $lang_to, $doc_url, $tj_url);
}
$mail['type'] = 'admin';
$this->send_mail($mail);
}
}
开发者ID:winyatasenjaya,项目名称:sitepress-multilingual-cms,代码行数:31,代码来源:tm-notification.class.php
示例2: 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
示例3: acquirer_field_input
/**
* Acquirrer field input
*
* @param string $field_content
* @param string $field
* @param string $value
* @param string $lead_id
* @param string $form_id
*/
public static function acquirer_field_input($field_content, $field, $value, $lead_id, $form_id)
{
$type = RGFormsModel::get_input_type($field);
if (Pronamic_WP_Pay_Extensions_GravityForms_IssuerDropDown::TYPE === $type) {
$id = $field['id'];
$field_id = IS_ADMIN || 0 === $form_id ? "input_{$id}" : 'input_' . $form_id . "_{$id}";
$class_suffix = RG_CURRENT_VIEW === 'entry' ? '_admin' : '';
$size = rgar($field, 'size');
$class = $size . $class_suffix;
$css_class = trim(esc_attr($class) . ' gfield_ideal_acquirer_select');
$tab_index = GFCommon::get_tabindex();
$disabled_text = IS_ADMIN && 'entry' !== RG_CURRENT_VIEW ? "disabled='disabled'" : '';
$html = '';
$feed = get_pronamic_gf_pay_conditioned_feed_by_form_id($form_id, true);
/**
* Developing warning:
* Don't use single quotes in the HTML you output, it is buggy in combination with SACK
*/
if (IS_ADMIN) {
if (null === $feed) {
$html .= sprintf("<a class='ideal-edit-link' href='%s' target='_blank'>%s</a>", add_query_arg('post_type', 'pronamic_pay_gf', admin_url('post-new.php')), __('Create iDEAL feed', 'pronamic_ideal'));
} else {
$html .= sprintf("<a class='ideal-edit-link' href='%s' target='_blank'>%s</a>", get_edit_post_link($feed->id), __('Edit iDEAL feed', 'pronamic_ideal'));
}
}
$html_input = '';
$html_error = '';
if (null !== $feed) {
$gateway = Pronamic_WP_Pay_Plugin::get_gateway($feed->config_id);
if ($gateway) {
$issuer_field = $gateway->get_issuer_field();
$error = $gateway->get_error();
if (is_wp_error($error)) {
$html_error .= Pronamic_WP_Pay_Plugin::get_default_error_message();
$html_error .= '<br /><em>' . $error->get_error_message() . '</em>';
} elseif ($issuer_field) {
$choices = $issuer_field['choices'];
$options = Pronamic_WP_HTML_Helper::select_options_grouped($choices, $value);
// Double quotes are not working, se we replace them with an single quote
$options = str_replace('"', '\'', $options);
$html_input = '';
$html_input .= sprintf("<select name='input_%d' id='%s' class='%s' %s %s>", $id, $field_id, $css_class, $tab_index, $disabled_text);
$html_input .= sprintf('%s', $options);
$html_input .= sprintf('</select>');
}
}
}
if ($html_error) {
$html .= sprintf("<div class='gfield_description validation_message'>");
$html .= sprintf('%s', $html_error);
$html .= sprintf('</div>');
} else {
$html .= sprintf("<div class='ginput_container ginput_ideal'>");
$html .= sprintf('%s', $html_input);
$html .= sprintf('</div>');
}
$field_content = $html;
}
return $field_content;
}
开发者ID:daanbakker1995,项目名称:vanteun,代码行数:69,代码来源:Fields.php
示例4: wordlift_ajax_related_posts
function wordlift_ajax_related_posts($http_raw_data = null)
{
// Extract filtering conditions
if (!isset($_GET["post_id"]) || !is_numeric($_GET["post_id"])) {
wp_die('Post id missing or invalid!');
return;
}
$post_id = $_GET["post_id"];
// Get the current post
$post = get_post($post_id);
wl_write_log("Going to find posts related to current with post id: {$post_id} ...");
// Extract filtering conditions
$filtering_entity_uris = null == $http_raw_data ? file_get_contents("php://input") : $http_raw_data;
$filtering_entity_uris = json_decode($filtering_entity_uris);
$filtering_entity_ids = wl_get_entity_post_ids_by_uris($filtering_entity_uris);
$related_posts = array();
// If the current post is an antity
// related posts to the current entity are returned
if (Wordlift_Entity_Service::TYPE_NAME == $post->post_type) {
$filtering_entity_ids = array($post_id);
}
if (!empty($filtering_entity_ids)) {
$related_posts = wl_core_get_posts(array('get' => 'posts', 'related_to__in' => $filtering_entity_ids, 'post__not_in' => array($post_id), 'post_type' => 'post', 'post_status' => 'publish', 'as' => 'subject'));
foreach ($related_posts as $post_obj) {
$thumbnail = wp_get_attachment_url(get_post_thumbnail_id($post_obj->ID, 'thumbnail'));
$post_obj->thumbnail = $thumbnail ? $thumbnail : WL_DEFAULT_THUMBNAIL_PATH;
$post_obj->link = get_edit_post_link($post_obj->ID, 'none');
$post_obj->permalink = get_post_permalink($post_obj->ID);
}
}
wl_core_send_json($related_posts);
}
开发者ID:Byrlyne,项目名称:wordlift-plugin,代码行数:32,代码来源:wordlift_admin_ajax_related_posts.php
示例5: testimonial_rotator_add_columns
function testimonial_rotator_add_columns($column, $post_id)
{
$edit_link = get_edit_post_link($post_id);
$rotator_ids = testimonial_rotator_break_piped_string(get_post_meta($post_id, "_rotator_id", true));
$rotator_title_array = array();
foreach ($rotator_ids as $rotator_id) {
$rotator_title_array[] = "<a href='post.php?action=edit&post=" . $rotator_id . "'>" . get_the_title($rotator_id) . "</a>";
}
$this_testimonial = get_post($post_id);
if ($column == 'ID') {
echo implode(", ", $rotator_title_array);
}
if ($column == 'image') {
echo '<a href="' . $edit_link . '">' . get_the_post_thumbnail($post->ID, array(50, 50), array('title' => trim(strip_tags($post->post_title)))) . '</a>';
}
if ($column == 'order') {
echo '<a href="' . $edit_link . '">' . $this_testimonial->menu_order . '</a>';
}
if ($column == 'rating') {
echo get_post_meta($post_id, "_rating", true);
}
if ($column == 'shortcode') {
echo '<b>' . __('Display as Single', 'testimonial-rotator') . '</b><br />';
echo '[testimonial_single id="' . $post_id . '"]';
}
}
开发者ID:rosslibby,项目名称:davinaplugins,代码行数:26,代码来源:admin-functions.php
示例6: fnt_dashboard_widget
function fnt_dashboard_widget()
{
$clientid = '9f690b3117f0c43767528e2b60bc70ce';
$args = array('posts_per_page' => -1, 'offset' => 0, 'post_status' => array('publish', 'draft'), 'post_type' => 'tracks');
$errors = 0;
$query = new WP_Query($args);
while ($query->have_posts()) {
$query->the_post();
$id = get_the_ID();
$track_url = get_post_meta($id, 'track_url', true);
$errored = 0;
if (get_post_status() == 'draft') {
$errored = 1;
} else {
$soundcloud_url = 'https://api.soundcloud.com/resolve?url=' . $track_url . '&format=json&consumer_key=' . $clientid;
$track_json = file_get_contents($soundcloud_url);
$track = json_decode($track_json);
if ($track == null || isset($track->errors) && isset($track->errors[0]) && $track->errors[0]->error_message == '404 - Not Found' || $track->errors[0]->error_message == 'HTTP Error: 403') {
$errored = 1;
$update = array('ID' => $id, 'post_status' => 'draft');
wp_update_post($update);
}
}
if ($errored > 0) {
echo '<span style="color:red;">SC Track is private & won\'t play: </span> ' . '<a href="' . get_edit_post_link() . '" target="_blank">' . get_the_title() . '</a><br/>';
$errors++;
}
}
if ($errors > 0) {
echo '<br/><em>These ' . $errors . ' posts are all drafts, but should probably be fixed or removed.</em>';
} else {
echo 'There are no broken tracks! That is SHOCKING :)';
}
}
开发者ID:jacobraccuia,项目名称:dailybeatmedia,代码行数:34,代码来源:admin_functions.php
示例7: registerPostType
/**
* Registering a post type
*
* @param string $type slug of the type
* @param string $singular singular name
* @param string $plural plural name
* @param array $config can override the defaults of this function (array_merge)
*/
public static function registerPostType($type, $singular, $plural, $config = array())
{
$labels = array('name' => $plural, 'singular_name' => $singular, 'add_new' => 'Erstellen', 'add_new_item' => $singular . ' erfassen', 'edit_item' => 'Bearbeite ' . $singular, 'new_item' => 'Neues ' . $singular, 'view_item' => $singular . ' ansehen', 'search_items' => $singular . ' suchen', 'not_found' => 'Keine ' . $plural . ' gefunden', 'not_found_in_trash' => 'Keine ' . $plural . ' im Papierkorb gefunden', 'parent_item_colon' => '');
$defaults = array('labels' => $labels, 'public' => true, 'has_archive' => true, 'plural_view_adminbar' => false);
$arguments = array_merge_recursive_distinct($defaults, $config);
if (isset($arguments['plural_view_adminbar']) && $arguments['plural_view_adminbar']) {
add_action('admin_bar_menu', function ($wp_admin_bar) use($type, $arguments) {
$object = get_queried_object();
if ($object->name == $type) {
$title = $object->labels->menu_name;
if (is_admin()) {
$url = get_post_type_archive_link($type);
} else {
$url = get_admin_url(null, 'edit.php?post_type=' . $type);
}
}
if ($object->post_type == $type) {
if (!is_admin()) {
$url = get_edit_post_link($object->ID);
$title = $arguments['labels']['edit_item'];
}
}
// Add admin bar entry
if ($url) {
$wp_admin_bar->add_node(array('id' => 'custom-button', 'title' => $title, 'href' => $url));
}
}, 95);
}
register_post_type($type, $arguments);
}
开发者ID:blogwerk,项目名称:oop-theme-plugin,代码行数:38,代码来源:WordPress.php
示例8: pending_submission_send_email
function pending_submission_send_email($new_status, $old_status, $post)
{
// Notifiy Admin that Contributor has writen a post
if ($new_status == 'pending' && user_can($post->post_author, 'edit_posts') && !user_can($post->post_author, 'publish_posts')) {
$pending_submission_email = get_option('pending_submission_notification_admin_email');
$admins = get_option('admin_email');
$url = get_permalink($post->ID);
$edit_link = get_edit_post_link($post->ID, '');
$preview_link = get_permalink($post->ID) . '&preview=true';
$username = get_userdata($post->post_author);
$subject = 'Nou article pendent: "' . $post->post_title . '"';
$message = 'Un nou article per revisar.';
$message .= "\r\n\r\n";
$message .= "Autor: {$username->user_login}\r\n";
$message .= "Títol: {$post->post_title}";
$message .= "\r\n\r\n";
$message .= "Edita: {$edit_link}\r\n";
$message .= "Visualitza: {$preview_link}";
$result = wp_mail($admins, $subject, $message);
} else {
if ($old_status == 'pending' && $new_status == 'publish' && user_can($post->post_author, 'edit_posts') && !user_can($post->post_author, 'publish_posts')) {
$username = get_userdata($post->post_author);
$url = get_permalink($post->ID);
$subject = "El vostre article ha estat publicat:" . " " . $post->post_title;
$message = '"' . $post->post_title . '"' . " ha estat aprovat i publicat. \r\n";
$message .= $url;
$result = wp_mail($username->user_email, $subject, $message);
}
}
}
开发者ID:pausaura,项目名称:agora_nodes,代码行数:30,代码来源:pending-submission-notifications.php
示例9: appthemes_admin_quick_find_post
/**
* Quick find a post.
* @param object $wp_query A WP_Query object.
* @return void
*/
function appthemes_admin_quick_find_post($wp_query)
{
global $pagenow;
if ('edit.php' !== $pagenow) {
return;
}
if (empty($wp_query->query_vars['s'])) {
return;
}
$query = $wp_query->query_vars['s'];
if ('#' !== substr($query, 0, 1)) {
return;
}
$id = absint(substr($query, 1));
if (!$id) {
$wp_query->query_vars['s'] = 'Bad ID';
}
$post = get_post($id);
if ($post) {
$wp_query->query_vars['s'] = get_edit_post_link($id);
wp_redirect('post.php?action=edit&post=' . $id);
exit;
} else {
$wp_query->query_vars['s'] = 'Not Found';
}
}
开发者ID:kalushta,项目名称:darom,代码行数:31,代码来源:admin.php
示例10: jl_brd_dashboard_recent_drafts
function jl_brd_dashboard_recent_drafts($drafts = false)
{
if (!$drafts) {
$drafts_query = new WP_Query(array('post_type' => 'any', 'post_status' => array('draft', 'pending'), 'posts_per_page' => 150, 'orderby' => 'modified', 'order' => 'DESC'));
$drafts =& $drafts_query->posts;
}
if ($drafts && is_array($drafts)) {
$list = array();
foreach ($drafts as $draft) {
$url = get_edit_post_link($draft->ID);
$title = _draft_or_post_title($draft->ID);
$last_id = get_post_meta($draft->ID, '_edit_last', true);
$last_user = get_userdata($last_id);
$last_modified = '<i>' . esc_html($last_user->display_name) . '</i>';
$item = '<h4><a href="' . $url . '" title="' . sprintf(__('Edit ?%s?'), esc_attr($title)) . '">' . esc_html($title) . '</a>' . '<abbr> ' . $draft->post_status . ' ' . $draft->post_type . '</abbr>' . '<abbr style="display:block;margin-left:0;">' . sprintf(__('Last edited by %1$s on %2$s at %3$s'), $last_modified, mysql2date(get_option('date_format'), $draft->post_modified), mysql2date(get_option('time_format'), $draft->post_modified)) . '</abbr></h4>';
if ($the_content = preg_split('#\\s#', strip_shortcodes(strip_tags($draft->post_content), 11, PREG_SPLIT_NO_EMPTY))) {
$item .= '<p>' . join(' ', array_slice($the_content, 0, 10)) . (10 < count($the_content) ? '…' : '') . '</p>';
}
$list[] = $item;
}
?>
<ul>
<li><?php
echo join("</li>\n<li>", $list);
?>
</li>
</ul>
<?php
} else {
_e('There are no drafts at the moment');
}
}
开发者ID:aarontgrogg,项目名称:aarontgrogg,代码行数:32,代码来源:better-recent-drafts.php
示例11: render_orphans_row
function render_orphans_row($post, $classes)
{
$classes_string = implode(' ', $classes);
?>
<tr class="<?php
echo $classes_string;
?>
">
<td class="post-title">
<a href="<?php
echo get_edit_post_link($post->ID);
?>
"><?php
echo $post->post_title;
?>
</a>
</td>
<td class="post-is-parent">
<?php
echo $post->stage_children;
?>
</td>
<td class="post-trash">
<input name="post_id" type="hidden" value="<?php
echo $post->ID;
?>
">
<button class="button button-primary button-large">Trash</button>
</td>
</tr>
<?php
}
开发者ID:thetmkay,项目名称:stage-craft,代码行数:32,代码来源:posts-row.php
示例12: buddyblog_get_edit_url
/**
* Get the url of the Post for editing
* @param type $post_id
* @return type
*/
function buddyblog_get_edit_url($post_id = false)
{
$bp = buddypress();
$user_id = get_current_user_id();
if (!$user_id) {
return;
}
if (empty($post_id)) {
$post_id = get_the_ID();
}
//cheeck if current user can edit the post
$post = get_post($post_id);
//if the author of the post is same as the loggedin user or the logged in user is admin
if ($post->post_type != buddyblog_get_posttype()) {
return false;
}
if ($post->post_author != $user_id && !is_super_admin()) {
return;
}
$action_name = 'edit';
if (current_user_can(buddyblog_get_option('dashboard_edit_cap'))) {
return get_edit_post_link($post);
}
//if we are here, we can allow user to edit the post
return bp_core_get_user_domain($post->post_author) . $bp->buddyblog->slug . "/{$action_name}/" . $post->ID . '/';
}
开发者ID:poweronio,项目名称:mbsite,代码行数:31,代码来源:buddyblog-templates.php
示例13: ajax_redirect
/**
* Perform redirect depending on entity uri and target
*
* @since 3.2.0
*/
public function ajax_redirect()
{
if (!isset($_GET['uri'])) {
wp_die('Entity uri missing');
}
if (!isset($_GET['to'])) {
wp_die('Redirect target missing');
}
// Get the entity uri
$entity_uri = $_GET['uri'];
// Get the redirect target
$target = $_GET['to'];
if (null === ($entity_id = $this->entity_service->get_entity_post_by_uri($entity_uri))) {
wp_die('Entity not found');
}
switch ($target) {
case 'edit':
$redirect_url = get_edit_post_link($entity_id, 'none');
break;
case 'lod':
$redirect_url = self::LOD_ENDPOINT . '/lodview/?IRI=' . urlencode($entity_uri);
break;
case 'permalink':
$redirect_url = get_permalink($entity_id);
break;
default:
wp_die('Unsupported redirect target');
}
// Perform the redirect
wp_safe_redirect($redirect_url);
}
开发者ID:Byrlyne,项目名称:wordlift-plugin,代码行数:36,代码来源:class-wordlift-redirect-service.php
示例14: column_post_title
/** ************************************************************************
* Recommended. This is a custom column method and is responsible for what
* is rendered in any column with a name/slug of 'title'. Every time the class
* needs to render a column, it first looks for a method named
* column_{$column_title} - if it exists, that method is run. If it doesn't
* exist, column_default() is called instead.
*
* This example also illustrates how to implement rollover actions. Actions
* should be an associative array formatted as 'slug'=>'link html' - and you
* will need to generate the URLs yourself. You could even ensure the links
*
*
* @see WP_List_Table::::single_row_columns()
* @param array $item A singular item (one full row's worth of data)
* @return string Text to be placed inside the column <td> (movie title only)
**************************************************************************/
function column_post_title($item)
{
//Build row actions
$actions = array('edit_choices' => sprintf('<a href="#" class="edit-gd-choice-inline" id="edit-gd-choice-inline-%s" data-postid="%s">Edit Choices</a>', $item->ID, $item->ID), 'edit' => sprintf('<a href="%s">Edit Step</a>', get_edit_post_link($item->ID)), 'view' => sprintf('<a href="%s">View Step</a>', get_permalink($item->ID)), 'delete' => sprintf('<a href="?page=%s&action=%s&gd_list_progress_pt[]=%s">Delete</a>', $_REQUEST['page'], 'delete', $item->ID));
//Return the title contents
return sprintf('%1$s %2$s %3$s', '<span class="gd_post_title_editable" data-stepid="' . $item->ID . '">' . $item->post_title . '</span>', $this->row_actions($actions), $this->render_progress_pt_choice_form($item->ID));
}
开发者ID:rafdizzle86,项目名称:greatdiseases,代码行数:23,代码来源:gd-admin-progress-pts-table.php
示例15: render_comment
function render_comment(&$post, &$profile, &$parent)
{
require 'wp-content/language/lang_chooser.php';
//Loads the language-file
global $request;
$comments = "";
$comments .= '<hr />';
// $cctime = date( "g:i A" , strtotime($post->created) );
// $ccdate = date( get_settings('date_format'), strtotime($post->created) );
$ccurl = $request->url_for(array('resource' => 'posts', 'id' => $post->id));
$ccrurl = 'JavaScript:inline_comment(' . $post->id . ',' . $parent->id . ');';
$comments .= '<h4>';
$comments .= ' <span class="meta">';
// $comments .= $cctime.' <em>on</em> '.$ccdate;
$comments .= '<span class="actions">';
$comments .= '<a href="' . $ccurl . '">Permalink</a> | <a rel=\'nofollow\' class=\'comment-reply-link\' href="' . $ccrurl . '">' . $txt['wp_reply'] . '</a>';
if (get_profile_id() == $post->profile_id) {
$comments .= ' | <a href="' . get_edit_post_link($post) . '" class="post-edit-link" rel="' . $post->id . '">' . $txt['wp_Edit'] . '</a>';
$comments .= ' | <a href="' . get_edit_post_link($post, 'remove') . '" class="post-remove-link" rel="' . $post->id . '">' . $txt['wp_remove'] . '</a>';
}
$comments .= '</span>';
$comments .= '<br />';
$comments .= '<img alt=\'image\' src=\'' . profile_get_avatar($profile) . '\' class=\'avatar avatar-32\' height=\'32\' width=\'32\' />';
$comments .= '<a class="nick" href=\'' . base_path(true) . '' . $profile->nickname . '\'>' . $profile->nickname . '</a> ';
$comments .= laconica_time($post->created);
$comments .= '</span>';
$comments .= '</h4>';
$comments .= '<div class="commentcontent" id="commentcontent-' . $post->id . '">';
$comments .= '<p>' . render_notice($post->title, $post, $profile) . '</p>';
$comments .= '</div>';
return $comments;
}
开发者ID:Br3nda,项目名称:openmicroblogger,代码行数:32,代码来源:wp.php
示例16: jra_safe_to_delete_callback
function jra_safe_to_delete_callback()
{
global $wpdb;
// this is how you get access to the database
$sanitizedFile = sanitize_text_field($_POST['file']);
$file_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->postmeta} WHERE meta_value = %s", $sanitizedFile));
if (is_null($file_count)) {
echo "<h2 style=\"color: green; font-weight: bold;\">This file [{$sanitizedFile}] is safe to delete! Do it.</h2>";
} else {
if ($file_count < 1) {
echo "<h2 style=\"color: green; font-weight: bold;\">This file [{$sanitizedFile}] is safe to delete! Do it.</h2>";
} else {
echo "<h2 style=\"color: red; font-weight: bold;\">This file [{$sanitizedFile}] is not safe to delete!</h2>";
echo "<p>{$sanitizedFile} is used {$file_count} time";
if ($file_count != 1) {
echo "s";
}
echo ":</p><ul style=\"margin-left: 0.5em;\">";
$items = $wpdb->get_col($wpdb->prepare("SELECT ALL post_id FROM {$wpdb->postmeta} WHERE meta_value = %s", $sanitizedFile));
foreach ($items as $item) {
echo "<li><h3 style=\"display: inline-block; margin: 0 0 0.5em 0\">- " . get_the_title($item) . "</h3><p style=\"text-indent: 0.5em; display: inline-block; margin: 0 0 0.5em 0\"> <a href=\"" . get_permalink($item) . "\">View</a> | <a href=\"" . get_edit_post_link($item) . "\">Edit</a></p></li>";
}
echo "</ul>";
}
}
wp_die();
// this is required to terminate immediately and return a proper response
}
开发者ID:jrandyanderson,项目名称:safe-to-delete,代码行数:28,代码来源:safe-to-delete.php
示例17: auto_post_twfc
function auto_post_twfc($post_ID)
{
$post_title = get_the_title($post_ID);
// titulo do post
$post_url = get_permalink($post_ID);
// url da post
$redirect_uri = get_edit_post_link();
// url de retorno / url do post
// Imagem usada na postagem das redes sociais
$imgRedes = get_post_meta($post_ID, 'imagemredes', true) ? get_post_meta($post_ID, 'imagemredes', true) : urlBase() . '/images/banners/posts/banner_post_redes.jpg';
// pega os dados do post
$postpp = get_post($post_ID);
$post_description = strip_tags($postpp->post_content);
// conteudo do post
// array com o conteudo do post
$array = array('titulo' => $post_title, 'url' => $post_url, 'redirect' => $redirect_uri, 'imagem' => $imgRedes, 'conteudo' => $post_description);
// inclui o arquivo para iniciar as classes facebook
require_once FC_PATH . 'twfcfacebook.php';
$postFace = new Twfcfacebook();
$postFace->postFacebook($array);
// inclui o arquivo para iniciar as classes twiiter
require_once TW_PATH . 'twfctwitter.php';
$postTwitter = new Twfctwitter();
$postTwitter->postTwitter($array);
}
开发者ID:reinaldorodrigues,项目名称:twfc-post,代码行数:25,代码来源:twfc-post.php
示例18: html
/**
* Get field HTML
*
* @param string $html
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html($html, $meta, $field)
{
global $wpdb;
$i18n_msg = _x('Uploaded files', 'image upload', RWMB_TEXTDOMAIN);
$i18n_del_file = _x('Delete this file', 'image upload', RWMB_TEXTDOMAIN);
$i18n_delete = _x('Delete', 'image upload', RWMB_TEXTDOMAIN);
$i18n_edit = _x('Edit', 'image upload', RWMB_TEXTDOMAIN);
$i18n_title = _x('Upload files', 'image upload', RWMB_TEXTDOMAIN);
$i18n_more = _x('Add another file', 'image upload', RWMB_TEXTDOMAIN);
$html = wp_nonce_field("rwmb-delete-file_{$field['id']}", "nonce-delete-file_{$field['id']}", false, false);
$html .= wp_nonce_field("rwmb-reorder-images_{$field['id']}", "nonce-reorder-images_{$field['id']}", false, false);
$html .= "<input type='hidden' class='field-id' value='{$field['id']}' />";
// Uploaded images
if (!empty($meta)) {
$html .= "<h4>{$i18n_msg}</h4>";
$html .= "<ul class='rwmb-images rwmb-uploaded'>";
foreach ($meta as $image) {
$src = wp_get_attachment_image_src($image, 'thumbnail');
$src = $src[0];
$link = get_edit_post_link($image);
$html .= "<li id='item_{$image}'>\n\t\t\t\t\t\t<img src='{$src}' />\n\t\t\t\t\t\t<div class='rwmb-image-bar'>\n\t\t\t\t\t\t\t<a title='{$i18n_edit}' class='rwmb-edit-file' href='{$link}' target='_blank'>{$i18n_edit}</a> |\n\t\t\t\t\t\t\t<a title='{$i18n_del_file}' class='rwmb-delete-file' href='#' rel='{$image}'>{$i18n_delete}</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>";
}
$html .= '</ul>';
}
// Show form upload
$html .= "\n\t\t\t<h4>{$i18n_title}</h4>\n\t\t\t<div class='new-files'>\n\t\t\t\t<div class='file-input'><input type='file' name='{$field['id']}[]' /></div>\n\t\t\t\t<a class='rwmb-add-file' href='#'>{$i18n_more}</a>\n\t\t\t</div>";
return $html;
}
开发者ID:hunghoang179,项目名称:sitenews,代码行数:37,代码来源:image.php
示例19: admin_settings
function admin_settings()
{
echo '<div class="wrap"><h1>' . get_admin_page_title() . '</h1>';
$count_methods = array('public' => array('name' => __('Top %s posts', 'wpupostviews'), 'orig' => false), 'orig' => array('name' => __('Real top %s posts', 'wpupostviews'), 'orig' => true));
foreach ($count_methods as $method) {
$top_posts = $this->get_top_posts(false, $method['orig']);
if (!empty($top_posts)) {
echo '<hr />';
echo '<h2>' . sprintf($method['name'], $this->options['default_top']) . '</h2>';
echo '<ol>';
foreach ($top_posts as $tp) {
echo '<li><a href="' . get_edit_post_link($tp->ID) . '"><strong>' . esc_attr($tp->post_title) . '</strong></a> (' . get_post_meta($tp->ID, 'wpupostviews_' . ($method['orig'] ? 'orig_' : '') . 'nbviews', 1) . ')</li>';
}
echo '</ol>';
}
}
echo '<hr />';
echo '<h2>' . __('Settings') . '</h2>';
echo '<form action="options.php" method="post">';
settings_fields($this->settings_details['option_id']);
do_settings_sections($this->options['plugin_id']);
echo submit_button(__('Save Changes', 'wpupostviews'));
echo '</form>';
echo '</div>';
}
开发者ID:WordPressUtilities,项目名称:wpupostviews,代码行数:25,代码来源:wpupostviews.php
示例20: ceo_display_edit_link
function ceo_display_edit_link()
{
global $post;
if ($post->post_type == 'comic' && current_user_can('edit_post', $post->ID)) {
echo '<a href="' . get_edit_post_link() . '">' . __('Edit Comic.', 'comiceasel') . "</a><br />\r\n";
}
}
开发者ID:egypturnash,项目名称:comic-easel,代码行数:7,代码来源:injections.php
注:本文中的get_edit_post_link函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论