本文整理汇总了PHP中bbp_get_version函数的典型用法代码示例。如果您正苦于以下问题:PHP bbp_get_version函数的具体用法?PHP bbp_get_version怎么用?PHP bbp_get_version使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bbp_get_version函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_dependency_satisfied
/**
* Check if plugin dependencies are satisfied and add an admin notice if not
*
* @return bool
*/
public static function is_dependency_satisfied()
{
if (class_exists('bbPress') && version_compare(bbp_get_version(), self::PLUGIN_MIN_VERSION, '>=')) {
return true;
}
return false;
}
示例2: sandwich_bbpress_enqueue_editor_styles
/**
* Adds the default bbPress styles into the editor
*
* @see bbp_default_styles filter
* @see BBP_Default->enqueue_styles()
*/
public function sandwich_bbpress_enqueue_editor_styles($styles)
{
foreach ($styles as $handle => $attributes) {
$styleUrl = bbp_enqueue_style($handle, $attributes['file'], $attributes['dependencies'], bbp_get_version(), 'screen');
add_editor_style($styleUrl);
}
return $styles;
}
示例3: setup_globals
/**
* Component global variables
*
* Note that this function is currently commented out in the constructor.
* It will only be used if you copy this file into your current theme and
* uncomment the line above.
*
* You'll want to customize the values in here, so they match whatever your
* needs are.
*
* @since bbPress (r3732)
* @access private
*/
private function setup_globals()
{
$bbp = bbpress();
$this->id = 'default';
$this->name = __('bbPress Default', 'bbpress');
$this->version = bbp_get_version();
$this->dir = trailingslashit($bbp->themes_dir . 'default');
$this->url = trailingslashit($bbp->themes_url . 'default');
}
示例4: setup_globals
/**
* Component global variables
*
* @since bbPress (r2626)
* @access private
* @uses bbp_get_version() To get the bbPress version
* @uses get_stylesheet_directory() To get the stylesheet path
* @uses get_stylesheet_directory_uri() To get the stylesheet uri
*/
private function setup_globals()
{
$bbp = bbpress();
$this->id = 'bbp-twentyten';
$this->name = __('Twenty Ten (bbPress)', 'bbpress');
$this->version = bbp_get_version();
$this->dir = trailingslashit($bbp->themes_dir . 'bbp-twentyten');
$this->url = trailingslashit($bbp->themes_url . 'bbp-twentyten');
}
示例5: d4p_bbpress_version
/**
* Get version of the bbPress.
*
* @param string $ret what version format to return: code or version
* @return mixed version value
*/
function d4p_bbpress_version($ret = 'code')
{
if (!d4p_has_bbpress()) {
return null;
}
$version = bbp_get_version();
if (isset($version)) {
if ($ret == 'code') {
return substr(str_replace('.', '', $version), 0, 2);
} else {
return $version;
}
}
return null;
}
示例6: get_remote_request_params
public static function get_remote_request_params()
{
$_key = pp_get_option('support_key');
if (is_array($_key) && isset($_key[1])) {
$key = $_key[1];
} else {
$key = '';
}
global $wpdb;
$data = array('call' => 'pp', 'key' => $key, 'core' => PPC_VERSION, 'wp' => get_bloginfo('version'), 'is_ms' => PP_MULTISITE, 'php' => phpversion(), 'mysql' => $wpdb->db_version());
$data['bp'] = defined('BP_VERSION') ? BP_VERSION : 0;
$data['bbp'] = function_exists('bbp_get_version') ? bbp_get_version() : 0;
$data['rvy'] = defined('RVY_VERSION') ? RVY_VERSION : 0;
$data['cme'] = defined('CAPSMAN_ENH_VERSION') ? CAPSMAN_ENH_VERSION : 0;
global $pp_extensions;
foreach ($pp_extensions as $slug => $ext) {
$data[$slug] = isset($ext->version) ? $ext->version : 0;
}
$data['beta_updates'] = pp_get_option('beta_updates');
return $data;
}
示例7: admin_head
/**
* Add some general styling to the admin area
*
* @since bbPress (r2464)
*
* @uses bbp_get_forum_post_type() To get the forum post type
* @uses bbp_get_topic_post_type() To get the topic post type
* @uses bbp_get_reply_post_type() To get the reply post type
* @uses sanitize_html_class() To sanitize the classes
*/
public function admin_head()
{
// Remove the individual recount and converter menus.
// They are grouped together by h2 tabs
remove_submenu_page('tools.php', 'bbp-repair');
remove_submenu_page('tools.php', 'bbp-converter');
remove_submenu_page('tools.php', 'bbp-reset');
// The /wp-admin/images/ folder
$wp_admin_url = admin_url('images/');
// Icons for top level admin menus
$version = bbp_get_version();
$menu_icon_url = $this->images_url . 'menu.png?ver=' . $version;
$icon32_url = $this->images_url . 'icons32.png?ver=' . $version;
$menu_icon_url_2x = $this->images_url . 'menu-2x.png?ver=' . $version;
$icon32_url_2x = $this->images_url . 'icons32-2x.png?ver=' . $version;
// Top level menu classes
$forum_class = sanitize_html_class(bbp_get_forum_post_type());
$topic_class = sanitize_html_class(bbp_get_topic_post_type());
$reply_class = sanitize_html_class(bbp_get_reply_post_type());
?>
<style type="text/css" media="screen">
/*<![CDATA[*/
#bbp-dashboard-right-now p.sub,
#bbp-dashboard-right-now .table,
#bbp-dashboard-right-now .versions {
margin: -12px;
}
#bbp-dashboard-right-now .inside {
font-size: 12px;
padding-top: 20px;
margin-bottom: 0;
}
#bbp-dashboard-right-now p.sub {
padding: 5px 0 15px;
color: #8f8f8f;
font-size: 14px;
position: absolute;
top: -17px;
left: 15px;
}
body.rtl #bbp-dashboard-right-now p.sub {
right: 15px;
left: 0;
}
#bbp-dashboard-right-now .table {
margin: 0;
padding: 0;
position: relative;
}
#bbp-dashboard-right-now .table_content {
float: left;
border-top: #ececec 1px solid;
width: 45%;
}
body.rtl #bbp-dashboard-right-now .table_content {
float: right;
}
#bbp-dashboard-right-now .table_discussion {
float: right;
border-top: #ececec 1px solid;
width: 45%;
}
body.rtl #bbp-dashboard-right-now .table_discussion {
float: left;
}
#bbp-dashboard-right-now table td {
padding: 3px 0;
white-space: nowrap;
}
#bbp-dashboard-right-now table tr.first td {
border-top: none;
}
#bbp-dashboard-right-now td.b {
padding-right: 6px;
text-align: right;
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
font-size: 14px;
width: 1%;
}
body.rtl #bbp-dashboard-right-now td.b {
//.........这里部分代码省略.........
示例8: register_theme_packages
/**
* Register bundled theme packages
*
* Note that since we currently have complete control over bbp-themes and
* the bbp-theme-compat folders, it's fine to hardcode these here. If at a
* later date we need to automate this, and API will need to be built.
*
* @since bbPress (r3829)
*/
public function register_theme_packages()
{
/** Default Theme *****************************************************/
bbp_register_theme_package(array('id' => 'default', 'name' => __('bbPress Default', 'bbpress'), 'version' => bbp_get_version(), 'dir' => trailingslashit($this->plugin_dir . 'bbp-theme-compat'), 'url' => trailingslashit($this->plugin_url . 'bbp-theme-compat')));
/** Twenty Ten ********************************************************/
bbp_register_theme_package(array('id' => 'bbp-twentyten', 'name' => __('Twenty Ten (bbPress)', 'bbpress'), 'version' => bbp_get_version(), 'dir' => trailingslashit($this->themes_dir . 'bbp-twentyten'), 'url' => trailingslashit($this->themes_url . 'bbp-twentyten')));
}
示例9: bbp_version
/**
* Output the bbPress version
*
* @since 2.0.0 bbPress (r3468)
*
* @uses bbp_get_version() To get the bbPress version
*/
function bbp_version()
{
echo bbp_get_version();
}
示例10: credits_screen
/**
* Output the credits screen
*
* @since bbPress (r4159)
*/
public function credits_screen()
{
$display_version = bbp_get_version();
?>
<div class="wrap about-wrap">
<h1><?php
printf(__('Welcome to bbPress %s'), $display_version);
?>
</h1>
<div class="about-text"><?php
printf(__('Thank you for updating to the latest version! bbPress %s is ready to make your community a safer, faster, and better looking place to hang out!'), $display_version);
?>
</div>
<div class="bbp-badge"><?php
printf(__('Version %s'), $display_version);
?>
</div>
<h2 class="nav-tab-wrapper">
<a href="<?php
echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-about'), 'index.php')));
?>
" class="nav-tab">
<?php
_e('What’s New');
?>
</a><a href="<?php
echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-credits'), 'index.php')));
?>
" class="nav-tab nav-tab-active">
<?php
_e('Credits');
?>
</a>
</h2>
<div class="return-to-dashboard">
<a href="<?php
echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-settings'), 'index.php')));
?>
"><?php
_e('Go to Forum Settings');
?>
</a>
</div>
</div>
<?php
}
示例11: ass_bbp_ready
/**
* Stuff to do when the bbPress plugin is ready.
*
* @since 3.4.1
*/
function ass_bbp_ready()
{
/**
* bbPress v2.5.4 changed how emails are sent out.
*
* They now send one BCC email to their subscribers, so we have to filter out
* the topic subscribers before their email is sent.
*/
if (version_compare(bbp_get_version(), '2.5.4') >= 0) {
add_filter('bbp_subscription_mail_title', 'ass_bbp_add_topic_subscribers_filter', 99);
add_action('bbp_pre_notify_subscribers', 'ass_bbp_remove_topic_subscribers_filter', 0);
// bbPress <= v2.5.3
} else {
add_filter('bbp_subscription_mail_message', 'ass_bbp_disable_email', 10, 4);
}
}
示例12: http_post
/**
* Submit data to Akismet service with unique bbPress User Agent
*
* This code is directly taken from the akismet_http_post() function and
* documented to bbPress 2.0 standard.
*
* @since 2.0.0 bbPress (r3466)
*
* @param string $request The request we are sending
* @param string $host The host to send our request to
* @param string $path The path from the host
* @param string $port The port to use
* @param string $ip Optional Override $host with an IP address
* @uses bbp_get_version() To get the current bbPress version
* @return mixed WP_Error on error, array on success, empty on failure
*/
private function http_post($request, $host, $path, $port = 80, $ip = '')
{
// Preload required variables
$bbp_version = bbp_get_version();
$http_host = $host;
$blog_charset = get_option('blog_charset');
$response = '';
// Untque User Agent
$akismet_ua = "bbPress/{$bbp_version} | ";
$akismet_ua .= 'Akismet/' . constant('AKISMET_VERSION');
// Use specific IP (if provided)
if (!empty($ip) && long2ip(ip2long($ip))) {
$http_host = $ip;
}
// Setup the arguments
$http_args = array('body' => $request, 'headers' => array('Content-Type' => 'application/x-www-form-urlencoded; charset=' . $blog_charset, 'Host' => $host, 'User-Agent' => $akismet_ua), 'httpversion' => '1.0', 'timeout' => 15);
// Where we are sending our request
$akismet_url = 'http://' . $http_host . $path;
// Send the request
$response = wp_remote_post($akismet_url, $http_args);
// Bail if the response is an error
if (is_wp_error($response)) {
return '';
}
// No errors so return response
return array($response['headers'], $response['body']);
}
示例13: credits_screen
/**
* Output the credits screen
*
* Hardcoding this in here is pretty janky. It's fine for 2.2, but we'll
* want to leverage api.wordpress.org eventually.
*
* @since bbPress (r4159)
*/
public function credits_screen()
{
list($display_version) = explode('-', bbp_get_version());
?>
<div class="wrap about-wrap">
<h1><?php
printf(__('Welcome to bbPress %s'), $display_version);
?>
</h1>
<div class="about-text"><?php
printf(__('Thank you for updating to the latest version! bbPress %s is ready to make your community a safer, faster, and better looking place to hang out!'), $display_version);
?>
</div>
<div class="bbp-badge"><?php
printf(__('Version %s'), $display_version);
?>
</div>
<h2 class="nav-tab-wrapper">
<a href="<?php
echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-about'), 'index.php')));
?>
" class="nav-tab">
<?php
_e('What’s New');
?>
</a><a href="<?php
echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-credits'), 'index.php')));
?>
" class="nav-tab nav-tab-active">
<?php
_e('Credits');
?>
</a>
</h2>
<p class="about-description"><?php
_e('bbPress is created by a worldwide swarm of busy, busy bees.', 'bbpress');
?>
</p>
<h4 class="wp-people-group"><?php
_e('Project Leaders', 'bbpress');
?>
</h4>
<ul class="wp-people-group " id="wp-people-group-project-leaders">
<li class="wp-person" id="wp-person-matt">
<a href="http://profiles.wordpress.org/matt"><img src="http://0.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=60" class="gravatar" alt="Matt Mullenweg" /></a>
<a class="web" href="http://profiles.wordpress.org/matt">Matt Mullenweg</a>
<span class="title"><?php
_e('Founding Developer', 'bbpress');
?>
</span>
</li>
<li class="wp-person" id="wp-person-johnjamesjacoby">
<a href="http://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a>
<a class="web" href="http://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a>
<span class="title"><?php
_e('Lead Developer', 'bbpress');
?>
</span>
</li>
</ul>
<h4 class="wp-people-group"><?php
_e('Contributing Developers', 'bbpress');
?>
</h4>
<ul class="wp-people-group " id="wp-people-group-contributing-developers">
<li class="wp-person" id="wp-person-jmdodd">
<a href="http://profiles.wordpress.org/jmdodd"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Jennifer M. Dodd" /></a>
<a class="web" href="http://profiles.wordpress.org/jmdodd">Jennifer M. Dodd</a>
<span class="title"></span>
</li>
<li class="wp-person" id="wp-person-jaredatch">
<a href="http://profiles.wordpress.org/jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a>
<a class="web" href="http://profiles.wordpress.org/jaredatch">Jared Atchison</a>
<span class="title"></span>
</li>
<li class="wp-person" id="wp-person-gautamgupta">
<a href="http://profiles.wordpress.org/gautamgupta"><img src="http://0.gravatar.com/avatar/b0810422cbe6e4eead4def5ae7a90b34?s=60" class="gravatar" alt="Gautam Gupta" /></a>
<a class="web" href="http://profiles.wordpress.org/gautamgupta">Gautam Gupta</a>
<span class="title"></span>
</li>
</ul>
<h4 class="wp-people-group"><?php
_e('Codex Rockstars', 'bbpress');
?>
</h4>
<ul class="wp-people-group " id="wp-people-group-codex-rockstars">
//.........这里部分代码省略.........
示例14: __construct
/**
* The main bbPress (Default) Loader
*
* @since bbPress (r3732)
*
* @uses BBP_IOA::setup_globals()
* @uses BBP_IOA::setup_actions()
*/
public function __construct($properties = array())
{
parent::__construct(bbp_parse_args($properties, array('id' => 'IOA', 'name' => __('BBPress IOA', 'bbpress'), 'version' => bbp_get_version(), 'dir' => trailingslashit(get_template_directory() . '/external/bbpress'), 'url' => trailingslashit(get_template_directory_uri() . '/external/bbpress')), 'default_theme'));
$this->setup_actions();
}
示例15: bbp_dashboard_widget_right_now
//.........这里部分代码省略.........
</td>
<td class="last t hidden-replies"><?php
echo $text;
?>
</td>
</tr>
<?php
}
?>
<?php
if (isset($r['reply_count_hidden'])) {
?>
<tr>
<?php
$num = $r['reply_count_hidden'];
$text = _n('Hidden Reply', 'Hidden Replies', $r['reply_count_hidden'], 'bbpress');
$link = add_query_arg(array('post_type' => bbp_get_reply_post_type()), get_admin_url(null, 'edit.php'));
if ('0' !== $num) {
$link = add_query_arg(array('post_status' => bbp_get_spam_status_id()), $link);
}
$num = '<a href="' . esc_url($link) . '" title="' . esc_attr($r['hidden_reply_title']) . '">' . $num . '</a>';
$text = '<a class="waiting" href="' . esc_url($link) . '" title="' . esc_attr($r['hidden_reply_title']) . '">' . $text . '</a>';
?>
<td class="b b-hidden-replies"><?php
echo $num;
?>
</td>
<td class="last t hidden-replies"><?php
echo $text;
?>
</td>
</tr>
<?php
}
?>
<?php
if (bbp_allow_topic_tags() && isset($r['empty_topic_tag_count'])) {
?>
<tr>
<?php
$num = $r['empty_topic_tag_count'];
$text = _n('Empty Topic Tag', 'Empty Topic Tags', $r['empty_topic_tag_count'], 'bbpress');
$link = add_query_arg(array('taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type()), get_admin_url(null, 'edit-tags.php'));
$num = '<a href="' . esc_url($link) . '">' . $num . '</a>';
$text = '<a class="waiting" href="' . esc_url($link) . '">' . $text . '</a>';
?>
<td class="b b-hidden-topic-tags"><?php
echo $num;
?>
</td>
<td class="last t hidden-topic-tags"><?php
echo $text;
?>
</td>
</tr>
<?php
}
?>
<?php
do_action('bbp_dashboard_widget_right_now_discussion_table_end');
?>
</table>
</div>
<?php
do_action('bbp_dashboard_widget_right_now_table_end');
?>
<div class="versions">
<span id="wp-version-message">
<?php
printf(__('You are using <span class="b">bbPress %s</span>.', 'bbpress'), bbp_get_version());
?>
</span>
</div>
<br class="clear" />
<?php
do_action('bbp_dashboard_widget_right_now_end');
}