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

PHP get_post_field函数代码示例

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

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



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

示例1: avfr_change_status

 /**
  *
  *	Change status of votes
  *
  */
 function avfr_change_status()
 {
     global $avfr_db;
     $post_id = $_POST['post_id'];
     $current_status = get_post_meta($post_id, '_avfr_status', true);
     $new_status = $_POST['new_status'];
     if ($new_status != $current_status && current_user_can('manage_options')) {
         update_post_meta($post_id, '_avfr_status', $new_status);
         echo 'success';
     }
     // for email
     $post_author_id = get_post_field('post_author', $post_id);
     $reciever_info = get_userdata($post_author_id);
     $entry = get_post($post_id);
     $search = array('{{writer-name}}', '{{avfr-title}}', '{{votes}}');
     $replace = array($reciever_info->user_login, $entry->post_title, avfr_get_votes($post_id));
     if ('on' == avfr_get_option('avfr_send_mail_' . $new_status . '_writer', 'avfr_settings_mail')) {
         $reciever_email = get_the_author_meta('user_email', $post_author_id);
         $content = avfr_get_option('avfr_mail_content_' . $new_status . '_writer', 'avfr_settings_mail');
         $mail_content = str_replace($search, $replace, $content);
         wp_mail($reciever_email, 'Feature Request ' . $entry->post_title . ' ' . $new_status . '.', $mail_content);
     }
     if ('on' == avfr_get_option('avfr_send_mail_' . $new_status . '_voters', 'avfr_settings_mail')) {
         $reciever_emails = $avfr_db->avfr_get_voters_email($post_id);
         $content = avfr_get_option('avfr_mail_content_' . $new_status . '_voters', 'avfr_settings_mail');
         $mail_content = str_replace($search, $replace, $content);
         wp_mail($reciever_emails, 'Request ' . $entry->post_title . ' ' . $new_status . '.', $mail_content);
     }
     exit;
     // Ajax
 }
开发者ID:averta-lab,项目名称:feature-request,代码行数:36,代码来源:class-avfr-status.php


示例2: column_default

 function column_default($item, $column_name)
 {
     switch ($column_name) {
         case 'rate':
             $download = get_post_meta($item['ID'], '_download_id', true);
             $type = eddc_get_commission_type($download);
             if ('percentage' == $type) {
                 return $item[$column_name] . '%';
             } else {
                 return edd_currency_filter(edd_sanitize_amount($item[$column_name]));
             }
         case 'status':
             return $item[$column_name];
         case 'amount':
             return edd_currency_filter(edd_format_amount($item[$column_name]));
         case 'date':
             return date_i18n(get_option('date_format'), strtotime(get_post_field('post_date', $item['ID'])));
         case 'download':
             $download = !empty($item['download']) ? $item['download'] : false;
             return $download ? '<a href="' . esc_url(add_query_arg('download', $download)) . '" title="' . __('View all commissions for this item', 'eddc') . '">' . get_the_title($download) . '</a>' . (!empty($item['variation']) ? ' - ' . $item['variation'] : '') : '';
         case 'payment':
             $payment = get_post_meta($item['ID'], '_edd_commission_payment_id', true);
             return $payment ? '<a href="' . esc_url(admin_url('edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id=' . $payment)) . '" title="' . __('View payment details', 'eddc') . '">#' . $payment . '</a> - ' . edd_get_payment_status(get_post($payment), true) : '';
         default:
             return print_r($item, true);
             //Show the whole array for troubleshooting purposes
     }
 }
开发者ID:chriscct7,项目名称:EDD-Commissions-1,代码行数:28,代码来源:EDD_C_List_Table.php


