本文整理汇总了PHP中freemius函数的典型用法代码示例。如果您正苦于以下问题:PHP freemius函数的具体用法?PHP freemius怎么用?PHP freemius使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了freemius函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: freemius
<?php
/**
* @package Freemius
* @copyright Copyright (c) 2015, Freemius, Inc.
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.1.2
*/
if (!defined('ABSPATH')) {
exit;
}
$slug = $VARS['slug'];
$fs = freemius($slug);
$confirmation_message = $fs->apply_filters('uninstall_confirmation_message', '');
$reasons = $VARS['reasons'];
$reasons_list_items_html = '';
foreach ($reasons as $reason) {
$list_item_classes = 'reason' . (!empty($reason['input_type']) ? ' has-input' : '');
$reasons_list_items_html .= '<li class="' . $list_item_classes . '" data-input-type="' . $reason['input_type'] . '" data-input-placeholder="' . $reason['input_placeholder'] . '"><label><span><input type="radio" name="selected-reason" value="' . $reason['id'] . '"/></span><span>' . $reason['text'] . '</span></label></li>';
}
?>
<script type="text/javascript">
(function ($) {
var reasonsHtml = <?php
echo json_encode($reasons_list_items_html);
?>
,
modalHtml =
'<div class="fs-modal<?php
echo empty($confirmation_message) ? ' no-confirmation-message' : '';
?>
示例2: foreach
<th></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
$odd = true;
foreach ($addons_to_show as $addon_id) {
?>
<?php
$addon = $fs->get_addon($addon_id);
$is_addon_activated = $fs->is_addon_activated($addon->slug);
$is_addon_connected = $fs->is_addon_connected($addon->slug);
$fs_addon = $is_addon_connected ? freemius($addon->slug) : false;
if (is_object($fs_addon)) {
$is_paying = $fs_addon->is_paying();
$user = $fs_addon->get_user();
$site = $fs_addon->get_site();
$license = $fs_addon->_get_license();
$subscription = $fs_addon->_get_subscription();
$plan = $fs_addon->get_plan();
$is_active_subscription = is_object($subscription) && $subscription->is_active();
$is_paid_trial = $fs_addon->is_paid_trial();
$show_upgrade = !$is_paying && !$is_paid_trial && !$fs_addon->_has_premium_license();
$is_current_license_expired = is_object($license) && $license->is_expired();
}
// var_dump( $is_paid_trial, $license, $site, $subscription );
?>
<tr<?php
示例3: _efs
</th>
<th><?php
_efs('public-key');
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($plugins as $slug => $data) {
?>
<?php
$is_active = is_plugin_active($data->file);
?>
<?php
$fs = $is_active ? freemius($slug) : null;
?>
<tr<?php
if ($is_active) {
echo ' style="background: #E6FFE6; font-weight: bold"';
}
?>
>
<td><?php
echo $data->id;
?>
</td>
<td><?php
echo $slug;
?>
</td>
示例4: foreach
if (defined('WP_FS__DEV_MODE') && WP_FS__DEV_MODE) {
?>
<th></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
foreach ($addons_to_show as $addon_id) {
?>
<?php
$addon = $fs->get_addon($addon_id);
$is_addon_activated = $fs->is_addon_activated($addon->slug);
$fs_addon = $is_addon_activated ? freemius($addon->slug) : false;
?>
<tr>
<td>
<?php
echo $addon->title;
?>
</td>
<?php
if ($is_addon_activated) {
?>
<?php
// Add-on Installed
?>
<?php
$addon_site = $fs_addon->get_site();
示例5: fs_ui_action_link
function fs_ui_action_link($slug, $page, $action, $title, $params = array())
{
?>
<a class=""
href="<?php
echo wp_nonce_url(freemius($slug)->_get_admin_page_url($page, array_merge($params, array('fs_action' => $action))), $action);
?>
"><?php
echo $title;
?>
</a><?php
}