本文整理汇总了PHP中mediapress函数的典型用法代码示例。如果您正苦于以下问题:PHP mediapress函数的具体用法?PHP mediapress怎么用?PHP mediapress使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mediapress函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: mpp_gallery_show_publish_gallery_activity_button
function mpp_gallery_show_publish_gallery_activity_button()
{
if (!mediapress()->is_bp_active()) {
return;
}
$gallery_id = mpp_get_current_gallery_id();
//if not a valid gallery id or no unpublished media exists, just don't show it
if (!$gallery_id || !mpp_gallery_has_unpublished_media($gallery_id)) {
return;
}
$gallery = mpp_get_gallery($gallery_id);
$unpublished_media = mpp_gallery_get_unpublished_media($gallery_id);
//unpublished media count
$unpublished_media_count = count($unpublished_media);
$type = $gallery->type;
$type_name = _n($type, $type . 's', $unpublished_media_count);
//if we are here, there are unpublished media
?>
<div id="mpp-unpublished-media-info">
<p> <?php
printf(__('You have %d %s not published to actvity.', 'mediapress'), $unpublished_media_count, $type_name);
?>
<span class="mpp-gallery-publish-activity"><?php
mpp_gallery_publish_activity_link($gallery_id);
?>
</span>
<span class="mpp-gallery-unpublish-activity"><?php
mpp_gallery_unpublished_media_delete_link($gallery_id);
?>
</span>
</p>
</div>
<?php
}
开发者ID:enboig,项目名称:mediapress,代码行数:35,代码来源:mpp-gallery-template.php
示例2: display
public function display()
{
$path = mediapress()->get_path();
if (!class_exists('Browser')) {
require_once $path . 'admin/tools/lib/browser.php';
}
require_once $path . 'admin/tools/debug/mpp-debug-output.php';
}
开发者ID:markc,项目名称:mediapress,代码行数:8,代码来源:mpp-admin-debug-helper.php
示例3: mpp_current_component_id_for_user
function mpp_current_component_id_for_user($component_id)
{
if (mediapress()->is_bp_active() && bp_is_user()) {
return bp_displayed_user_id();
//that is displayed user id
}
return $component_id;
}
开发者ID:markc,项目名称:mediapress,代码行数:8,代码来源:mpp-user-hooks.php
示例4: mpp_group_extension_load
function mpp_group_extension_load()
{
$files = array('mpp-bp-groups-actions.php', 'mpp-bp-groups-functions.php', 'mpp-bp-groups-hooks.php', 'mpp-bp-groups-group-extension.php');
$path = mediapress()->get_path() . 'modules/buddypress/groups/';
foreach ($files as $file) {
require_once $path . $file;
}
do_action('mpp_group_extension_loaded');
}
开发者ID:markc,项目名称:mediapress,代码行数:9,代码来源:mpp-bp-groups-loader.php
示例5: mpp_install_db
/**
* Install tables required by MediaPress
* Currently, we create only one table ( Log table )
*
* @global WPDB $wpdb
*/
function mpp_install_db()
{
global $wpdb;
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
$charset_collate = !empty($wpdb->charset) ? "DEFAULT CHARACTER SET {$wpdb->charset}" : '';
$sql = array();
$log_table = mediapress()->get_table_name('logs');
$sql[] = "CREATE TABLE IF NOT EXISTS {$log_table} (\n\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\tuser_id bigint(20) NOT NULL,\n\t\titem_id bigint(20) NOT NULL,\n\t\taction varchar(16) NOT NULL,\n\t\tvalue varchar(32) NOT NULL,\n\t\tlogged_at timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,\n\t\tPRIMARY KEY (id)\n\t) {$charset_collate};";
dbDelta($sql);
}
开发者ID:markc,项目名称:mediapress,代码行数:16,代码来源:mpp-admin-install.php
示例6: load
public function load()
{
$path = mediapress()->get_path() . 'modules/buddypress/';
$files = array('mpp-bp-component.php', 'activity/class-mpp-activity-media-cache-helper.php', 'activity/mpp-activity-functions.php', 'activity/mpp-activity-actions.php', 'activity/mpp-activity-template.php', 'activity/mpp-activity-hooks.php', 'groups/mpp-bp-groups-loader.php');
foreach ($files as $file) {
require_once $path . $file;
}
//MediaPress BuddyPress module is loaded now
do_action('mpp_buddypress_module_loaded');
}
开发者ID:enboig,项目名称:mediapress,代码行数:10,代码来源:mpp-bp-loader.php
示例7: __construct
private function __construct()
{
$this->url = mediapress()->get_url();
//load js on front end
add_action('wp_enqueue_scripts', array($this, 'load_js'));
add_action('wp_enqueue_scripts', array($this, 'add_js_data'));
//load admin js
add_action('admin_enqueue_scripts', array($this, 'load_js'));
add_action('wp_enqueue_scripts', array($this, 'load_css'));
add_action('wp_footer', array($this, 'footer'));
}
开发者ID:baden03,项目名称:mediapress,代码行数:11,代码来源:script-loader.php
示例8: load_ajax_handlers
/**
* Load ajax handlers
*
* @return type
*/
public function load_ajax_handlers()
{
if (!defined('DOING_AJAX')) {
return;
}
$files = array('core/ajax/mpp-ajax.php', 'core/ajax/class-mpp-ajax-comment-helper.php');
$path = mediapress()->get_path();
foreach ($files as $file) {
require_once $path . $file;
}
}
开发者ID:markc,项目名称:mediapress,代码行数:16,代码来源:mpp-loader.php
示例9: mpp_shortcode_reset_data
function mpp_shortcode_reset_data($type, $key = null)
{
$data = mediapress()->get_data('shortcode');
//, = $shortcode_column;
if (!$key) {
unset($data[$type]);
} else {
unset($data[$type][$key]);
}
mediapress()->add_data('shortcode', $data);
//save the updated data
}
开发者ID:enboig,项目名称:mediapress,代码行数:12,代码来源:mpp-shortcode-functions.php
示例10: mpp_widget_reset_data
function mpp_widget_reset_data($type, $key = null)
{
$data = mediapress()->get_data('widget');
//, = $widget_column;
if (!$key) {
unset($data[$type]);
} else {
unset($data[$type][$key]);
}
mediapress()->add_data('widget', $data);
//save the updated data
}
开发者ID:enboig,项目名称:mediapress,代码行数:12,代码来源:mpp-widget-functions.php
示例11: mpp_filter_body_class
function mpp_filter_body_class($classes, $class)
{
$new_classes = array();
$component = mpp_get_current_component();
//if not mediapress pages, return
if (!mpp_is_gallery_component() && !mpp_is_component_gallery()) {
return $classes;
}
//ok, It must be mpp pages
$new_classes[] = 'mpp-page';
//for all mediapress pages
//if it is a directory page
if (mpp_is_gallery_directory()) {
$new_classes[] = 'mpp-page-directory';
} elseif (mpp_is_gallery_component() || mpp_is_component_gallery()) {
//we are on user gallery page or a component gallery page
//append class mpp-page-members or mpp-page-groups or mpp-page-events etc depending on the current associated component
$new_classes[] = 'mpp-page-' . $component;
if (mpp_is_media_management()) {
//is it edit media?
$new_classes[] = 'mpp-page-media-management';
$new_classes[] = 'mpp-page-media-management-' . mpp_get_media_type();
//mpp-photo-management, mpp-audio-management
$new_classes[] = 'mpp-page-media-manage-action-' . mediapress()->get_edit_action();
//mpp-photo-management, mpp-audio-management
} elseif (mpp_is_single_media()) {
//is it single media
$new_classes[] = 'mpp-page-media-single';
$new_classes[] = 'mpp-page-media-single-' . mpp_get_media_type();
} elseif (mpp_is_gallery_management()) {
//id gallery management?
$new_classes[] = 'mpp-page-gallery-management';
$new_classes[] = 'mpp-page-gallery-management-' . mpp_get_gallery_type();
$new_classes[] = 'mpp-page-gallery-manage-action-' . mediapress()->get_edit_action();
} elseif (mpp_is_single_gallery()) {
//is singe gallery
$new_classes[] = 'mpp-page-single-gallery';
$new_classes[] = 'mpp-page-single-gallery-' . mpp_get_gallery_type();
$new_classes[] = 'mpp-page-single-gallery-' . mpp_get_gallery_status();
} else {
//it is the gallery listing page of the component
$new_classes[] = 'mpp-page-gallery-list';
//home could have been a better name
$new_classes[] = 'mpp-page-gallery-list-' . $component;
//home could have been a better name
}
}
if (!empty($new_classes)) {
$classes = array_merge($classes, $new_classes);
}
return $classes;
}
开发者ID:baden03,项目名称:mediapress,代码行数:52,代码来源:hooks.php
示例12: register_taxonomy
private function register_taxonomy($taxonomy, $args)
{
extract($args);
if (empty($taxonomy)) {
return false;
}
$labels = self::_get_tax_labels($label, $labels);
if (empty($slug)) {
$slug = $taxonomy;
}
register_taxonomy($taxonomy, false, array('hierarchical' => $hierarchical, 'labels' => $labels, 'public' => true, 'show_in_menu' => false, 'show_in_nav_menus' => false, 'show_ui' => false, 'show_tagcloud' => true, 'capabilities' => array('manage_terms' => 'manage_categories', 'edit_terms' => 'manage_categories', 'delete_terms' => 'manage_categories', 'assign_terms' => 'read'), 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'rewrite' => array('with_front' => true, 'hierarchical' => $hierarchical)));
mediapress()->taxonomies[$taxonomy] = $args;
}
开发者ID:markc,项目名称:mediapress,代码行数:13,代码来源:mpp-post-type.php
示例13: mpp_admin_load
function mpp_admin_load()
{
if (!is_admin() || is_admin() && defined('DOING_AJAX')) {
return;
}
$path = mediapress()->get_path() . 'admin/';
$files = array('mpp-admin-functions.php', 'mpp-admin.php', 'class-mpp-admin-post-helper.php', 'class-mpp-admin-gallery-list-helper.php', 'tools/debug/mpp-admin-debug-helper.php', 'class-mpp-admin-edit-gallery-panel.php');
foreach ($files as $file) {
require_once $path . $file;
}
//class_alias( 'MPP_Admin_Settings_Page' , 'MPP_Admin_Page' );
do_action('mpp_admin_loaded');
}
开发者ID:markc,项目名称:mediapress,代码行数:13,代码来源:mpp-admin-loader.php
示例14: load_dir_list
/**
* Loads directroy gallery list via ajax
*
*/
public function load_dir_list()
{
$type = isset($_POST['filter']) ? $_POST['filter'] : '';
$page = absint($_POST['page']);
$scope = $_POST['scope'];
$search_terms = $_POST['search_terms'];
//make the query and setup
mediapress()->is_directory = true;
//get all public galleries, should we do type filtering
mediapress()->the_gallery_query = new MPP_Gallery_Query(array('status' => 'public', 'type' => $type, 'page' => $page, 'search_terms' => $search_terms));
mpp_get_template('gallery/loop-gallery.php');
exit(0);
}
开发者ID:baden03,项目名称:mediapress,代码行数:17,代码来源:ajax.php
示例15: mpp_gallery_add_unpublished_media
/**
* Add media to the list of unpublished media
*
* @param int $gallery_id
* @param int|array $media_ids single media id or an array of media ids
*/
function mpp_gallery_add_unpublished_media($gallery_id, $media_ids)
{
if (!mediapress()->is_bp_active()) {
return;
}
$media_ids = (array) $media_ids;
// one or more media is given
$unpublished = mpp_gallery_get_unpublished_media($gallery_id);
$media_ids = array_diff($media_ids, $unpublished);
//add all new media ids to the unpublished list
foreach ($media_ids as $new_media_id) {
mpp_add_gallery_meta($gallery_id, '_mpp_unpublished_media_id', $new_media_id);
}
}
开发者ID:enboig,项目名称:mediapress,代码行数:20,代码来源:mpp-gallery-activity.php
示例16: mpp_filter_gallery_permalink
/**
* Filter get_permalink for mediapress gallery post type( mpp-gallery)
* aand make it like site.com/members/username/mediapressslug/gallery-name or site.com/{component-page}/{single-component}/mediapress-slug/gallery-name
* It allows us to get the permalink to gallery by using the_permalink/get_permalink functions
*/
function mpp_filter_gallery_permalink($permalink, $post, $leavename, $sample)
{
//check if BuddyPress is active, if not, we don't filter it yet
//lightweight check
if (!mediapress()->is_bp_active()) {
return $permalink;
}
//a little more expensive
if (mpp_get_gallery_post_type() != $post->post_type) {
return $permalink;
}
//this is expensive if the post is not cached
//If you see too many queries, just make sure to call _prime_post_caches($ids, true, true ); where $ids is collection of post ids
//that will save a lot of query
$gallery = mpp_get_gallery($post);
// do not modify permalinks for Sitewide gallery
if ($gallery->component == 'sitewide') {
return $permalink;
}
$slug = $gallery->slug;
$base_url = mpp_get_gallery_base_url($gallery->component, $gallery->component_id);
return apply_filters('mpp_get_gallery_permalink', $base_url . '/' . $slug, $gallery);
}
开发者ID:markc,项目名称:mediapress,代码行数:28,代码来源:mpp-gallery-hooks.php
示例17: mpp_core_render_feedback
/**
* Render the 'template_notices' feedback message.
*
* The hook action 'template_notices' is used to call this function, it is not
* called directly.
*/
function mpp_core_render_feedback()
{
// Get MediaPress
$mp = mediapress();
if (!empty($mp->template_message)) {
$type = 'success' === $mp->template_message_type ? 'updated' : 'error';
$content = apply_filters('mpp_core_render_feedback_content', $mp->template_message, $type);
?>
<div id="message" class="bp-template-notice mpp-template-notice <?php
echo esc_attr($type);
?>
">
<?php
echo wpautop($content);
?>
</div>
<?php
do_action('mpp_core_render_feedback');
}
}
开发者ID:enboig,项目名称:mediapress,代码行数:30,代码来源:mpp-feedback-functions.php
示例18: mpp_the_comment
/**
* Fetch the current comment
*
* @return type
*/
function mpp_the_comment()
{
$the_comment_query = mediapress()->the_comment_query;
return $the_comment_query->the_comment();
}
开发者ID:markc,项目名称:mediapress,代码行数:10,代码来源:mpp-comment-template-tags.php
示例19: mpp_get_asset_url
function mpp_get_asset_url($rel_path, $key)
{
$url = mediapress()->get_asset($key);
//check if it exists in users template folder
if (!$url) {
$template_dir = mpp_get_template_dir_name();
//'mediapress'
$url = '';
if (file_exists(STYLESHEETPATH . '/' . $template_dir . '/' . $rel_path)) {
$url = get_stylesheet_directory_uri() . '/' . $template_dir . '/' . $rel_path;
} elseif (file_exists(TEMPLATEPATH . '/' . $template_dir . '/' . $rel_path)) {
$url = get_template_directory_uri() . '/' . $template_dir . '/' . $rel_path;
}
if (!$url) {
$url = mediapress()->get_url() . 'templates/' . $template_dir . '/' . $rel_path;
}
//assume that the asset exists in our default template
//upadet in mpp asset cache
mediapress()->add_asset($key, $url);
}
return apply_filters('mpp_get_asset_url', $url, $rel_path);
}
开发者ID:baden03,项目名称:mediapress,代码行数:22,代码来源:template-helpers.php
示例20: is_bp_active
public function is_bp_active()
{
static $is_active;
if (isset($is_active)) {
return $is_active;
}
//if we are here, It is the first time
$is_active = function_exists('buddypress');
return $is_active;
}
public function set_theme_compat($bool)
{
$this->using_theme_compat = $bool;
}
public function is_using_theme_compat()
{
return $this->using_theme_compat;
}
}
/**
* A shortcut function to allow access to the singleton instance of the MediaPress
*
* @return MediaPress
*/
function mediapress()
{
return MediaPress::get_instance();
}
//initialize
mediapress();
开发者ID:enboig,项目名称:mediapress,代码行数:30,代码来源:mediapress.php
注:本文中的mediapress函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论