示例3: get_data

 /**
  * Get the data being exported
  *
  * @access      public
  * @since       1.2
  * @return      array
  */
 public function get_data()
 {
     global $edd_logs;
     $data = array();
     $args = array('nopaging' => true, 'post_type' => 'edd_payment', 'meta_key' => '_edd_payment_shipping_status', 'meta_value' => '1', 'fields' => 'ids');
     $payments = get_posts($args);
     if ($payments) {
         foreach ($payments as $payment) {
             $user_info = edd_get_payment_meta_user_info($payment);
             $downloads = edd_get_payment_meta_cart_details($payment);
             $products = '';
             if ($downloads) {
                 foreach ($downloads as $key => $download) {
                     // Display the Downoad Name
                     $products .= get_the_title($download['id']);
                     if ($key != count($downloads) - 1) {
                         $products .= ' / ';
                     }
                 }
             }
             $data[] = array('id' => $payment, 'date' => get_post_field('post_date', $payment), 'first_name' => $user_info['first_name'], 'last_name' => $user_info['last_name'], 'email' => $user_info['email'], 'address' => $user_info['shipping_info']['address'], 'address2' => !empty($user_info['shipping_info']['address2']) ? $user_info['shipping_info']['address2'] : '', 'city' => $user_info['shipping_info']['city'], 'state' => $user_info['shipping_info']['state'], 'zip' => $user_info['shipping_info']['zip'], 'country' => $user_info['shipping_info']['country'], 'amount' => edd_get_payment_amount($payment), 'tax' => edd_get_payment_tax($payment), 'gateway' => edd_get_payment_gateway($payment), 'key' => edd_get_payment_key($payment), 'products' => $products, 'status' => get_post_field('post_status', $payment));
         }
     }
     $data = apply_filters('edd_export_get_data', $data);
     $data = apply_filters('edd_export_get_data_' . $this->export_type, $data);
     return $data;
 }
开发者ID:JiveDig,项目名称:EDD-Simple-Shipping,代码行数:34,代码来源:class-shipping-export.php


示例4: wpdt_wpas_before_tickets_list

function wpdt_wpas_before_tickets_list()
{
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $args = array('post_type' => 'ticket', 'post_status' => 'any', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => 20, 'paged' => $paged, 'no_found_rows' => false, 'cache_results' => false, 'update_post_term_cache' => false, 'update_post_meta_cache' => false);
    if (isset($_REQUEST['searchString']) && $_REQUEST['searchString'] != '') {
        $results = array();
        $args['post_title_like'] = $_REQUEST['searchString'];
        $args['order'] = 'ASC';
        $args['orderby'] = 'title';
        global $wpas_tickets;
        $wpas_tickets = new WP_Query($args);
        if ($wpas_tickets->have_posts()) {
            while ($wpas_tickets->have_posts()) {
                $wpas_tickets->the_post();
                $url = site_url() . "/ticket/" . get_post_field('post_name', get_post());
                $return_value = get_the_title();
                $results[] = array('value' => $return_value, 'slug' => get_the_permalink(), 'url' => $url, 'tokens' => explode(' ', get_the_title()), 'css_class' => 'no_class');
            }
        } else {
            $results['value'] = 'No results found.';
        }
        wp_reset_postdata();
        echo json_encode($results);
        exit;
    }
    global $wpas_tickets;
    $wpas_tickets = new WP_Query($args);
}
开发者ID:vladab,项目名称:awesome-support-extend,代码行数:28,代码来源:awesome-suppoort-extend.php


示例5: displayPatreonCampaignBanner

 public function displayPatreonCampaignBanner($patreon_level)
 {
     /* patreon banner when user patronage not high enough */
     /* TODO: get marketing collateral */
     //return '<img src="http://placehold.it/500x150?text=PATREON MARKETING COLLATERAL"/>';
     //TAO get the patreon pitch page and display it
     //TAO this is the patreon pitch page
     $TAO_patreon_pitch_page_url = get_option('tao-patreon-pitch-page', '');
     //if options comes back with something, then replace the $content
     if ($TAO_patreon_pitch_page_url) {
         //I have a full url from the options page, convert that into an DI
         $TAO_patreon_pitch_page_id = url_to_postid($TAO_patreon_pitch_page_url);
         //the id was found, get the content of that post now
         if ($TAO_patreon_pitch_page_id) {
             //Display a message for the viewer to usnderstand why they cannot see the content if the option is filled out
             $TAO_patreon_pitch_reason = get_option('tao-patreon-pitch-reason', '');
             if ($TAO_patreon_pitch_reason) {
                 //check to see if $patreon_level exists in string and replace it with $patreon_level var
                 $TAO_patreon_pitch_reason = str_replace('$patreon_level', '$' . $patreon_level, $TAO_patreon_pitch_reason);
                 //$content = '[message_box type="note" icon="yes"]' . $TAO_patreon_pitch_reason . '[/message_box][hr]';
                 $content = $TAO_patreon_pitch_reason;
             }
             //get the content from a post ID, which is the patreon pitch page
             $content .= get_post_field('post_content', $TAO_patreon_pitch_page_id);
             return $content;
         }
     }
 }
