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


PHP WPFB_Core::GetPostId方法代碼示例

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


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

示例1: widget

 function widget($args, $instance)
 {
     if (!WPFB_Core::$settings->frontend_upload) {
         return;
     }
     wpfb_loadclass('File', 'Category', 'Output');
     $instance['category'] = empty($instance['category']) ? 0 : (int) $instance['category'];
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     echo $before_widget;
     echo $before_title . (empty($title) ? __('Upload File', WPFB) : $title) . $after_title;
     $prefix = "wpfb-upload-widget-" . $this->id_base;
     $form_url = add_query_arg('wpfb_upload_file', 1);
     $form_args = array('cat' => $instance['category'], 'overwrite' => (int) $instance['overwrite']);
     $form_args['file_post_id'] = $instance['attach'] ? WPFB_Core::GetPostId() : 0;
     // attach file to current post
     WPFB_Output::FileForm($prefix, $form_url, $form_args);
     echo $after_widget;
 }
開發者ID:bruno-barros,項目名稱:w.eloquent.light,代碼行數:19,代碼來源:Widget.php

示例2: PostAttachments

 static function PostAttachments($check_attached = false, $tpl_tag = null)
 {
     static $attached = array();
     wpfb_loadclass('File', 'Category');
     $pid = WPFB_Core::GetPostId();
     $real_content = did_action('wp_print_scripts') > 0;
     if ($pid == 0 || $check_attached && !empty($attached[$pid])) {
         return '';
     }
     if ($real_content) {
         $attached[$pid] = true;
     }
     $files = WPFB_File::GetAttachedFiles($pid);
     return self::genFileList($files, $tpl_tag);
 }
開發者ID:parsonsc,項目名稱:dofe,代碼行數:15,代碼來源:Output.php

示例3: PostAttachments

 static function PostAttachments($check_attached = false, $tpl_tag = null)
 {
     static $attached = array();
     wpfb_loadclass('File', 'Category');
     $pid = WPFB_Core::GetPostId();
     if ($pid == 0 || $check_attached && !empty($attached[$pid]) || count($files = WPFB_File::GetAttachedFiles($pid)) == 0) {
         return '';
     }
     $attached[$pid] = true;
     return self::genFileList($files, $tpl_tag);
 }
開發者ID:Seravo,項目名稱:WP-Filebase,代碼行數:11,代碼來源:Output.php


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