コード例 #1
0
function task_updated_messages($messages)
{
    global $post, $post_ID;
    $titlewarning = "";
    // check for 'ing' in the first word
    if (strpos(get_the_title($post_ID), "ing ") != 0 && strpos(get_the_title($post_ID), " ") > strpos(get_the_title($post_ID), "ing ") || strpos(strtolower(get_the_title($post_ID)), "ing ") === 0) {
        $titlewarning .= "<br><span class='dashicons dashicons-info' style='color: red;'></span> <strong>Could you shorten your title by removing 'ing'? e.g. instead of 'Writing a speech' change to 'Write a speech'</strong>";
    }
    // check for 'how to' at the start
    if (strpos(strtolower(get_the_title($post_ID)), "how to") === 0) {
        $titlewarning .= "<br><span class='dashicons dashicons-info' style='color: red;'></span> <strong>Could you shorten your title by removing 'how to'?</strong>";
    }
    // check for 'my' at the start
    if (strpos(strtolower(get_the_title($post_ID)), "my") === 0) {
        $titlewarning .= "<br><span class='dashicons dashicons-info' style='color: red;'></span> <strong>Are you talking to your reader? Could you use 'your' instead of 'my'?</strong>";
    }
    if (strpos(strtolower(get_the_title($post_ID)), " my ") != 0) {
        $titlewarning .= "<br><span class='dashicons dashicons-info' style='color: red;'></span> <strong>Are you talking to your reader? Could you use 'your' instead of 'my'?</strong>";
    }
    if (!get_the_terms($id, 'category')) {
        $titlewarning .= "<br><span class='dashicons dashicons-info' style='color: red;'></span> <strong>Remember to assign a category.</strong>";
    }
    $messages['task'] = array(0 => '', 1 => sprintf(__('Task updated. <a href="%s">View task</a>%s'), esc_url(get_permalink($post_ID)), $titlewarning), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => __('Task updated.'), 5 => isset($_GET['revision']) ? sprintf(__('Task restored to revision from %s'), wp_post_revision_title((int) $_GET['revision'], false), $titlewarning) : false, 6 => sprintf(__('Task published. <a href="%s">View task</a>%s'), esc_url(get_permalink($post_ID)), $titlewarning), 7 => __('Task saved.'), 8 => sprintf(__('Task submitted. <a target="_blank" href="%s">Preview task</a>%s'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $titlewarning), 9 => sprintf(__('Task scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview task</a>%s'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), $titlewarning), 10 => sprintf(__('Task draft updated. <a target="_blank" href="%s">Preview task</a>%s'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $titlewarning));
    return $messages;
}
コード例 #2
0
 public function updated_messages($messages)
 {
     global $post, $post_ID;
     $instagrate_messages = array(0 => '', 1 => __('Account updated.', 'instagrate-pro'), 2 => __('Custom field updated.', 'instagrate-pro'), 3 => __('Custom field deleted.', 'instagrate-pro'), 4 => __('Account updated.', 'instagrate-pro'), 5 => isset($_GET['revision']) ? sprintf(__('Account restored to revision from %s', 'instagrate-pro'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('Account published.', 'instagrate-pro'), 7 => __('Account saved.', 'instagrate-pro'), 8 => __('Account submitted.', 'instagrate-pro'), 9 => sprintf(__('Account scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Account</a>', 'instagrate-pro'), date_i18n(__('M j, Y @ G:i', 'instagrate-pro'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => __('Account draft updated.', 'instagrate-pro'), 11 => __('Instagram account connected.', 'instagrate-pro'), 12 => __('Instagram account disconnected.', 'instagrate-pro'), 13 => __('You did not authorise your Instagram account with this plugin.', 'instagrate-pro'), 14 => __('Account duplicated.', 'instagrate-pro'), 15 => __('Likes have been synced for this account successfully.', 'instagrate-pro'), 16 => __('Comments have been synced for this account successfully.', 'instagrate-pro'));
     $messages[$this->post_type] = $instagrate_messages;
     return $messages;
 }
コード例 #3
0
ファイル: qqp_cpt.php プロジェクト: srolland/dev
 function cpt_updated_messages($messages)
 {
     global $post, $post_ID;
     $name = $this->args['ctp_args']['labels']['singular_name'];
     $messages[$this->args['name']] = array(0 => '', 1 => sprintf(__('%s updated. <a href="%s">View %s</a>'), $name, esc_url(get_permalink($post_ID)), $name), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => sprintf(__('$s updated.'), $name), 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s'), $name, wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('%s published. <a href="%s">Preview %s</a>'), $name, esc_url(get_permalink($post_ID)), $name), 7 => sprintf(__('%s saved.'), $name), 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>'), $name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $name), 9 => sprintf(__('%s scheduled for: <strong>%s</strong>. <a target="_blank" href="%s">Preview %s</a>'), $name, date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), $name), 10 => sprintf(__('%s draft updated. <a target="_blank" href="%s">Preview %s</a>'), $name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $name));
     return $messages;
 }
コード例 #4
0
function glossary_updated_messages($messages)
{
    global $post;
    $permalink = get_permalink($post);
    $messages['glossary-term'] = array(0 => '', 1 => sprintf(__('Glossary term updated. <a target="_blank" href="%s">View Glossary term</a>', 'claire-jacquinod-plugin'), esc_url($permalink)), 2 => __('Custom field updated.', 'claire-jacquinod-plugin'), 3 => __('Custom field deleted.', 'claire-jacquinod-plugin'), 4 => __('Glossary term updated.', 'claire-jacquinod-plugin'), 5 => isset($_GET['revision']) ? sprintf(__('Glossary term restored to revision from %s', 'claire-jacquinod-plugin'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Glossary term published. <a href="%s">View Glossary term</a>', 'claire-jacquinod-plugin'), esc_url($permalink)), 7 => __('Glossary term saved.', 'claire-jacquinod-plugin'), 8 => sprintf(__('Glossary term submitted. <a target="_blank" href="%s">Preview Glossary term</a>', 'claire-jacquinod-plugin'), esc_url(add_query_arg('preview', 'true', $permalink))), 9 => sprintf(__('Glossary term scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Glossary term</a>', 'claire-jacquinod-plugin'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url($permalink)), 10 => sprintf(__('Glossary term draft updated. <a target="_blank" href="%s">Preview Glossary term</a>', 'claire-jacquinod-plugin'), esc_url(add_query_arg('preview', 'true', $permalink))));
    return $messages;
}
コード例 #5
0
/**
 * Discography update messages.
 *
 * @since 1.0.0
 * @see /wp-admin/edit-form-advanced.php
 *
 * @param array $messages The array of existing post update messages.
 * @return array
 */
function audiotheme_discography_post_updated_messages($messages)
{
    global $post;
    $messages['audiotheme_record'] = array(0 => '', 1 => sprintf(__('Record updated. <a href="%s">View Record</a>', 'audiotheme'), esc_url(get_permalink($post->ID))), 2 => __('Custom field updated.', 'audiotheme'), 3 => __('Custom field deleted.', 'audiotheme'), 4 => __('Record updated.', 'audiotheme'), 5 => isset($_GET['revision']) ? sprintf(__('Record restored to revision from %s', 'audiotheme'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Record published. <a href="%s">View Record</a>', 'audiotheme'), esc_url(get_permalink($post->ID))), 7 => __('Record saved.', 'audiotheme'), 8 => sprintf(__('Record submitted. <a target="_blank" href="%s">Preview Record</a>', 'audiotheme'), esc_url(add_query_arg('preview', 'true', get_permalink($post->ID)))), 9 => sprintf(__('Record scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Record</a>', 'audiotheme'), date_i18n(__('M j, Y @ G:i', 'audiotheme'), strtotime($post->post_date)), esc_url(get_permalink($post->ID))), 10 => sprintf(__('Record draft updated. <a target="_blank" href="%s">Preview Record</a>', 'audiotheme'), esc_url(add_query_arg('preview', 'true', get_permalink($post->ID)))));
    $messages['audiotheme_track'] = array(0 => '', 1 => sprintf(__('Track updated. <a href="%s">View Track</a>', 'audiotheme'), esc_url(get_permalink($post->ID))), 2 => __('Custom field updated.', 'audiotheme'), 3 => __('Custom field deleted.', 'audiotheme'), 4 => __('Track updated.', 'audiotheme'), 5 => isset($_GET['revision']) ? sprintf(__('Track restored to revision from %s', 'audiotheme'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Track published. <a href="%s">View Track</a>', 'audiotheme'), esc_url(get_permalink($post->ID))), 7 => __('Track saved.', 'audiotheme'), 8 => sprintf(__('Track submitted. <a target="_blank" href="%s">Preview Track</a>', 'audiotheme'), esc_url(add_query_arg('preview', 'true', get_permalink($post->ID)))), 9 => sprintf(__('Track scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Track</a>', 'audiotheme'), date_i18n(__('M j, Y @ G:i', 'audiotheme'), strtotime($post->post_date)), esc_url(get_permalink($post->ID))), 10 => sprintf(__('Track draft updated. <a target="_blank" href="%s">Preview Track</a>', 'audiotheme'), esc_url(add_query_arg('preview', 'true', get_permalink($post->ID)))));
    return $messages;
}
コード例 #6
0
 /**
  * Customize post type updated messages.
  * @param $messages
  * @return mixed
  */
 function cpt_updated_messages($messages)
 {
     global $post, $post_ID;
     $view = get_permalink($post_ID);
     $messages[$this->slug] = array(0 => '', 1 => sprintf(__('%s updated. <a href="%s">View %s</a>.', 'themify'), $this->name, esc_url($view), $this->name), 2 => __('Custom field updated.', 'themify'), 3 => __('Custom field deleted.', 'themify'), 4 => sprintf(__('%s updated.', 'themify'), $this->name), 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'themify'), $this->name, wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('%s published.', 'themify'), $this->name), 7 => sprintf(__('%s saved.', 'themify'), $this->name), 8 => sprintf(__('%s submitted.', 'themify'), $this->name), 9 => sprintf(__('%s scheduled for: <strong>%s</strong>.', 'themify'), $this->name, date_i18n(__('M j, Y @ G:i', 'themify'), strtotime($post->post_date))), 10 => sprintf(__('%s draft updated.', 'themify'), $this->name));
     return $messages;
 }
コード例 #7
0
 /**
  * カスタム投稿タイプのメッセージ設定
  */
 public function wpes_updated_messages($messages)
 {
     global $post;
     $setting = $this->setting;
     $messages[$setting['post_type']] = array(0 => "", 1 => sprintf(__('%sを更新しました <a href="%s">記事を見る</a>'), $setting['name'], esc_url(get_permalink($post->ID))), 2 => __('カスタムフィールドを更新しました'), 3 => __('カスタムフィールドを削除しました'), 4 => sprintf(__('%s更新'), $setting['name']), 5 => isset($_GET['revision']) ? sprintf(__(' %s 前に%sを保存しました'), wp_post_revision_title((int) $_GET['revision'], false), $setting['name']) : false, 6 => sprintf(__('%sが公開されました <a href="%s">記事を見る</a>'), $setting['name'], esc_url(get_permalink($post->ID))), 7 => sprintf(__('%s記事を保存'), $setting['name']), 8 => sprintf(__('%s記事を送信 <a target="_blank" href="%s">プレビュー</a>'), $setting['name'], esc_url(add_query_arg('preview', 'true', get_permalink($post->ID)))), 9 => sprintf(__('%sを予約投稿しました: <strong>%s</strong>. <a target="_blank" href="%s">プレビュー</a>'), $setting['name'], date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post->ID))), 10 => sprintf(__('%sの下書きを更新しました <a target="_blank" href="%s">プレビュー</a>'), $setting['name'], esc_url(add_query_arg('preview', 'true', get_permalink($post->ID)))));
     return $messages;
 }
コード例 #8
0
 /**
  * TODO: This is just generic from the wp-cli scaffold, make it work
  *
  * @author caseypatrickdriscoll
  *
  * @created 2015-07-18 15:07:07
  *
  * @param $messages
  *
  * @return mixed
  */
 public static function updated_messages($messages)
 {
     global $post;
     $permalink = get_permalink($post);
     $messages['patchchat'] = array(0 => '', 1 => sprintf(__('Patchchat updated. <a target="_blank" href="%s">View patchchat</a>', 'patchworks'), esc_url($permalink)), 2 => __('Custom field updated.', 'patchworks'), 3 => __('Custom field deleted.', 'patchworks'), 4 => __('Patchchat updated.', 'patchworks'), 5 => isset($_GET['revision']) ? sprintf(__('Patchchat restored to revision from %s', 'patchworks'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Patchchat published. <a href="%s">View patchchat</a>', 'patchworks'), esc_url($permalink)), 7 => __('Patchchat saved.', 'patchworks'), 8 => sprintf(__('Patchchat submitted. <a target="_blank" href="%s">Preview patchchat</a>', 'patchworks'), esc_url(add_query_arg('preview', 'true', $permalink))), 9 => sprintf(__('Patchchat scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview patchchat</a>', 'patchworks'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url($permalink)), 10 => sprintf(__('Patchchat draft updated. <a target="_blank" href="%s">Preview patchchat</a>', 'patchworks'), esc_url(add_query_arg('preview', 'true', $permalink))));
     return $messages;
 }
コード例 #9
0
function portfolio_messages($messages)
{
    global $post;
    $post_ID = $post->ID;
    $messages[__('portfolio')] = array(0 => '', 1 => sprintf(__('Portfolio Updated. <a href="%s">View portfolio</a>'), esc_url(get_permalink($post_ID))), 2 => __('Custom Field Updated.'), 3 => __('Custom Field Deleted.'), 4 => __('Portfolio Updated.'), 5 => isset($_GET['revision']) ? sprintf(__('Portfolio Restored To Revision From %s'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Portfolio Published. <a href="%s">View Portfolio</a>'), esc_url(get_permalink($post_ID))), 7 => __('Portfolio Saved.'), 8 => sprintf(__('Portfolio Submitted. <a target="_blank" href="%s">Preview Portfolio</a>'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Portfolio Scheduled For: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Portfolio</a>'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Portfolio Draft Updated. <a target="_blank" href="%s">Preview Portfolio</a>'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
    return $messages;
}
コード例 #10
0
 /**
  * Customizing the messages for control post type.
  *
  * @since    1.0
  * @access   public
  */
 public function updated_messages($messages)
 {
     $post = get_post();
     $post_type = get_post_type($post);
     $messages['awf_font_control'] = array(0 => '', 1 => __('Control updated. Please visit the Customizer to manage this control.', $this->plugin_name), 2 => __('Control updated.', $this->plugin_name), 3 => __('Control deleted.', $this->plugin_name), 4 => __('Control updated. Please visit the Customizer to manage this control.', $this->plugin_name), 5 => isset($_GET['revision']) ? sprintf('Control restored to revision from %s', wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('Control published. Please visit the Customizer to manage this control.', $this->plugin_name), 7 => __('Control saved. Please visit the Customizer to manage this control.', $this->plugin_name), 8 => __('Control submitted. Please visit the Customizer to manage this control.', $this->plugin_name), 9 => sprintf('Control scheduled for: <strong>%1$s</strong>.', date_i18n('M j, Y @ G:i', strtotime($post->post_date))), 10 => 'Control draft updated.');
     return $messages;
 }
コード例 #11
0
ファイル: portfolio-post-type.php プロジェクト: shimion/git
function portfolio_updated_messages($messages)
{
    $post_ID = "";
    $post = "";
    $messages['portfolio'] = array(0 => '', 1 => sprintf(__('Portfolio Item updated. <a href="%s">View portfolio item</a>'), esc_url(get_permalink($post_ID))), 2 => __('Custom field updated.', 'ocmx'), 3 => __('Custom field deleted.', 'ocmx'), 4 => __('Product updated.', 'ocmx'), 5 => isset($_GET['revision']) ? sprintf(__('Product restored to revision from %s', 'ocmx'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Portfolio Item published. <a href="%s">View portfolio item</a>', 'ocmx'), esc_url(get_permalink($post_ID))), 7 => __('Product saved.'), 8 => sprintf(__('Portfolio Item submitted. <a target="_blank" href="%s">Preview portfolio item</a>', 'ocmx'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Portfolio Item draft updated. <a target="_blank" href="%s">Preview portfolio item</a>', 'ocmx'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
    return $messages;
}
コード例 #12
0
ファイル: admin.php プロジェクト: yarylo/cerkva.pp.ua
function new_accordion_menu_messages($messages)
{
    global $post, $post_ID;
    add_action('wp_before_admin_bar_render', 'nextend_remove_custompost_type_view_admin_bar');
    $messages['accordion_menu'] = array(0 => '', 1 => __('Accordion Menu configuration updated.'), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => __('Accordion Menu configuration updated.'), 5 => isset($_GET['revision']) ? sprintf(__('Accordion Menu configuration restored to revision from %s'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('Accordion Menu published.'), 7 => __('Accordion Menu configuration saved.'), 8 => __('Accordion Menu submitted.'), 9 => sprintf(__('Accordion Menu scheduled for: <strong>%1$s</strong>.'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date))), 10 => __('Accordion Menu configuration draft updated.'));
    return $messages;
}
コード例 #13
0
function team_members_updated_messages($messages)
{
    global $post;
    $permalink = get_permalink($post);
    $messages['team-members'] = array(0 => '', 1 => sprintf(__('Team members updated. <a target="_blank" href="%s">View team members</a>', 'greenwichmarketinggroup'), esc_url($permalink)), 2 => __('Custom field updated.', 'greenwichmarketinggroup'), 3 => __('Custom field deleted.', 'greenwichmarketinggroup'), 4 => __('Team members updated.', 'greenwichmarketinggroup'), 5 => isset($_GET['revision']) ? sprintf(__('Team member restored to revision from %s', 'greenwichmarketinggroup'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Team members published. <a href="%s">View team members</a>', 'greenwichmarketinggroup'), esc_url($permalink)), 7 => __('Team member saved.', 'greenwichmarketinggroup'), 8 => sprintf(__('Team member submitted. <a target="_blank" href="%s">Preview team members</a>', 'greenwichmarketinggroup'), esc_url(add_query_arg('preview', 'true', $permalink))), 9 => sprintf(__('Team member scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview team member</a>', 'greenwichmarketinggroup'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url($permalink)), 10 => sprintf(__('Team member draft updated. <a target="_blank" href="%s">Preview team member</a>', 'greenwichmarketinggroup'), esc_url(add_query_arg('preview', 'true', $permalink))));
    return $messages;
}
コード例 #14
0
 public function updated_messages($messages)
 {
     global $post, $post_ID;
     //************** change name here*********************
     $messages['TYPE_NAME'] = array(0 => '', 1 => sprintf(__('TYPE_NAME updated. <a href="%s">View TYPE_NAME</a>'), esc_url(get_permalink($post_ID))), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => __('TYPE_NAME updated.'), 5 => isset($_GET['revision']) ? sprintf(__('TYPE_NAME restored to revision from %s'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('TYPE_NAME published. <a href="%s">View TYPE_NAME</a>'), esc_url(get_permalink($post_ID))), 7 => __('TYPE_NAME saved.'), 8 => sprintf(__('TYPE_NAME submitted. <a target="_blank" href="%s">Preview TYPE_NAME</a>'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('TYPE_NAME scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview TYPE_NAME</a>'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('TYPE_NAME draft updated. <a target="_blank" href="%s">Preview TYPE_NAME</a>'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
     return $messages;
 }
コード例 #15
0
ファイル: class-posttypes.php プロジェクト: RA2WP/RA2WP
 /**
  * Customize the update messages for a gallery
  *
  * @global object $post     The current post object.
  *
  * @param array   $messages Array of default post updated messages.
  *
  * @return array $messages Amended array of post updated messages.
  */
 public function update_messages($messages)
 {
     global $post;
     // Add our gallery messages
     $messages[FOOGALLERY_CPT_GALLERY] = apply_filters('foogallery_gallery_posttype_update_messages', array(0 => '', 1 => __('Gallery updated.', 'foogallery'), 2 => __('Gallery custom field updated.', 'foogallery'), 3 => __('Gallery custom field deleted.', 'foogallery'), 4 => __('Gallery updated.', 'foogallery'), 5 => isset($_GET['revision']) ? sprintf(__('Gallery restored to revision from %s.', 'foogallery'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('Gallery published.', 'foogallery'), 7 => __('Gallery saved.', 'foogallery'), 8 => __('Gallery submitted.', 'foogallery'), 9 => sprintf(__('Gallery scheduled for: <strong>%1$s</strong>.', 'foogallery'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date))), 10 => __('Gallery draft updated.', 'foogallery')));
     return $messages;
 }
コード例 #16
0
function cpt_savedsearch_messages($messages)
{
    //http://codex.wordpress.org/Function_Reference/register_post_type
    global $post, $post_ID;
    $messages['savedsearch'] = array(0 => '', 1 => sprintf(__('Saved search Post updated.', 'your_text_domain'), esc_url(get_permalink($post_ID))), 2 => __('Saved searche updated.', 'your_text_domain'), 3 => __('Saved search deleted.', 'your_text_domain'), 4 => __('Saved search Post updated.', 'your_text_domain'), 5 => isset($_GET['revision']) ? sprintf(__('Saved search Post restored to revision from %s', 'your_text_domain'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Saved search Post published. <a href="%s">View Saved search Post</a>', 'your_text_domain'), esc_url(get_permalink($post_ID))), 7 => __('Saved search Post saved.', 'your_text_domain'), 8 => sprintf(__('Saved search Post submitted. <a target="_blank" href="%s">Preview Saved search Post</a>', 'your_text_domain'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Saved search Post scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Saved search Post</a>', 'your_text_domain'), date_i18n(__('M j, Y @ G:i', 'tn_'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Saved search Post draft updated. <a target="_blank" href="%s">Preview Saved search Post</a>', 'your_text_domain'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
    return $messages;
}
コード例 #17
0
ファイル: article-post-type.php プロジェクト: dregula/Annotum
/**
 * Display custom messages for articles. Based on WP high 3.1.2
 */
function anno_post_updated_messages($messages)
{
    global $post;
    // Based on message code in WP high 3.2
    $messages['article'] = array(0 => '', 1 => sprintf(_x('Article updated. <a href="%s">View article</a>', 'Article updated message', 'anno'), esc_url(get_permalink($post->ID))), 2 => _x('Custom field updated.', 'Article updated message', 'anno'), 3 => _x('Custom field deleted.', 'Article updated message', 'anno'), 4 => _x('Article updated.', 'Article updated message', 'anno'), 5 => isset($_GET['revision']) ? sprintf(_x('Article restored to revision from %s', 'Article updated message', 'anno'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(_x('Article published. <a href="%s">View article</a>', 'Article updated message', 'anno'), esc_url(get_permalink($post->ID))), 7 => _x('Article saved.', 'Article updated message', 'anno'), 8 => sprintf(_x('Article submitted. <a target="_blank" href="%s">Preview article</a>', 'Article updated message', 'anno'), esc_url(add_query_arg('preview', 'true', get_permalink($post->ID)))), 9 => sprintf(_x('Article scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview article</a>', 'Article updated message', 'anno'), date_i18n(_x('M j, Y @ G:i', 'Article updated future time format', 'anno'), strtotime($post->post_date)), esc_url(get_permalink($post->ID))), 10 => sprintf(_x('Article draft updated. <a target="_blank" href="%s">Preview article</a>', 'Article updated message', 'anno'), esc_url(add_query_arg('preview', 'true', get_permalink($post->ID)))), 11 => _x('Article successfully cloned.', 'Article updated message', 'anno'), 12 => _x('Unable to clone article.', 'Article updated message', 'anno'), 13 => _x('Article unpublished; there was an error in validation.', 'Article updated message', 'anno'));
    return $messages;
}
コード例 #18
0
 /**
  * Change messages when a post type is updated.
  * @param  array $messages
  * @return array
  */
 public function post_updated_messages($messages)
 {
     global $post, $post_ID;
     $messages['food_menu'] = array(0 => '', 1 => sprintf(__('Menu Item updated. <a href="%s">View Menu Item</a>', 'restaurantpress'), esc_url(get_permalink($post_ID))), 2 => __('Custom field updated.', 'restaurantpress'), 3 => __('Custom field deleted.', 'restaurantpress'), 4 => __('Menu Item updated.', 'restaurantpress'), 5 => isset($_GET['revision']) ? sprintf(__('Menu Item restored to revision from %s', 'restaurantpress'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Menu Item published. <a href="%s">View Menu Item</a>', 'restaurantpress'), esc_url(get_permalink($post_ID))), 7 => __('Menu Item saved.', 'restaurantpress'), 8 => sprintf(__('Menu Item submitted. <a target="_blank" href="%s">Preview Menu Item</a>', 'restaurantpress'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Menu Item scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Menu Item</a>', 'restaurantpress'), date_i18n(__('M j, Y @ G:i', 'restaurantpress'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Menu Item draft updated. <a target="_blank" href="%s">Preview Menu Item</a>', 'restaurantpress'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
     $messages['food_group'] = array(0 => '', 1 => __('Group updated.', 'restaurantpress'), 2 => __('Custom field updated.', 'restaurantpress'), 3 => __('Custom field deleted.', 'restaurantpress'), 4 => __('Group updated.', 'restaurantpress'), 5 => isset($_GET['revision']) ? sprintf(__('Group restored to revision from %s', 'restaurantpress'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('Group updated.', 'restaurantpress'), 7 => __('Group saved.', 'restaurantpress'), 8 => __('Group submitted.', 'restaurantpress'), 9 => sprintf(__('Group scheduled for: <strong>%1$s</strong>.', 'restaurantpress'), date_i18n(__('M j, Y @ G:i', 'restaurantpress'), strtotime($post->post_date))), 10 => __('Group draft updated.', 'restaurantpress'));
     return $messages;
 }
コード例 #19
0
 public function __construct($base)
 {
     $this->base = $base;
     $this->admin = $base->admin;
     $this->orig_referer = wp_get_original_referer();
     if (isset($_GET['message'])) {
         $this->message = intval($_GET['message']);
         if ($this->message == 1 && !$this->orig_referer) {
             $this->message = 4;
         }
     }
     $this->messages[1] = sprintf(__('Page updated. Continue editing below or <a href="%s">go back</a>.', 'ktai_style'), esc_attr($this->orig_referer));
     $this->messages[2] = __('Custom field updated.', 'ktai_style');
     $this->messages[3] = __('Custom field deleted.', 'ktai_style');
     $this->messages[4] = __('Page updated.', 'ktai_style');
     $this->messages[5] = __('Page published.', 'ktai_style');
     $this->messages[6] = __('Page submitted.', 'ktai_style');
     if (isset($_GET['revision'])) {
         $this->messages[5] = sprintf(__('Page restored to revision from %s'), wp_post_revision_title((int) $_GET['revision'], false));
     }
     $this->notices[1] = __('There is an autosave of this page that is more recent than the version below.  <a href="%s">View the autosave</a>.');
     global $post_ID, $temp_ID;
     $post_ID = isset($post_ID) ? intval($post_ID) : 0;
     $temp_ID = isset($temp_ID) ? intval($temp_ID) : 0;
 }
コード例 #20
0
function wpv_post_updated_messages_filter($messages)
{
    global $post;
    $post_type = get_post_type();
    // DEPRECATED
    // We have now our own edit pages, so this is not fired anymore
    // Commented out in 1.7
    /*
    if ( $post_type == 'view' ) {
    	$messages['view'] = array(
    		0 => '', // Unused. Messages start at index 1.
    		1 => __('View updated.', 'wpv-views'),
    		2 => __('Custom field updated.'),
    		3 => __('Custom field deleted.'),
    		4 => __('View updated.', 'wpv-views'),
    		5 => isset($_GET['revision']) ? sprintf( __('View restored to revision from %s', 'wpv-views'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
    		6 => __('View published.', 'wpv-views'),
    		7 => __('View saved.', 'wpv-views'),
    		8 => __('View submitted.', 'wpv-views'),
    		9 => sprintf( __('View scheduled for: <strong>%1$s</strong>.', 'wpv-views'),
    			// translators: Publish box date format, see http://php.net/date
    			date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ) ),
    		10 => __('View draft updated', 'wpv-views'),
    		);
    }
    */
    if ($post_type == 'view-template') {
        $messages['view-template'] = array(0 => '', 1 => __('Content template updated.', 'wpv-views'), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => __('Content template updated.', 'wpv-views'), 5 => isset($_GET['revision']) ? sprintf(__('Content template restored to revision from %s', 'wpv-views'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('Content template published.', 'wpv-views'), 7 => __('Content template saved.', 'wpv-views'), 8 => __('Content template submitted.', 'wpv-views'), 9 => sprintf(__('Content template scheduled for: <strong>%1$s</strong>.', 'wpv-views'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date))), 10 => __('Content template draft updated', 'wpv-views'));
    }
    return $messages;
}
コード例 #21
0
ファイル: plugin.php プロジェクト: cliffordp/simple-urls
 function register_post_type()
 {
     $slug = 'surl';
     $labels = array('name' => __('Simple URLs', 'simple-urls'), 'singular_name' => __('URL', 'simple-urls'), 'add_new' => __('Add New', 'simple-urls'), 'add_new_item' => __('Add New URL', 'simple-urls'), 'edit' => __('Edit', 'simple-urls'), 'edit_item' => __('Edit URL', 'simple-urls'), 'new_item' => __('New URL', 'simple-urls'), 'view' => __('View URL', 'simple-urls'), 'view_item' => __('View URL', 'simple-urls'), 'search_items' => __('Search URL', 'simple-urls'), 'not_found' => __('No URLs found', 'simple-urls'), 'not_found_in_trash' => __('No URLs found in Trash', 'simple-urls'), 'messages' => array(0 => '', 1 => __('URL updated. <a href="%s">View URL</a>', 'simple-urls'), 2 => __('Custom field updated.', 'simple-urls'), 3 => __('Custom field deleted.', 'simple-urls'), 4 => __('URL updated.', 'simple-urls'), 5 => isset($_GET['revision']) ? sprintf(__('Post restored to revision from %s', 'simple-urls'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('URL updated. <a href="%s">View URL</a>', 'simple-urls'), 7 => __('URL saved.', 'simple-urls'), 8 => __('URL submitted.', 'simple-urls'), 9 => __('URL scheduled', 'simple-urls'), 10 => __('URL draft updated.', 'simple-urls')));
     $labels = apply_filters('simple_urls_cpt_labels', $labels);
     $rewrite_slug = apply_filters('simple_urls_slug', 'go');
     register_post_type($slug, array('labels' => $labels, 'public' => true, 'query_var' => true, 'menu_position' => 20, 'supports' => array('title'), 'rewrite' => array('slug' => $rewrite_slug, 'with_front' => false)));
 }
コード例 #22
0
 /**
  * Filter the messages that appear when saving or updating a guest author
  *
  * @since 3.0
  */
 function filter_post_updated_messages($messages)
 {
     global $post;
     $guest_author = $this->get_guest_author_by('ID', $post->ID);
     $guest_author_link = $this->filter_author_link('', $guest_author->ID, $guest_author->user_nicename);
     $messages[$this->post_type] = array(0 => '', 1 => sprintf(__('Guest author updated. <a href="%s">View profile</a>', 'co-authors-plus'), esc_url($guest_author_link)), 2 => __('Custom field updated.', 'co-authors-plus'), 3 => __('Custom field deleted.', 'co-authors-plus'), 4 => __('Guest author updated.', 'co-authors-plus'), 5 => isset($_GET['revision']) ? sprintf(__('Guest author restored to revision from %s', 'co-authors-plus'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Guest author updated. <a href="%s">View profile</a>', 'co-authors-plus'), esc_url($guest_author_link)), 7 => __('Guest author saved.', 'co-authors-plus'), 8 => sprintf(__('Guest author submitted. <a target="_blank" href="%s">Preview profile</a>', 'co-authors-plus'), esc_url(add_query_arg('preview', 'true', $guest_author_link))), 9 => sprintf(__('Guest author scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview profile</a>', 'co-authors-plus'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url($guest_author_link)), 10 => sprintf(__('Guest author updated. <a target="_blank" href="%s">Preview profile</a>', 'co-authors-plus'), esc_url(add_query_arg('preview', 'true', $guest_author_link))));
     return $messages;
 }
コード例 #23
0
 /**
  * Change messages when a post type is updated.
  *
  * @param  array $messages
  * @return array
  */
 public function post_updated_messages($messages)
 {
     global $post, $post_ID;
     $messages['product'] = array(0 => '', 1 => sprintf(__('Product updated. <a href="%s">View Product</a>', 'woocommerce'), esc_url(get_permalink($post_ID))), 2 => __('Custom field updated.', 'woocommerce'), 3 => __('Custom field deleted.', 'woocommerce'), 4 => __('Product updated.', 'woocommerce'), 5 => isset($_GET['revision']) ? sprintf(__('Product restored to revision from %s', 'woocommerce'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Product published. <a href="%s">View Product</a>', 'woocommerce'), esc_url(get_permalink($post_ID))), 7 => __('Product saved.', 'woocommerce'), 8 => sprintf(__('Product submitted. <a target="_blank" href="%s">Preview Product</a>', 'woocommerce'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Product scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Product</a>', 'woocommerce'), date_i18n(__('M j, Y @ G:i', 'woocommerce'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Product draft updated. <a target="_blank" href="%s">Preview Product</a>', 'woocommerce'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
     $messages['shop_order'] = array(0 => '', 1 => __('Order updated.', 'woocommerce'), 2 => __('Custom field updated.', 'woocommerce'), 3 => __('Custom field deleted.', 'woocommerce'), 4 => __('Order updated.', 'woocommerce'), 5 => isset($_GET['revision']) ? sprintf(__('Order restored to revision from %s', 'woocommerce'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('Order updated.', 'woocommerce'), 7 => __('Order saved.', 'woocommerce'), 8 => __('Order submitted.', 'woocommerce'), 9 => sprintf(__('Order scheduled for: <strong>%1$s</strong>.', 'woocommerce'), date_i18n(__('M j, Y @ G:i', 'woocommerce'), strtotime($post->post_date))), 10 => __('Order draft updated.', 'woocommerce'));
     $messages['shop_coupon'] = array(0 => '', 1 => __('Coupon updated.', 'woocommerce'), 2 => __('Custom field updated.', 'woocommerce'), 3 => __('Custom field deleted.', 'woocommerce'), 4 => __('Coupon updated.', 'woocommerce'), 5 => isset($_GET['revision']) ? sprintf(__('Coupon restored to revision from %s', 'woocommerce'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('Coupon updated.', 'woocommerce'), 7 => __('Coupon saved.', 'woocommerce'), 8 => __('Coupon submitted.', 'woocommerce'), 9 => sprintf(__('Coupon scheduled for: <strong>%1$s</strong>.', 'woocommerce'), date_i18n(__('M j, Y @ G:i', 'woocommerce'), strtotime($post->post_date))), 10 => __('Coupon draft updated.', 'woocommerce'));
     return $messages;
 }
コード例 #24
0
 /**
  * Change the update messages displayed when updating Emails
  *
  * @param array $messages Existing post update messages.
  * @return array Amended post update messages with new CPT update messages.
  */
 public static function register_email_update_messages($messages)
 {
     $post = get_post();
     $post_type = get_post_type($post);
     $post_type_object = get_post_type_object($post_type);
     $messages['follow_up_email'] = apply_filters('fue_update_messages', array(0 => '', 1 => __('Email updated.', 'follow_up_emails'), 2 => __('Custom field updated.', 'follow_up_emails'), 3 => __('Custom field deleted.', 'follow_up_emails'), 4 => __('Email updated.', 'follow_up_emails'), 5 => isset($_GET['revision']) ? sprintf(__('Email restored to revision from %s', 'follow_up_emails'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('Email saved.', 'follow_up_emails'), 7 => __('Email saved.', 'follow_up_emails'), 8 => __('Email submitted.', 'follow_up_emails'), 9 => sprintf(__('Email scheduled for: <strong>%1$s</strong>.', 'follow_up_emails'), date_i18n(__('M j, Y @ G:i', 'follow_up_emails'), strtotime($post->post_date))), 10 => __('Email draft updated.', 'follow_up_emails')));
     return $messages;
 }
コード例 #25
0
/**
 * Handle messages for custom post types
 */
function xovation_meta_messages($messages)
{
    // Stories
    $messages['xovation_fragments'] = array(0 => '', 1 => sprintf(__('Fragment updated. <a href="%s">View fragment</a>', 'xovation'), esc_url(get_permalink($post_ID))), 2 => __('Custom field updated.', 'xovation'), 3 => __('Custom field deleted.', 'xovation'), 4 => __('Fragment updated.', 'xovation'), 5 => isset($_GET['revision']) ? sprintf(__('Fragment restored to revision from %s', 'xovation'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Fragment published. <a href="%s">View fragment</a>', 'xovation'), esc_url(get_permalink($post_ID))), 7 => __('Fragment saved.', 'xovation'), 8 => sprintf(__('Fragment submitted. <a target="_blank" href="%s">Preview fragment</a>', 'xovation'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Fragment scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview story</a>', 'xovation'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Fragment draft updated. <a target="_blank" href="%s">Preview fragment</a>', 'xovation'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
    // Stories
    $messages['xovation_stories'] = array(0 => '', 1 => sprintf(__('Story updated. <a href="%s">View story</a>', 'xovation'), esc_url(get_permalink($post_ID))), 2 => __('Custom field updated.', 'xovation'), 3 => __('Custom field deleted.', 'xovation'), 4 => __('Story updated.', 'xovation'), 5 => isset($_GET['revision']) ? sprintf(__('Story restored to revision from %s', 'xovation'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Story published. <a href="%s">View story</a>', 'xovation'), esc_url(get_permalink($post_ID))), 7 => __('Story saved.', 'xovation'), 8 => sprintf(__('Story submitted. <a target="_blank" href="%s">Preview story</a>', 'xovation'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Story scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview story</a>', 'xovation'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Story draft updated. <a target="_blank" href="%s">Preview story</a>', 'xovation'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
    return $messages;
}
コード例 #26
0
 private function create_post_type_messages($post_type)
 {
     global $post, $post_ID, $DC_Woodle;
     if (!isset($this->labels[$post_type])) {
         return array();
     }
     $messages = array(0 => '', 1 => sprintf(__('%s updated.'), esc_attr($this->labels[$post_type]['singular'])), 2 => __('Custom field updated.', $DC_Woodle->text_domain), 3 => __('Custom field deleted.', $DC_Woodle->text_domain), 4 => sprintf(__('%s updated.', $DC_Woodle->text_domain), esc_attr($this->labels[$post_type]['singular'])), 5 => isset($_GET['revision']) ? sprintf(__('%2$s restored to revision from %1$s', $DC_Woodle->text_domain), wp_post_revision_title((int) $_GET['revision'], false), esc_attr($this->labels[$post_type]['singular'])) : false, 6 => sprintf(__('%2$s published.'), esc_url(get_permalink($post_ID)), esc_attr($this->labels[$post_type]['singular'])), 7 => sprintf(__('%s saved.', $DC_Woodle->text_domain), esc_attr($this->labels[$post_type]['singular'])), 8 => sprintf(__('%2$s submitted.', $DC_Woodle->text_domain), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), esc_attr($this->labels[$post_type]['singular'])), 9 => sprintf(__('%s scheduled for: <strong>%1$s</strong>.', $DC_Woodle->text_domain), date_i18n(__(' M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), strtolower(esc_attr($this->labels[$post_type]['singular']))), 10 => sprintf(__('%s draft updated.', $DC_Woodle->text_domain), esc_attr($this->labels[$post_type]['singular'])));
     return $messages;
 }
コード例 #27
0
function TS_VCSC_Skillsets_Post_Messages($messages)
{
    global $post, $post_ID;
    $post_type = get_post_type($post_ID);
    $obj = get_post_type_object($post_type);
    $singular = $obj->labels->singular_name;
    $messages[$post_type] = array(0 => '', 1 => sprintf(__($singular . ' updated.')), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => __($singular . ' updated.'), 5 => isset($_GET['revision']) ? sprintf(__($singular . ' restored to revision from %s'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__($singular . ' published.')), 7 => __('Page saved.'), 8 => sprintf(__($singular . ' submitted.')), 9 => sprintf(__($singular . ' scheduled for: <strong>%1$s</strong>.'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date))), 10 => sprintf(__($singular . ' draft updated.')));
    return $messages;
}
コード例 #28
0
 public function set_messages($messages)
 {
     global $post, $post_ID;
     $post_type = get_post_type($post_ID);
     $obj = get_post_type_object($post_type);
     $singular = $obj->labels->singular_name;
     $messages[$post_type] = array(0 => '', 1 => sprintf(__($singular . ' updated. <a href="%s">View ' . strtolower($singular) . '</a>'), esc_url(get_permalink($post_ID))), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => __($singular . ' updated.'), 5 => isset($_GET['revision']) ? sprintf(__($singular . ' restored to revision from %s'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__($singular . ' published. <a href="%s">View ' . strtolower($singular) . '</a>'), esc_url(get_permalink($post_ID))), 7 => __('Page saved.'), 8 => sprintf(__($singular . ' submitted. <a target="_blank" href="%s">Preview ' . strtolower($singular) . '</a>'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__($singular . ' scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview ' . strtolower($singular) . '</a>'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__($singular . ' draft updated. <a target="_blank" href="%s">Preview ' . strtolower($singular) . '</a>'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
     return $messages;
 }
コード例 #29
0
 /**
  * Change messages when a post type is updated.
  *
  * @param  array $messages
  * @return array
  */
 public function post_updated_messages($messages)
 {
     global $post, $post_ID;
     $messages['property'] = array(0 => '', 1 => sprintf(__('Property updated. <a href="%s">View Property</a>', 'propertyhive'), esc_url(get_permalink($post_ID))), 2 => __('Custom field updated.', 'propertyhive'), 3 => __('Custom field deleted.', 'propertyhive'), 4 => __('Property updated.', 'propertyhive'), 5 => isset($_GET['revision']) ? sprintf(__('Property restored to revision from %s', 'propertyhive'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Property published. <a href="%s">View Property</a>', 'propertyhive'), esc_url(get_permalink($post_ID))), 7 => __('Property saved.', 'propertyhive'), 8 => sprintf(__('Property submitted. <a target="_blank" href="%s">Preview Property</a>', 'propertyhive'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Property scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Property</a>', 'propertyhive'), date_i18n(__('M j, Y @ G:i', 'propertyhive'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Property draft updated. <a target="_blank" href="%s">Preview Property</a>', 'propertyhive'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
     $messages['contact'] = array(0 => '', 1 => __('Contact updated.', 'propertyhive'), 2 => __('Custom field updated.', 'propertyhive'), 3 => __('Custom field deleted.', 'propertyhive'), 4 => __('Contact updated.', 'propertyhive'), 5 => isset($_GET['revision']) ? sprintf(__('Contact restored to revision from %s', 'propertyhive'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => __('Contact published.', 'propertyhive'), 7 => __('Contact saved.', 'propertyhive'), 8 => __('Contact submitted.', 'propertyhive'), 9 => sprintf(__('Contact scheduled for: <strong>%1$s</strong>.', 'propertyhive'), date_i18n(__('M j, Y @ G:i', 'propertyhive'), strtotime($post->post_date))), 10 => __('Contact draft updated.', 'propertyhive'));
     $messages['office'] = array(0 => '', 1 => __('Office updated.', 'propertyhive'), 2 => __('Custom field updated.', 'propertyhive'), 3 => __('Custom field deleted.', 'propertyhive'), 4 => __('Office updated.', 'propertyhive'), 5 => isset($_GET['revision']) ? sprintf(__('Office restored to revision from %s', 'propertyhive'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Office published.', 'propertyhive'), esc_url(get_permalink($post_ID))), 7 => __('Office saved.', 'propertyhive'), 8 => sprintf(__('Office submitted.', 'propertyhive'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Office scheduled for: <strong>%1$s</strong>.', 'propertyhive'), date_i18n(__('M j, Y @ G:i', 'propertyhive'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Office draft updated. ', 'propertyhive'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
     $messages['enquiry'] = array(0 => '', 1 => sprintf(__('Enquiry updated.', 'propertyhive'), esc_url(get_permalink($post_ID))), 2 => __('Custom field updated.', 'propertyhive'), 3 => __('Custom field deleted.', 'propertyhive'), 4 => __('Enquiry updated.', 'propertyhive'), 5 => isset($_GET['revision']) ? sprintf(__('Enquiry restored to revision from %s', 'propertyhive'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Enquiry published.', 'propertyhive'), esc_url(get_permalink($post_ID))), 7 => __('Enquiry saved.', 'propertyhive'), 8 => sprintf(__('Enquiry submitted.', 'propertyhive'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Enquiry scheduled for: <strong>%1$s</strong>.', 'propertyhive'), date_i18n(__('M j, Y @ G:i', 'propertyhive'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Enquiry draft updated.', 'propertyhive'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))));
     return $messages;
 }
コード例 #30
0
 public function updated_messages($messages)
 {
     global $post, $post_ID;
     $_uname = ucfirst($this->_name);
     $revision = isset($_GET['revision']) ? (int) isset($_GET['revision']) : 0;
     //$_uname_plural = ucfirst($this->_name_plural);
     $messages[$this->get_safe_name()] = array(0 => '', 1 => $this->translate('Successfully updated. <!--a href="%s">View</a-->', $_uname, esc_url(get_permalink($post_ID)), $this->_name), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => $this->translate('Successfully updated', $_uname), 5 => $revision ? $this->translate('Restored to revision from %s', $_uname, wp_post_revision_title($revision, false)) : false, 6 => $this->translate('Published. <a href="%s">View</a>', $_uname, esc_url(get_permalink($post_ID)), $this->_name), 7 => $this->translate('Saved.', $_uname), 8 => $this->translate('Submitted. <a target="_blank" href="%s">Preview</a>', $_uname, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $this->_name), 9 => $this->translate('Scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview</a>', $_uname, date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), $this->_name), 10 => $this->translate('Draft updated. <a target="_blank" href="%s">Preview</a>', $_uname, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $this->_name));
     return $messages;
 }