开发者ID:bigt11,项目名称:patreon-wordpress,代码行数:28,代码来源:patreon_frontend.php


示例6: displayContactBySubsidiary

function displayContactBySubsidiary()
{
    $obj = get_post_type_object('contact_subsidiary');
    echo "<h2>";
    echo $obj->labels->singular_name;
    echo "</h2>";
    echo "<div style='width:400px; float:left;'>";
    $loop2 = new WP_Query(array('post_type' => 'contact_subsidiary', 'posts_per_page' => -1));
    while ($loop2->have_posts()) {
        $loop2->the_post();
        $postid = get_the_ID();
        echo "Title: " . ($title_contact_subsidiary = get_the_title());
        echo "</br>";
        $meta_value_internal = get_post_meta($postid, 'subsidiaries_internal', true);
        if ($meta_value_internal !== "") {
            foreach ($meta_value_internal as $value_internal) {
                //print_r($value_internal);
                echo $title_internal = $value_internal['internal-subsidiary-title'];
                echo $description_internal = $value_internal['internal-subsidiary-description'];
            }
        } else {
            echo "Content: " . ($content_contact_subsidiary = get_post_field('post_content', $post->ID));
        }
        echo "<hr>";
        echo "</br>";
    }
    echo "</div>";
}
开发者ID:raheenbabul,项目名称:flaming-lana,代码行数:28,代码来源:asplundh-contact-us.php


示例7: charitable_is_current_campaign_creator

/**
 * Returns whether the current user is the creator of the given campaign.
 *
 * @param   int     $campaign_id
 * @return  boolean
 * @since   1.0.0
 */
function charitable_is_current_campaign_creator($campaign_id = null)
{
    if (is_null($campaign_id)) {
        $campaign_id = charitable_get_current_campaign_id();
    }
    return get_post_field('post_author', $campaign_id) == get_current_user_id();
}
开发者ID:altatof,项目名称:Charitable,代码行数:14,代码来源:charitable-campaign-functions.php


示例8: helpers_calculate_read_time

 /**
  * Updates post_meta with number of words
  * @author Eric Wennerberg
  * @since 0.0.7
  * @version 0.2.0
  * @param str $post_id
  * @return int $words;
  */
 function helpers_calculate_read_time($post_id)
 {
     $content = apply_filters('the_content', get_post_field('post_content', $post_id, 'raw'));
     $words = str_word_count($content);
     update_post_meta($post_id, 'flavour_num_words', $words);
     return $words;
 }
开发者ID:jun200,项目名称:wordpress,代码行数:15,代码来源:class-flavour-helpers.php


示例9: dwqa_get_latest_action_date

