當前位置: 首頁>>代碼示例>>PHP>>正文


PHP td_demo_media::get_by_td_id方法代碼示例

本文整理匯總了PHP中td_demo_media::get_by_td_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP td_demo_media::get_by_td_id方法的具體用法?PHP td_demo_media::get_by_td_id怎麽用?PHP td_demo_media::get_by_td_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在td_demo_media的用法示例。


在下文中一共展示了td_demo_media::get_by_td_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add_post

 static function add_post($params)
 {
     $new_post = array('post_title' => $params['title'], 'post_status' => 'publish', 'post_type' => 'post', 'post_content' => self::parse_content_file($params['file']), 'comment_status' => 'open', 'post_category' => $params['categories_id_array'], 'guid' => td_global::td_generate_unique_id());
     //new post / page
     $post_id = wp_insert_post($new_post);
     // add our demo custom meta field, using this field we will delete all the pages
     update_post_meta($post_id, 'td_demo_content', true);
     if (!empty($params['post_format'])) {
         set_post_format($post_id, $params['post_format']);
     }
     set_post_thumbnail($post_id, td_demo_media::get_by_td_id($params['featured_image_td_id']));
     if (!empty($params['template'])) {
         $td_post_theme_settings['td_post_template'] = $params['template'];
         update_post_meta($post_id, 'td_post_theme_settings', $td_post_theme_settings, true);
     }
     if (!empty($params['featured_video_url'])) {
         $tmp_meta['td_video'] = $params['featured_video_url'];
         update_post_meta($post_id, 'td_post_video', $tmp_meta);
     }
     return $post_id;
 }
開發者ID:Che234,項目名稱:andreatelo,代碼行數:21,代碼來源:td_demo_util.php


注:本文中的td_demo_media::get_by_td_id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。