本文整理汇总了PHP中c_ws_plugin__s2member_utilities::s_badge_gen方法的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_utilities::s_badge_gen方法的具体用法?PHP c_ws_plugin__s2member_utilities::s_badge_gen怎么用?PHP c_ws_plugin__s2member_utilities::s_badge_gen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类c_ws_plugin__s2member_utilities
的用法示例。
在下文中一共展示了c_ws_plugin__s2member_utilities::s_badge_gen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sc_s_badge
/**
* Handles the Shortcode for: `[s2Member-Security-Badge /]`.
*
* @package s2Member\Security_Badges
* @since 110524RC
*
* @attaches-to ``add_shortcode('s2Member-Security-Badge');``
*
* @param array $attr An array of Attributes.
* @param string $content Content inside the Shortcode.
* @param string $shortcode The actual Shortcode name itself.
*
* @return string Resulting Security Badge code; HTML markup.
*/
public static function sc_s_badge($attr = array(), $content = '', $shortcode = '')
{
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_before_sc_s_badge', get_defined_vars());
unset($__refs, $__v);
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
$attr = shortcode_atts(array('v' => '1'), $attr);
// One attribute.
$code = c_ws_plugin__s2member_utilities::s_badge_gen($attr['v'], FALSE, FALSE);
return apply_filters('ws_plugin__s2member_sc_s_badge', $code, get_defined_vars());
}
示例2: sc_s_badge
/**
* Handles the Shortcode for: `[s2Member-Security-Badge /]`.
*
* @package s2Member\Security_Badges
* @since 110524RC
*
* @attaches-to ``add_shortcode("s2Member-Security-Badge");``
*
* @param array $attr An array of Attributes.
* @param string $content Content inside the Shortcode.
* @param string $shortcode The actual Shortcode name itself.
* @return string Resulting Security Badge code; HTML markup.
*/
public static function sc_s_badge($attr = FALSE, $content = FALSE, $shortcode = FALSE)
{
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_sc_s_badge", get_defined_vars());
unset($__refs, $__v);
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
$attr = shortcode_atts(array("v" => "1"), $attr);
// One attribute.
$code = c_ws_plugin__s2member_utilities::s_badge_gen($attr["v"], false, false);
return apply_filters("ws_plugin__s2member_sc_s_badge", $code, get_defined_vars());
}
示例3: __construct
//.........这里部分代码省略.........
echo '<div class="ws-menu-page-section ws-plugin--s2member-lazy-load-section">' . "\n";
echo '<h3>CSS/JS Lazy Loading (Client-Side Libraries)</h3>' . "\n";
echo '<p>By default, s2Member will load it\'s CSS/JS libraries on every page of your site. However, you may wish to enable lazy-loading here (e.g. only load when absolutely necessary).</p>' . "\n";
echo '<p><em><strong>Tip:</strong> Do you need s2Member\'s CSS/JS on every page? If not, you can turn lazy-loading on. If you need s2Member\'s CSS/JS on a given Post/Page, you can insert an HTML comment into the Post/Page content like this: <code><!--s2member--></code>. If a Post/Page contains the word <code>s2member</code> or an <code>[s2*</code> Shortcode, this will automatically trigger s2Member\'s lazy-load routine (no matter what you configure here). Thus, it\'s an easy way to force s2Member to load it\'s CSS/JS on specific Posts/Pages where you deem this necessary. There is also a WordPress filter available: <code>add_filter("ws_plugin__s2member_lazy_load_css_js", "__return_true");</code> for developers; this could be incorporated into more dynamic scenarios.</em></p>' . "\n";
do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_lazy_load", get_defined_vars());
echo '<table class="form-table">' . "\n";
echo '<tbody>' . "\n";
echo '<tr>' . "\n";
echo '<th>' . "\n";
echo '<label for="ws-plugin--s2member-lazy-load-css-js">' . "\n";
echo 'Lazy-Load s2Member\'s CSS/JS Libraries?' . "\n";
echo '</label>' . "\n";
echo '</th>' . "\n";
echo '</tr>' . "\n";
echo '<tr>' . "\n";
echo '<td>' . "\n";
echo '<select name="ws_plugin__s2member_lazy_load_css_js" id="ws-plugin--s2member-lazy-load-css-js">' . "\n";
echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["lazy_load_css_js"] ? ' selected="selected"' : '') . '>No (always load the CSS/JS libraries; e.g. on every page of the site)</option>' . "\n";
echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["lazy_load_css_js"] ? ' selected="selected"' : '') . '>Yes (lazy-load CSS/JS libraries; e.g. load only when absolutely necessary)</option>' . "\n";
echo '</select>' . "\n";
echo '</td>' . "\n";
echo '</tr>' . "\n";
echo '</tbody>' . "\n";
echo '</table>' . "\n";
echo '</div>' . "\n";
echo '</div>' . "\n";
do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_lazy_load", get_defined_vars());
}
if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_s_badge_wp_footer_code", TRUE, get_defined_vars())) {
do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_s_badge_wp_footer_code", get_defined_vars());
echo '<div class="ws-menu-page-group" title="s2Member Security Badge">' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-s-badge-wp-footer-code-section">' . "\n";
echo '<h3>Security Badge & Footer Configuration (optional)</h3>' . "\n";
echo '<div class="ws-menu-page-right">' . c_ws_plugin__s2member_utilities::s_badge_gen("1", TRUE, TRUE) . '</div>' . "\n";
echo '<p>An s2Member Security Badge <em>(optional)</em>, can be used to express your site\'s concern for security; demonstrating to all Users/Members that your site <em>(and the s2Member software)</em>, takes security seriously. However, in order to qualify your site, you MUST generate a Security Encryption Key <em>(previous section)</em>, and then click "Save All Changes". Only then, will s2Member officially verify your installation <em>(verification occurs automatically)</em>.</p>' . "\n";
echo '<p>Once you\'ve <a href="http://www.s2member.com/kb/security-badges/" target="_blank" rel="external">properly configured all security aspects of s2Member</a>, your s2Member Security Badge will be verified. To see the "verified" version of your Security Badge, you might need to refresh your browser after saving all changes <em>(i.e. after you create a Security Encryption Key)</em>. Also, s2Member will NOT "verify" your site if you turn off Unique IP Restrictions, Brute Force Login Protection, or if your <code>/wp-config.php</code> file lacks <a href="http://codex.wordpress.org/Editing_wp-config.php#Security_Keys" target="_blank" rel="external">Security Keys</a> <em>(each at least 60 chars in length)</em>. In addition, it\'s NOT possible for s2Member to verify your Security Badge, if your site is in a <code>localhost</code> environment; i.e. not connected to the web.</p>' . "\n";
echo '<p><strong>How does s2Member know when my site is secure?</strong><br />If enabled below, an API call for "Security Badge Status", will allow web service connections to determine your status. Clicking <a href="' . esc_attr(site_url("/?s2member_s_badge_status=1")) . '" target="_blank" rel="external">this link</a> will report <code>1</code> <em>(secure)</em>, <code>0</code> <em>(at risk)</em>, or <code>-</code> <em>(API disabled)</em>. Once all security considerations are satisfied, s2Member will report <code>1</code> <em>(secure)</em> for your installation. *Note, this simple API will NOT, and should not, report any other information. It will ONLY report the current status of your Security Badge, as determined by your installation of s2Member. When/if you install the s2Member Security Badge, s2Member will make a connection to your site "once per day", to test your status.</p>' . "\n";
do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_s_badge_wp_footer_code", get_defined_vars());
echo '<table class="form-table">' . "\n";
echo '<tbody>' . "\n";
echo '<tr>' . "\n";
echo '<th>' . "\n";
echo '<label for="ws-plugin--s2member-s-badge-status-enabled">' . "\n";
echo 'Enable Security Badge Status API?' . "\n";
echo '</label>' . "\n";
echo '</th>' . "\n";
echo '</tr>' . "\n";
echo '<tr>' . "\n";
echo '<td>' . "\n";
echo '<select name="ws_plugin__s2member_s_badge_status_enabled" id="ws-plugin--s2member-s-badge-status-enabled">' . "\n";
echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["s_badge_status_enabled"] ? ' selected="selected"' : '') . '>No (default, Badge Status API is disabled)</option>' . "\n";
echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["s_badge_status_enabled"] ? ' selected="selected"' : '') . '>Yes (enable Badge Status API for verification)</option>' . "\n";
echo '</select><br />' . "\n";
echo 'This must be enabled if you want s2Member to verify your Security Badge.' . "\n";
echo '</td>' . "\n";
echo '</tr>' . "\n";
echo '<tr>' . "\n";
echo '<th>' . "\n";
echo '<label for="ws-plugin--s2member-wp-footer-code">' . "\n";
echo 'Customize WordPress Footer:<br />' . "\n";
echo '<small>[ <a href="#" onclick="this.$code = jQuery(\'textarea#ws-plugin--s2member-wp-footer-code\'); this.$code.val(jQuery.trim(unescape(\'' . rawurlencode('[s2Member-Security-Badge v="1" /]') . '\')+\'\\n\'+this.$code.val())); return false;">Click HERE to insert your Security Badge</a> ],<br />or use Shortcode <code>[s2Member-Security-Badge v="1" /]</code> in a Post/Page/Widget.<br />The <code>v="1"</code> attribute is a Security Badge style/variation. Try variations <code>1|2|3</code>.</small>' . "\n";
echo '</label>' . "\n";
echo '</th>' . "\n";
echo '</tr>' . "\n";
echo '<tr>' . "\n";
echo '<td>' . "\n";