function dwqa_get_latest_action_date($question = false, $before = '<span>', $after = '</span>')
{
    if (!$question) {
        $question = get_the_ID();
    }
    global $post;
    $message = '';
    $latest_answer = dwqa_get_latest_answer($question);
    $last_activity_date = $latest_answer ? $latest_answer->post_date : get_post_field('post_date', $question);
    $post_id = $latest_answer ? $latest_answer->ID : $question;
    $author_id = $post->post_author;
    if ($author_id == 0 || dwqa_is_anonymous($post_id)) {
        $anonymous_name = get_post_meta($post_id, '_dwqa_anonymous_name', true);
        if ($anonymous_name) {
            $author_link = $anonymous_name . ' ';
        } else {
            $author_link = __('Anonymous', 'dwqa') . ' ';
        }
    } else {
        $display_name = get_the_author_meta('display_name', $author_id);
        $author_url = get_author_posts_url($author_id);
        $author_avatar = wp_cache_get('avatar_of_' . $author_id, 'dwqa');
        if (false === $author_avatar) {
            $author_avatar = get_avatar($author_id, 12);
            wp_cache_set('avatar_of_' . $author_id, $author_avatar, 'dwqa', 60 * 60 * 24 * 7);
        }
        $author_link = sprintf('<span class="dwqa-author">%3$s</span>', $author_url, esc_attr(sprintf(__('Posts by %s'), $display_name)), $display_name, $author_avatar);
    }
    if ($last_activity_date && $post->last_activity_type == 'answer') {
        $date = dwqa_human_time_diff(strtotime($last_activity_date), false, get_option('date_format'));
        return sprintf(__('%s respondida <span class="dwqa-date">%s</span>', 'dwqa'), $author_link, $date);
    }
    return sprintf(__('%s perguntou <span class="dwqa-date">%s</span>', 'dwqa'), $author_link, get_the_date());
}
开发者ID:hacklabr,项目名称:portal-timtec,代码行数:34,代码来源:actions-question.php


示例10: olr_custom_column_date

 function olr_custom_column_date($column_name, $id)
 {
     $meta_key = 'olr_custom_column';
     $column = get_post_meta($id, $meta_key, true);
     if ($column_name == 'Phone') {
         echo $column['Phone'];
     }
     if ($column_name == 'Email') {
         echo $column['Email'];
     }
     if ($column_name == 'editor') {
         echo nl2br(get_post_field('post_content', $id));
     }
     if ($column_name == 'Tables') {
         $type_tables = '';
         if ($column['Type_of_Tables'] != '') {
             $type_tables = ' ( ' . $column['Type_of_Tables'] . ' )';
         }
         echo $column['Tables'] . $type_tables;
     }
     if ($column_name == 'Persons') {
         echo $column['Persons'];
     }
     if ($column_name == 'Booking Date') {
         echo $column['Booking_Date'] . ', ' . $column['Booking_Time'];
     }
     if ($column_name == 'Confirmation Key') {
         echo $column['Confirmation_Key'];
     }
     if ($column_name == 'status') {
         $status = get_post_status($id);
         echo '<span class="' . $status . '">' . ucfirst($status) . '</span>';
     }
 }
开发者ID:dridri51,项目名称:wordpress_workflow,代码行数:34,代码来源:admin.php


示例11: get_flexslider

function get_flexslider()
{
    //get attachments
    $attachments = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'order' => 'ASC'));
    //open slider
    $slider .= '
    <!-- Start Flexslider -->
    <div class="flexslider">
        <ul class="slides">
    ';
    //get conditional slider
    if ($attachments) {
        foreach ($attachments as $attachment_id => $attachment) {
            $theUrl = wp_get_attachment_url($attachment_id);
            $theCaption = get_post_field('post_excerpt', $attachment->ID);
            $slider .= '
            <li data-thumb="' . $theUrl . '">
                <img src="' . $theUrl . '" alt="slider1"/>
            </li>
            ';
        }
    }
    //end slider
    $slider .= '
        </ul>
        </div>
        <!-- End Flexslider -->
    ';
    //return slider
    return $slider;
}
开发者ID:hslee33754,项目名称:WP_hmd-fifteen,代码行数:31,代码来源:functions.php


示例12: save_inquiry

function save_inquiry($post_id)
{
    if (!wp_is_post_revision($post_id)) {
        $forms = get_field('forms', 'option');
        $post_type = get_post_field('post_type', $post_id);
        foreach ($forms as $form) {
            if ($post_type == $form['post_type']) {
                $title = $form['title'];
                $title = str_replace('newpost', $post_id, $title);
                $title = do_shortcode($title);
                $slug = str_replace(' ', '-', strtolower($title));
                $post = array("post_title" => $title, 'ID' => $post_id, 'post_name' => $slug);
                wp_update_post($post);
                $headers = array('Content-Type: text/html; charset=UTF-8');
                $subject = $title . ' (' . $post_id . ')';
                $email_html = site_url() . '?acf-cf-email=' . $post_id;
                if (!empty($form['template'])) {
                    $email_html = $email_html . '&template=' . $form['template'];
                }
                $message = file_get_contents($email_html);
                if ($form['no_email'] == false) {
                    $recipient = $form['email'];
                    $mail = wp_mail($recipient, $subject, $message, $headers);
                }
            }
        }
        return $post_id;
    }
}
开发者ID:philbraun,项目名称:acf-contact-form,代码行数:29,代码来源:acf-contact-process.php


