本文整理汇总了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;
}
示例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);
}
示例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);
}