本文整理汇总了PHP中Su_Data::groups方法的典型用法代码示例。如果您正苦于以下问题:PHP Su_Data::groups方法的具体用法?PHP Su_Data::groups怎么用?PHP Su_Data::groups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Su_Data
的用法示例。
在下文中一共展示了Su_Data::groups方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: popup
/**
* Generator popup form
*/
public static function popup()
{
// Get cache
$output = get_transient('su/generator/popup');
if ($output && SU_ENABLE_CACHE) {
echo $output;
} else {
ob_start();
$tools = apply_filters('su/generator/tools', array('<a href="' . admin_url('admin.php?page=shortcodes-ultimate') . '#tab-1" target="_blank" title="' . __('Settings', 'su') . '">' . __('Plugin settings', 'su') . '</a>', '<a href="http://gndev.info/shortcodes-ultimate/" target="_blank" title="' . __('Plugin homepage', 'su') . '">' . __('Plugin homepage', 'su') . '</a>', '<a href="http://wordpress.org/support/plugin/shortcodes-ultimate/" target="_blank" title="' . __('Support forums', 'su') . '">' . __('Support forums', 'su') . '</a>'));
// Add add-ons links
if (!defined('SUE_PLUGIN_FILE') || !defined('SUS_PLUGIN_FILE') || !defined('SUM_PLUGIN_FILE')) {
$tools[] = '<a href="' . admin_url('admin.php?page=shortcodes-ultimate-addons') . '" target="_blank" title="' . __('Add-ons', 'su') . '" class="su-add-ons">' . __('Add-ons', 'su') . '</a>';
}
?>
<div id="su-generator-wrap" style="display:none">
<div id="su-generator">
<div id="su-generator-header">
<div id="su-generator-tools"><?php
echo implode(' <span></span> ', $tools);
?>
</div>
<input type="text" name="su_generator_search" id="su-generator-search" value="" placeholder="<?php
_e('Search for shortcodes', 'su');
?>
" />
<div id="su-generator-filter">
<strong><?php
_e('Filter by type', 'su');
?>
</strong>
<?php
foreach ((array) Su_Data::groups() as $group => $label) {
echo '<a href="#" data-filter="' . $group . '">' . $label . '</a>';
}
?>
</div>
<div id="su-generator-choices" class="su-generator-clearfix">
<?php
// Choices loop
foreach ((array) Su_Data::shortcodes() as $name => $shortcode) {
$icon = isset($shortcode['icon']) ? $shortcode['icon'] : 'puzzle-piece';
$shortcode['name'] = isset($shortcode['name']) ? $shortcode['name'] : $name;
echo '<span data-name="' . $shortcode['name'] . '" data-shortcode="' . $name . '" title="' . esc_attr($shortcode['desc']) . '" data-desc="' . esc_attr($shortcode['desc']) . '" data-group="' . $shortcode['group'] . '">' . Su_Tools::icon($icon) . $shortcode['name'] . '</span>' . "\n";
}
?>
</div>
</div>
<div id="su-generator-settings"></div>
<input type="hidden" name="su-generator-selected" id="su-generator-selected" value="<?php
echo plugins_url('', SU_PLUGIN_FILE);
?>
" />
<input type="hidden" name="su-generator-url" id="su-generator-url" value="<?php
echo plugins_url('', SU_PLUGIN_FILE);
?>
" />
<input type="hidden" name="su-compatibility-mode-prefix" id="su-compatibility-mode-prefix" value="<?php
echo su_compatibility_mode_prefix();
?>
" />
<div id="su-generator-result" style="display:none"></div>
</div>
</div>
<?php
$output = ob_get_contents();
set_transient('su/generator/popup', $output, 2 * DAY_IN_SECONDS);
ob_end_clean();
echo $output;
}
}
示例2: foreach
<input type="text" name="su_generator_search" id="su-generator-search" value="" placeholder="<?php
echo JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SEARCH_DESC');
?>
" />
<span class="su-search-hints"><?php
echo JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SEARCH_HINTS');
?>
</span>
</div>
<div id="su-generator-filter">
<strong><?php
echo JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_FILTER_DESC');
?>
</strong>
<?php
foreach ((array) Su_Data::groups() as $group => $label) {
echo '<a href="#" data-filter="' . $group . '">' . $label . '</a>';
}
?>
</div>
<div id="su-generator-choices" class="su-generator-clearfix">
<?php
// Choices loop
foreach ((array) Su_Data::shortcodes() as $name => $shortcode) {
$icon = isset($shortcode['icon']) ? $shortcode['icon'] : 'puzzle-piece';
$badge = isset($shortcode['badge']) ? '<strong class="sug-badge badge-' . strtolower($shortcode['badge']) . '">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODE_' . $shortcode['badge']) . '</strong>' : '';
$shortcode['name'] = isset($shortcode['name']) ? $shortcode['name'] : $name;
$visible = isset($shortcode['visible']) ? $shortcode['visible'] : true;
if ($visible == true) {
echo '<span data-name="' . $shortcode['name'] . '" data-shortcode="' . $name . '" title="' . $shortcode['desc'] . '" data-desc="' . $shortcode['desc'] . '" data-group="' . $shortcode['group'] . '">' . Su_Tools::icon($icon) . $shortcode['name'] . $badge . '</span>' . "\n";
}