示例13: display_sales_logs

 /**
  * Displaying Prodcuts
  *
  * Does prepare the data for displaying the products in the table.
  * 
  * @package Social Deals Engine
  * @since 1.0.0
  */
 function display_sales_logs()
 {
     $prefix = WPS_DEALS_META_PREFIX;
     $logs_data = array();
     $paged = $this->get_paged();
     $sale = empty($_GET['s']) ? $this->get_sorted_sales_log() : null;
     $log_query = array('post_parent' => $sale, 'log_type' => 'sales', 'meta_query' => $this->get_meta_query());
     $logsdata = $this->logs->get_connected_logs($log_query);
     if ($logsdata) {
         foreach ($logsdata as $log) {
             $order_id = get_post_meta($log->ID, $prefix . 'log_payment_id', true);
             // Make sure this payment hasn't been deleted
             if (get_post($order_id)) {
                 $user_info = $this->model->wps_deals_get_ordered_user_details($order_id);
                 $cart_items = $this->model->wps_deals_get_post_meta_ordered($order_id);
                 $cart_items = $cart_items['deals_details'];
                 $date = $this->model->wps_deals_get_date_format(strtotime(get_post_field('post_date', $order_id)), true);
                 $amount = 0;
                 if (is_array($cart_items) && is_array($user_info)) {
                     foreach ($cart_items as $item) {
                         $price_override = isset($item['deal_sale_price']) ? $item['deal_sale_price'] : null;
                         if (isset($item['deal_id']) && $item['deal_id'] == $log->post_parent) {
                             $amount = $item['deal_sale_price'];
                             $qty = $item['deal_quantity'];
                         }
                     }
                     $amount = $this->currency->wps_deals_formatted_value($amount);
                     $logs_data[] = array('ID' => $log->ID, 'order_id' => $order_id, 'deals' => $log->post_parent, 'amount' => $amount, 'quantity' => $qty, 'user_id' => $user_info['user_id'], 'user_name' => $user_info['first_name'] . ' ' . $user_info['last_name'], 'date' => $date);
                 }
             }
         }
     }
     return $logs_data;
 }
开发者ID:wppassion,项目名称:deals-engine,代码行数:42,代码来源:class-wps-deals-sales-logs-list.php


示例14: add_media_to_collection

 function add_media_to_collection($mediaId, $collectionId, $isRemove = false)
 {
     $id = get_post_meta($collectionId, 'lrid_to_id', true);
     $content = get_post_field('post_content', $id);
     preg_match_all('/\\[gallery.*ids="([0-9,]*)"\\]/', $content, $results);
     if (!empty($results) && !empty($results[1])) {
         $str = $results[1][0];
         $ids = !empty($str) ? explode(',', $str) : array();
         $index = array_search($mediaId, $ids, false);
         if ($isRemove) {
             if ($index !== FALSE) {
                 unset($ids[$index]);
             }
         } else {
             // If mediaId already there then exit.
             if ($index !== FALSE) {
                 return;
             }
             array_push($ids, $mediaId);
         }
         // Replace the array within the gallery shortcode.
         $content = str_replace('ids="' . $str, 'ids="' . implode(',', $ids), $content);
         $post = array('ID' => $id, 'post_content' => $content);
         wp_update_post($post);
     }
 }
开发者ID:jordymeow,项目名称:wplr-posts,代码行数:26,代码来源:posts.php


