当前位置: 首页>>代码示例>>PHP>>正文


PHP mpp_reset_media_data函数代码示例

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


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

示例1: printf

        ?>

            <div class="mpp-notice mpp-gallery-prohibited">

                <p><?php 
        printf(__('The privacy policy does not allow you to view this.', 'mediapress'));
        ?>
</p>
                
            </div>

    <?php 
    }
    ?>
    <?php 
    mpp_reset_media_data();
    ?>
   
<?php 
} else {
    ?>
	<?php 
    //we should seriously think about adding create gallery button here
    ?>
	<?php 
    if (mpp_user_can_upload(mpp_get_current_component(), mpp_get_current_component_id())) {
        ?>
		<?php 
        mpp_get_template('gallery/manage/add-media.php');
        ?>
	
开发者ID:markc,项目名称:mediapress,代码行数:30,代码来源:single.php

示例2: fetch_gallery_media

    public function fetch_gallery_media()
    {
        //do we need nonce validation for this request too? no
        $items = array();
        $gallery_id = absint($_POST['gallery_id']);
        $gallery = mpp_get_gallery($gallery_id);
        if (!$gallery_id || empty($gallery)) {
            exit(0);
        }
        $statuses = mpp_get_accessible_statuses($gallery->component, $gallery->component_id, get_current_user_id());
        $media_query = new MPP_Media_Query(array('gallery_id' => $gallery_id, 'posts_per_page' => -1, 'status' => $statuses));
        if ($media_query->have_media()) {
            ?>


			<?php 
            while ($media_query->have_media()) {
                $media_query->the_media();
                ?>

				<?php 
                $items[] = array('src' => $this->get_media_lightbox_entry());
                ?>

			<?php 
            }
            ?>

		<?php 
        }
        ?>
		<?php 
        mpp_reset_media_data();
        ?>
		<?php 
        wp_send_json(array('items' => $items));
        exit(0);
    }
开发者ID:enboig,项目名称:mediapress,代码行数:38,代码来源:class-mpp-ajax-lightbox-helper.php

示例3: fetch_activity_media

    public function fetch_activity_media()
    {
        //do we need nonce validation for this request too? no
        $items = array();
        $activity_id = $_POST['activity_id'];
        if (!$activity_id) {
            exit(0);
        }
        $media_ids = mpp_activity_get_attached_media_ids($activity_id);
        if (empty($media_ids)) {
            array_push($items, __('Sorry, Nothing found!', 'mediapress'));
            wp_send_json(array('items' => $items));
            exit(0);
        }
        $gallery_id = mpp_activity_get_gallery_id($activity_id);
        $gallery = mpp_get_gallery($gallery_id);
        if ($gallery->component == 'groups' && function_exists('bp_is_active') && bp_is_active('groups')) {
            //if( empty( buddypress()->groups))
        }
        $media_query = new MPP_Media_Query(array('in' => $media_ids));
        if ($media_query->have_media()) {
            ?>


			<?php 
            while ($media_query->have_media()) {
                $media_query->the_media();
                ?>

				<?php 
                $items[] = array('src' => $this->get_activity_media_lightbox_entry());
                ?>
			<?php 
            }
            ?>

		<?php 
        }
        ?>
		<?php 
        mpp_reset_media_data();
        ?>
		<?php 
        wp_send_json(array('items' => $items));
        exit(0);
    }
开发者ID:markc,项目名称:mediapress,代码行数:46,代码来源:mpp-ajax.php

示例4: fetch_activity_media

    public function fetch_activity_media()
    {
        //do we need nonce validation for this request too? no
        $items = array();
        $activity_id = $_POST['activity_id'];
        if (!$activity_id) {
            exit(0);
        }
        $media_ids = mpp_activity_get_attached_media_ids($activity_id);
        if (empty($media_ids)) {
            array_push($items, __('Sorry, Nothing found!', 'mediapress'));
            wp_send_json(array('items' => $items));
            exit(0);
        }
        $gallery_id = mpp_activity_get_gallery_id($activity_id);
        $gallery = mpp_get_gallery($gallery_id);
        //in case we are using oembed or other storage method
        $storage_method = mpp_get_media_meta($gallery->id, '_mpp_storage_method', true);
        //should we check for 'local' instead of default?
        if ($storage_method == mpp_get_default_storage_method()) {
            $storage_method = '';
        }
        $slug = $gallery->type;
        if (!empty($storage_method)) {
            $slug = $slug . '-' . $storage_method;
            //eg. video-oembed
        }
        $media_query = new MPP_Media_Query(array('in' => $media_ids));
        if ($media_query->have_media()) {
            ?>


			<?php 
            while ($media_query->have_media()) {
                $media_query->the_media();
                ?>

				<?php 
                $items[] = array('src' => $this->get_activity_media_lightbox_entry());
                ?>
			<?php 
            }
            ?>

		<?php 
        }
        ?>
		<?php 
        mpp_reset_media_data();
        ?>
		<?php 
        //media-loop-audio/media-loop-video,media-loop-photo, media-loop
        //mpp_get_template_part( 'gallery/activity/loop', $slug );
        wp_send_json(array('items' => $items));
        exit(0);
    }
开发者ID:baden03,项目名称:mediapress,代码行数:56,代码来源:ajax.php

示例5: generate_upload_meta_box

    public function generate_upload_meta_box($post)
    {
        ?>

		<!-- append uploaded media here -->
		<div id="mpp-gallery-media-admin-list" class="mpp-uploading-media-list">
			<ul> 
				<?php 
        $gallery_id = $post->ID;
        $mppq = new MPP_Media_Query(array('gallery_id' => $gallery_id, 'per_page' => -1, 'nopaging' => true));
        ?>
	
				<?php 
        while ($mppq->have_media()) {
            $mppq->the_media();
            ?>
				
					<li id="mpp-uploaded-media-item-<?php 
            mpp_media_id();
            ?>
" class="<?php 
            mpp_media_class('mpp-uploaded-media-item');
            ?>
">
						<img src="<?php 
            mpp_media_src('thumbnail');
            ?>
">
					</li>
				<?php 
        }
        ?>
				<?php 
        mpp_reset_media_data();
        ?>
			</ul>
		</div>
		<!-- drop files here for uploading -->
		<div id="mpp-gallery-admin-dropzone" class="mpp-dropzone">
			<button id="mpp-add-gallery-admin-media">Add media</button>
		</div>
		<!-- show any feedback here -->
		<div id="mpp-gallery-upload-admin-feedback" class="mpp-feedback">
			<ul> </ul>
		</div>


	<?php 
    }
开发者ID:baden03,项目名称:mediapress,代码行数:49,代码来源:class-mpp-post-helper.php


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