示例15: shortcode

 public function shortcode($atts, $content = null)
 {
     $this->content = $this->sanitize_content($content);
     $this->atts = $this->sanitize_attributes($atts);
     // override shortcode atts for uploaded image
     if ($this->is_uploaded_image()) {
         $image_id = $this->atts['image_id'];
         $image_src = wp_get_attachment_image_src($image_id, 'full');
         if (!$image_src) {
             return '';
         }
         if (get_post_meta($image_id, 'dt-img-hide-title', true)) {
             $this->atts['image_title'] = '';
         } else {
             $this->atts['image_title'] = get_the_title($image_id);
         }
         $this->atts['image'] = $image_src[0];
         $this->atts['hd_image'] = '';
         $this->atts['image_alt'] = esc_attr(get_post_meta($image_id, '_wp_attachment_image_alt', true));
         $this->atts['media'] = esc_url(get_post_meta($image_id, 'dt-video-url', true));
         $post_content = get_post_field('post_content', $image_id);
         $this->content = $this->sanitize_content($post_content);
     }
     $output = '';
     $output .= '<div ' . $this->get_container_html_class('shortcode-single-image-wrap') . $this->get_container_inline_style() . '>';
     $output .= $this->get_media();
     $output .= $this->get_caption();
     $output .= '</div>';
     return $output;
 }
开发者ID:armslee,项目名称:wp_requid,代码行数:30,代码来源:fancy-image.php


示例16: notify

 function notify($new_status, $old_status, $post)
 {
     global $current_site;
     if ('answer' != $post->post_type || 'publish' != $new_status || $new_status == $old_status) {
         return;
     }
     $author = get_userdata($post->post_author);
     $question_id = $post->post_parent;
     $question = get_post($question_id);
     $subscribers = get_post_meta($question_id, '_sub');
     if (!in_array($question->post_author, $subscribers)) {
         $subscribers[] = $question->post_author;
     }
     // Notify question author too
     $subject = sprintf(__('[%s] New answer on "%s"'), get_option('blogname'), $question->post_title);
     $content = sprintf(__('%s added a new answer to %s:', QA_TEXTDOMAIN), _qa_html('a', array('href' => qa_get_url('user', $post->post_author)), $author->user_nicename), _qa_html('a', array('href' => qa_get_url('single', $question_id)), get_post_field('post_title', $question_id)));
     $content .= "<br/><br/>" . $post->post_content . "<br/><br/>";
     cache_users($subscribers);
     $admin_email = get_site_option('admin_email');
     if ($admin_email == '') {
         $admin_email = 'admin@' . $current_site->domain;
     }
     $from_email = $admin_email;
     $message_headers = "MIME-Version: 1.0\n" . "From: " . $current_site->site_name . " <{$from_email}>\n" . "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
     foreach ($subscribers as $subscriber_id) {
         // Don't notify the author of the answer
         if ($post->post_author != $subscriber_id) {
             $msg = $content . sprintf(__('To manage your subscription, visit <a href="%s">the question</a>.', QA_TEXTDOMAIN), qa_get_url('single', $post->ID));
         } else {
             $msg = $content;
         }
         wp_mail(get_user_option('user_email', $subscriber_id), $subject, $msg, $message_headers);
     }
 }
开发者ID:httvncoder,项目名称:151722441,代码行数:34,代码来源:subscriptions.php


示例17: remove_word

 public function remove_word($post_id)
 {
     if (!in_array(get_post_type($post_id), $this->post_types)) {
         return $post_id;
     }
     $do_word = get_post_meta($post_id, 'remove_word_formatting', true) === 'ano';
     if (!$do_word) {
         return $post_id;
     }
     $content = get_post_field('post_content', $post_id);
     if (empty($content)) {
         return $post_id;
     }
     $dom = \Cibulka::Base('DOMDocument');
     $dom->loadHTML($content);
     $dom->unwrap($this->els);
     // Remove unnecessary elements
     $dom->remove_attrs($this->attrs);
     // Remove attributes
     $content = $dom->get_content();
     if (empty($content)) {
         return false;
     }
     $result = array('ID' => $post_id, 'post_content' => $content);
     remove_action('save_post', array($this, 'remove_word'), 12);
     $result = wp_update_post($result);
     add_action('save_post', array($this, 'remove_word'), 12, 1);
     update_post_meta($post_id, 'remove_word_formatting', 'ne');
     return $result;
 }
开发者ID:cibulka,项目名称:cibulka-wp-plugin-base,代码行数:30,代码来源:Remove_Word.php


示例18: eddc_parse_template_tags

/**
 * Parse email template tags
 *
 * @since       3.0
 * @param       string $message The email body
 * @param       int $download_id The ID for a given download
 * @param       int $commission_id The ID of this commission
 * @param       int $commission_amount The amount of the commission
 * @param       int $rate The commission rate of the user
 * @return      string $message The email body
 */
function eddc_parse_template_tags($message, $download_id, $commission_id, $commission_amount, $rate)
{
    $meta = get_post_meta($commission_id, '_edd_commission_info', true);
    $variation = get_post_meta($commission_id, '_edd_commission_download_variation', true);
    $download = get_the_title($download_id) . (!empty($variation) ? ' - ' . $variation : '');
    $amount = html_entity_decode(edd_currency_filter(edd_format_amount($commission_amount)));
    $date = date_i18n(get_option('date_format'), strtotime(get_post_field('post_date', $commission_id)));
    $user = get_userdata($meta['user_id']);
    if (!empty($user->first_name)) {
        $name = $user->first_name;
        if (!empty($user->last_name)) {
            $fullname = $name . ' ' . $user->last_name;
        } else {
            $fullname = $name;
        }
    } else {
        $name = $user->display_name;
        $fullname = $name;
    }
    $message = str_replace('{download}', $download, $message);
    $message = str_replace('{amount}', $amount, $message);
    $message = str_replace('{date}', $date, $message);
    $message = str_replace('{rate}', $rate, $message);
    $message = str_replace('{name}', $name, $message);
    $message = str_replace('{fullname}', $fullname, $message);
    return $message;
}
开发者ID:SelaInc,项目名称:eassignment,代码行数:38,代码来源:email-functions.php


示例19: options

 static function options($forum_id = 0, $admin = false)
 {
     $forum_id = bbp_get_forum_id($forum_id);
     if ($cached = wp_cache_get($forum_id, 'forum_options')) {
         return $cached;
     }
     $forum_options = self::$defaults;
     if (get_post_meta($forum_id, 'bbpkr_custom_settings', true)) {
         $forum_options = array_merge($forum_options, (array) get_post_meta($forum_id, 'bbpkr_options', true));
         // var_dump( $this->options()['skin'], $options);
     } elseif (!$admin) {
         // follow closest parent forum custom settings
         $forum_parent = (int) get_post_field('post_parent', $forum_id);
         if ($forum_parent) {
             while ($forum_parent) {
                 if (get_post_meta($forum_parent, 'bbpkr_custom_settings', true)) {
                     $forum_options = array_merge($forum_options, (array) get_post_meta($forum_parent, 'bbpkr_options', true));
                     break;
                 }
                 $forum_parent = (int) get_post_field('post_parent', $forum_parent);
             }
         }
     }
     $return = array_merge(bbpresskr()->options(), (array) $forum_options);
     wp_cache_set($forum_id, $return, 'forum_options');
     return $return;
 }
开发者ID:082net,项目名称:bbpresskr,代码行数:27,代码来源:forum.php


示例20: get_object

 function get_object($src_name, $object_id, $cols = '')
 {
     // special cases to take advantage of cached post/link
     if ('post' == $src_name) {
         if ($cols && !strpos($cols, ',')) {
             return get_post_field($cols, $object_id, 'raw');
         } else {
             return get_post($object_id);
         }
     } elseif ('link' == $src_name) {
         return get_bookmark($object_id);
     } else {
         if (!($src = $this->get($src_name))) {
             return;
         }
         global $wpdb;
         if (!$cols) {
             $cols = '*';
         }
         if (empty($object_id)) {
             return array();
         }
         return scoper_get_row("SELECT {$cols} FROM {$src->table} WHERE {$src->cols->id} = '{$object_id}' LIMIT 1");
     }
     // end switch
 }
开发者ID:par-orillonsoft,项目名称:creationOfSociety,代码行数:26,代码来源:data_sources_rs.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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