first commit

This commit is contained in:
CHIEFSOFT\ameye
2023-11-30 13:20:54 -05:00
commit e9e5c0546c
5833 changed files with 1801865 additions and 0 deletions
+575
View File
@@ -0,0 +1,575 @@
=== Powerkit Supercharge your WordPress Site ===
Tags: share buttons, social links, Facebook, Twitter, Pinterest, Instagram, lightbox, slider, gallery, lazyload
Requires at least: 4.0
Tested up to: 6.0
Requires PHP: 5.4
Stable tag: 2.8.2
Contributors: codesupplyco
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Essential components for every WordPress site: share buttons, social links, social media integrations, galleries, lazyload, custom widgets, and more.
== Description ==
We've been developing [premium WordPress themes](https://codesupply.co) for a few years and have always been lacking essentials things in the WordPress core.
There're numerous plugins in the WordPress repository, however if you install them all, there's inconsistency in their backend and frontend styles and possible plugin conflicts.
That's why we created Powerkit, essentials components for every WordPress blog or magazine.
Components have modular structure and can be enabled or disabled with a single click. They have been thoroughly tested and play well together.
### Social Integrations
- Share Buttons
- Social Links
- Facebook Integration
- Pinterest Integration
- Twitter Integration
- Instagram Integration
### Marketing
- Opt-In Forms
### Content Presentation
- Basic Shortcodes
- Justified Gallery
- Slider Gallery
- Lightbox
- Typekit Fonts
- Custom Fonts
### Image Optimization
- Retina Images
- Lazyload
### Utilities
- Contributors Widget
- Author Widget
- Featured Posts Widget
- Scroll To Top Button
== Installation ==
1. Upload `powerkit` to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
1. Enable or disable modules in the Powerkit menu
== Frequently Asked Questions ==
= Is it free? =
Yes, Powerkit is free both for personal and commercial use. You may even bundle Powerkit with your own WordPress themes.
= I feel lost. Where can I find the complete plugin documentation? =
The complete docs can be found [here](https://codesupply.co/documentation/powerkit).
= Can I extend Powerkit? =
Sure! Powerkit is developer-friendly. There're numerous hooks and filters, so extending Powerkit and integrating it with your theme is easy. Please refer to our [documentation for developers](https://codesupply.co/documentation/powerkit/developers).
== Screenshots ==
1. List of Modules.
2. Share Buttons.
3. Social Links.
4. Custom Fonts.
== Changelog ==
= 2.8.2 =
* Improved Contributors Block
= 2.8.1 =
* Improved Social Links
= 2.8.0 =
* Added setting "Override Description" to Author Block
= 2.7.9 =
* Added support Block Image to Lazy Load
= 2.7.8 =
* Fixed Contributors Block
= 2.7.7 =
* Added compatibility with PHP 8.1
= 2.7.6 =
* Improved Social Connect module
= 2.7.5 =
* Added support WebP in Lightbox and Pin It
= 2.7.4 =
* Optimized JS\CSS files
= 2.7.3 =
* Added setting "Default State" to TOC
= 2.7.2 =
* Fixed calculate post reading time
= 2.7.1 =
* Fixed Post Views
= 2.7.0 =
* Improved calculate post reading time
= 2.6.9 =
* Improved Pin it for Gallery
= 2.6.8 =
* Improved REST API
= 2.6.7 =
* Fixed integration with Twitter
= 2.6.6 =
* Fixed wp_kses_allowed_html filter
= 2.6.5 =
* Added compatibility with WordPress 5.9
= 2.6.4 =
* Improved Coming Soon Module
= 2.6.3 =
* Fixed AMP compatibility
= 2.6.2 =
* Removed deprecated modules
= 2.6.1 =
* Replaced "Magnific Popup" to "Glightbox"
= 2.6.0 =
* Improved security
= 2.5.9 =
* Minor fixes
= 2.5.8 =
* Improved coming soon page
* Updated flickity library
= 2.5.7 =
* Fixed Typekit Fonts
= 2.5.6 =
* Added compatibility with php 8.0
= 2.5.5 =
* Improved Google Lighthouse scores
= 2.5.4 =
* Improved plugin security
= 2.5.3 =
* Improved display Facebook comments
= 2.5.2 =
* Updated justifiedGallery library
= 2.5.1 =
* Improved Lightbox Module
* Improved Reading Time Module
= 2.5.0 =
* Added data update to Post Views when caching the site
= 2.4.9 =
* Improved performance
= 2.4.8 =
* Improved lightbox
= 2.4.7 =
* Added "Description Length" control to Author Box
= 2.4.6 =
* Improved "Inline Posts"
= 2.4.5 =
* Improved social follow
= 2.4.4 =
* Added setting "Display Button Hide" to TOC
= 2.4.3 =
* Added check for PHP GD module
= 2.4.2 =
* Improved post format ui
= 2.4.1 =
* Added support attributes to author social links
* Added support embed page to Lazy Load
= 2.4.0 =
* Fixed post format ui
* Fixed html markup for W3C
= 2.3.9 =
* Hide label for social links without counter
= 2.3.8 =
* Added support custom post type to Widget Posts
= 2.3.7 =
* Added filter to reading time for the number of characters read per minute
= 2.3.6 =
* Changed FaceBook Icon
= 2.3.5 =
* Improved Highlight Share
= 2.3.4 =
* Fixed js in dashboard
= 2.3.3 =
* Fixed image upload in category
= 2.3.2 =
* Compatibility fixes for WordPress 5.5
* Improved Table of Contents
= 2.3.1 =
* Minor fixes
= 2.3.0 =
* Improved Table of Contents
* Improved Business Instagram
* Improved notify in Social Links
* Added TikTok & Discord to Social Links
= 2.2.9 =
* Fixed js events in basic elements for ajax content
= 2.2.8 =
* Improve YouTube API
= 2.2.7 =
* Minor improvements
= 2.2.6 =
* Add Support Manual Count Override to Follow
= 2.2.5 =
* Change YouTube Icon
= 2.2.4 =
* Improve Social Follow
= 2.2.3 =
* Improved Plugin Translation
* Fixed Post Views
= 2.2.2 =
* Improve Social Connect
= 2.2.1 =
* Improve Twitter module
= 2.2.0 =
* Integration Socials App for Instagram, Facebook and Twitter
* Added Manual Count Override to Social Links
* Improved Post Views module
* Updated instructions on Post Views
* Fixed minor Adobe fonts
= 2.1.3 =
* Improve Opt-In Form
= 2.1.2 =
* Compatibility with wp 5.4
= 2.1.1 =
* Changed blogloving icon
= 2.1.0 =
* Fixed Coming Soon module
= 2.0.9 =
* Fixed AMP styles
= 2.0.8.1 =
* Fixed styles of modules
= 2.0.8 =
* Changed blogloving icon to heart
* Fixed content formatting in Classic Editor
= 2.0.7 =
* Integration Post Views Counter to Post Views Module
= 2.0.6 =
* Fix Slider and Justified Gallery
= 2.0.5 =
* Minor fixed
= 2.0.4 =
* Fix сlassic gallery
* Fix powerkit font link
= 2.0.3 =
* Improve "Coming Soon" default content
= 2.0.2 =
* Add preload for font icons
= 2.0.1 =
* Minor improvements
= 2.0.0 =
* Add full integration of plugin "Canvas"
* Author Block
* Contributors Block
* Instagram Block
* Facebook Block
* Pinterest Block
* Opt-in-forms Block
* Share Buttons Block
* Social Links Block
* Table of Contents Block
* Twitter
* Add "Post Views" module
* Add "Coming Soon" module
* Add "Reading Time" module
* Add "Insert Headers & Footers" Module
* Add "Featured Categories" widget
* Add many new service providers to social links
* Add WhatsApp to Social Links
* Add Strava to Social Links
* Add Mix.com share button
* Add Goodreads to Social Links
* Add an option to display Table of Contents in all posts without a shortcode
* Add support for data-pin-description image attribute for "Pin It" buttons
* Many other improvements and fixes
= 1.8.4 =
* Improve blocks
= 1.8.3 =
* Improved get counters for VK.com
= 1.8.2 =
* Add support Webfonts load method
* Add Weibo & WeChat to social links
= 1.8.1 =
* Improved compatibility of the subscription form with the cache on the site
= 1.8.0 =
* Fixed format Social Links
= 1.7.9 =
* Improved style Social Links
= 1.7.8 =
* Improved Social Links
* Improved Instagram Integration
= 1.7.7 =
* Improved get counters for Facebook
= 1.7.6 =
* Fixed get counters for Facebook
= 1.7.5 =
* Added Blockquote Share
* Added Highlight and Share
* Improved lazyloaded
= 1.7.4 =
* Fixed Recover shares
= 1.7.3 =
* Fixed get share counters for Facebook
= 1.7.2 =
* Added Xing to share buttons
* Improved lazyloaded
* Improved unicode codes for icon fonts
* Removed links to SCSS source maps from all css files
* Removed Google Plus
= 1.7.1 =
* Added support templates to scroll to top
* Fixed facebook social links
= 1.7.0 =
* Minor improvements
= 1.6.7 =
* Removed dependency on multibyte string functions
= 1.6.6 =
* Added Odnoklassniki to social links / share buttons
* Added Xing to social links
* Improved share count algorythm
* Fixed Pin It buttons conflicting with the Lazy Load
= 1.6.5 =
* Fixed basic shortcodes button in the classic block
= 1.6.4 =
* Gutenberg improvements
= 1.6.3 =
* Fixed migration
= 1.6.2 =
* Minor improvements
= 1.6.0 =
* WordPress 5.0 Compatibility
* Added support Post Format UI to Gutenberg
* Fixed Pin It in Gutenberg
= 1.5.4 =
* Improvement Facebook Social Links
= 1.5.3 =
* Fixed link color in subscribe block when background is set.
= 1.5.2 =
* Fixed gallery style.
= 1.5.1 =
* Added output for user's website among other social links
* Improvement Bit.ly integration
= 1.5.0 =
* Added Artist option to Spotify social link
* Added Bit.ly integration
* Added custom share buttons labels
* Improved Table of Contents
* Fixed Telegram share button
* Fixed RTL justified gallery
* Fixed RTL slider arrow
= 1.4.6 =
* Fixed Instagram Integration
= 1.4.5 =
* Minor fixed
= 1.4.4 =
* Minor improvements
= 1.4.3 =
* Fixed widget title output
* Removed channel for Facebook social fans
= 1.4.2 =
* Changed instructions for Adobe Fonts
* Changed method for fetching Facebook social fan
* Sorted authors, guest authors, contributors alphabetically
* Disabled Inline Posts for AMP
* Fixed enqueue Typekit script if no kits are selected
= 1.4.1 =
* Minor improvements
= 1.4.0 =
* Added Last Row select options to Justified Gallery settings
* Added loader to Justified Gallery
* Added Snapchat to Social Links
* Added Flickr to Social Links
* Added offset parameter to Inline Posts shortcode
* Added an option to Share Buttons "Display labels"
* Added "via" field to Twitter share button
* Added support chars from titles in share links
* Fixed sanitize of Opt-In checkbox label
* Fixed Pin It buttons in post galleries
* Fixed primary button color overrides
= 1.3.1 =
* Social Links Round numbers up to the nearest integer
= 1.3.0 =
* Integration Adobe Fonts
* Remove migration toolkit
* Minor improvements
= 1.2.9 =
* Improved author widget
= 1.2.8 =
* Added new extension for users
* Fixed minor subscribe
= 1.2.7 =
* Added first name field to MailChimp
* Fixed default settings on Instagram
* Fixed WhatsApp share link (empty href)
= 1.2.6 =
* Minor improvements
= 1.2.5 =
* Added new settings to widget author
* Changed style for nav tabs and added support mobile device
* Fixed filter in Inline posts
* Fixed srcset in Twitter widget
= 1.2.4 =
* Added About widget
* Added filters and hooks to powerkit widgets
* Improved migration
* Fixed filter tags for inline posts
= 1.2.3 =
* Fixed total counter in share buttons
= 1.2.2 =
* Added Recover social counts
= 1.2.1 =
* Added support for PHP 5.3
= 1.2.0 =
* Improved performance
* Fixed method of getting a counter for Facebook's likes
= 1.1.9 =
* Fixed MailChimp if key invalid
= 1.1.8 =
* Fixed compatibility lightbox with pin-it
= 1.1.7 =
* Minor improvements
= 1.1.6 =
* Fixed W3C Markup Validation errors
= 1.1.5 =
* Added support Kirki for Typekit Fonts
= 1.1.4 =
* Minor changes
= 1.1.3 =
* Changed the method of obtaining a counter for Facebook's likes
= 1.1.2 =
* Fixed check message Double Opt-In.
= 1.1.1 =
* Fixed style of Social Links.
= 1.1.0 =
* Fixed migrate shortcodes.
= 1.0 =
* Initial release.
@@ -0,0 +1,385 @@
<?php
/**
* Admin Manager
*
* @package Powerkit
* @subpackage Admin
*/
/**
* Admin manager class.
*/
class Admin_Powerkit_Manager {
/**
* The message output.
*
* @var string $msg The message output.
*/
public $msg;
/**
* The slug name to refer to this menu by.
*
* @var string $menu_slug The menu slug.
*/
public $menu_slug = 'manager';
/**
* Constructor.
*/
public function __construct() {
$self = $this;
add_action( 'init', function () use ( $self ) {
$self->handler_actions();
add_action( 'admin_head', array( $self, 'manager_styles' ) );
add_action( 'admin_menu', array( $self, 'add_menu_page' ) );
add_action( 'plugin_action_links_powerkit/powerkit.php', array( $self, 'action_links' ) );
} );
}
/**
* Register a callback for our specific plugin's actions
*
* @param array $actions An array of plugin action links.
*/
public function action_links( $actions ) {
$actions[] = sprintf( '<a href="%s">%s</a>', powerkit_get_page_url( $this->menu_slug ), esc_html__( 'Settings', 'powerkit' ) );
return $actions;
}
/**
* Add menu page
*/
public function add_menu_page() {
$svg = '<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g fill="#81878B"><path d="M6.78872178,17.7263347 L7.27177123,13.7724855 L8.84170382,13.7724855 C11.0605419,13.7724855 12.7351366,13.2073097 13.6980286,12.160688 C14.6399882,11.1349987 14.7865152,9.87905267 14.7865152,8.87429582 C14.7865152,7.9532687 14.6609206,6.69732264 13.6142989,5.67163335 C12.5676771,4.64594406 11.1442716,4.43661972 9.55340659,4.43661972 L4.88547371,4.43661972 L3.45307884,16.0879292 C1.35084819,14.4404374 5.68434189e-14,11.8779725 5.68434189e-14,9 C5.68434189e-14,4.02943725 4.02943725,0 9,0 C13.9705627,0 18,4.02943725 18,9 C18,13.9705627 13.9705627,18 9,18 C8.23700819,18 7.49619203,17.9050548 6.78872178,17.7263347 Z M9.05102816,7.36716054 C9.55340659,7.36716054 10.3069742,7.3462281 10.7674878,7.8276741 C10.9768121,8.03699844 11.165204,8.41378226 11.165204,9.02082286 C11.165204,9.33480937 11.1233392,9.85812024 10.7256229,10.2558365 C10.1813796,10.8000798 9.2603525,10.8419447 8.75797408,10.8419447 L7.64855505,10.8419447 L8.06720374,7.36716054 L9.05102816,7.36716054 Z" id="Powerkit"></path></g></svg>';
$svg = 'data:image/svg+xml;base64,' . base64_encode( $svg );
add_menu_page( esc_html__( 'Powerkit', 'powerkit' ), esc_html__( 'Powerkit', 'powerkit' ), 'manage_options', powerkit_get_page_slug( $this->menu_slug ), array( $this, 'settings_page' ), $svg );
}
/**
* Manager styles
*/
public function manager_styles() {
?>
<style>
.powerkit-manager .wp-list-table th,
.powerkit-manager .wp-list-table td {
padding-top: 16px;
padding-bottom: 16px;
}
.powerkit-manager .dashicons.status {
width: auto;
}
.powerkit-manager .dashicons.status:before{
background-color: transparent;
box-shadow: none;
font-size: initial;
}
.powerkit-manager .spinner {
background-size: 16px 16px;
float: none;
width: 16px;
height: 16px;
margin: 3px 4px;
}
</style>
<?php
}
/**
* Settings
*/
public function settings_page() {
powerkit_uuid_hash();
$modules = powerkit_get_modules();
$page_link = powerkit_get_page_url( $this->menu_slug, 'admin' );
// Check wpnonce.
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'] ) ) { // Input var ok; sanitization ok.
return;
}
// Filter modules.
if ( isset( $_REQUEST['filter'] ) ) { // Input var ok.
$filter = sanitize_key( $_REQUEST['filter'] ); // Input var ok.
}
// Output Message.
if ( $this->msg ) {
echo wp_kses( $this->msg, 'post' );
}
?>
<div class="wrap powerkit-manager">
<h1><?php esc_html_e( 'Powerkit Modules', 'powerkit' ); ?></h1>
<div id="poststuff">
<div id="post-body" class="metabox-holder">
<div id="post-body-content">
<div class="meta-box-sortables ui-sortable">
<form method="post">
<div class="tablenav">
<div class="alignleft">
<?php
$active_link = add_query_arg( array(
'_wpnonce' => wp_create_nonce(),
'filter' => 'active',
), $page_link );
$inactive_link = add_query_arg( array(
'_wpnonce' => wp_create_nonce(),
'filter' => 'inactive',
), $page_link );
$num_modules = 0;
$num_active_modules = 0;
$num_inactive_modules = 0;
if ( $modules ) {
foreach ( $modules as $key => $module ) {
if ( ! $module['public'] ) {
continue;
}
$num_modules++;
if ( powerkit_module_enabled( $module['slug'] ) ) {
$num_active_modules++;
} else {
$num_inactive_modules++;
}
}
}
?>
<ul class="subsubsub">
<li class="all"><a href="<?php echo esc_url( $page_link ); ?>" class="<?php echo esc_attr( ( ! isset( $filter ) ) ? 'current' : '' ); ?>"><?php esc_html_e( 'All', 'powerkit' ); ?> <span class="count">(<?php echo esc_attr( $num_modules ); ?>)</span></a> |</li>
<li class="active"><a href="<?php echo esc_url( $active_link ); ?>" class="<?php echo esc_attr( ( isset( $filter ) && 'active' === $filter ) ? 'current' : '' ); ?>"><?php esc_html_e( 'Active', 'powerkit' ); ?> <span class="count">(<?php echo esc_attr( $num_active_modules ); ?>)</span></a> |</li>
<li class="inactive"><a href="<?php echo esc_url( $inactive_link ); ?>" class="<?php echo esc_attr( ( isset( $filter ) && 'inactive' === $filter ) ? 'current' : '' ); ?>"><?php esc_html_e( 'Inactive', 'powerkit' ); ?> <span class="count">(<?php echo esc_attr( $num_inactive_modules ); ?>)</span></a></li>
</ul>
</div>
<div class="tablenav top">
<div class="alignleft actions bulkactions">
<label for="bulk-action-selector-top" class="screen-reader-text"><?php esc_html_e( 'Select bulk action', 'powerkit' ); ?></label>
<select name="action" id="bulk-action-selector-top">
<option value="-1"><?php esc_html_e( 'Bulk Actions', 'powerkit' ); ?></option>
<option value="activate-selected"><?php esc_html_e( 'Activate', 'powerkit' ); ?></option>
<option value="deactivate-selected"><?php esc_html_e( 'Deactivate', 'powerkit' ); ?></option>
</select>
<input type="submit" id="doaction" class="button action" value="Apply">
</div>
<div class="tablenav-pages one-page">
<span class="displaying-num"><?php echo esc_attr( $num_modules ); ?> <?php esc_html_e( 'items', 'powerkit' ); ?></span>
</div>
</div>
</div>
<table class="wp-list-table widefat plugins">
<thead>
<tr>
<th id="cb" class="manage-column column-cb check-column">
<input id="cb-select-all-1" type="checkbox">
</th>
<th scope="col" class="manage-column column-name column-primary"><?php esc_html_e( 'Module', 'powerkit' ); ?></th>
<th scope="col" class="manage-column column-description"><?php esc_html_e( 'Description', 'powerkit' ); ?></th>
<th scope="col" class="manage-column"></th>
</tr>
</thead>
<tbody id="the-list">
<?php
$counter = 0;
// Loop modules.
if ( $modules ) {
foreach ( $modules as $key => $module ) {
// Public module.
if ( ! $module['public'] ) {
continue;
}
// Check module enabled.
$module_enabled = powerkit_module_enabled( $module['slug'] );
// Filter list.
if ( isset( $filter ) ) {
if ( 'active' === $filter && ! $module_enabled ) {
continue;
}
if ( 'inactive' === $filter && $module_enabled ) {
continue;
}
}
$activate_link = add_query_arg( array(
'_wpnonce' => wp_create_nonce(),
'slug' => $module['slug'],
'action' => 'activate',
), $page_link );
$deactivate_link = add_query_arg( array(
'_wpnonce' => wp_create_nonce(),
'slug' => $module['slug'],
'action' => 'deactivate',
), $page_link );
$counter++;
?>
<tr class="<?php echo esc_attr( $module_enabled ? 'active' : 'inactive' ); ?>">
<th scope="row" class="check-column">
<input type="checkbox" name="checked[]" value="<?php echo esc_attr( $module['slug'] ); ?>">
</th>
<td scope="col" class="plugin-title column-primary">
<strong><?php echo esc_html( $module['name'] ); ?></strong>
<div class="actions">
<?php if ( 'default' === $module['type'] ) { ?>
<?php if ( $module_enabled ) { ?>
<span class="edit">
<a href="<?php echo esc_url( $deactivate_link ); ?>" role="button"><?php esc_html_e( 'Deactivate', 'powerkit' ); ?></a>
</span>
<?php } else { ?>
<span class="edit">
<a href="<?php echo esc_url( $activate_link ); ?>" role="button"><?php esc_html_e( 'Activate', 'powerkit' ); ?></a>
</span>
<?php } ?>
<?php } ?>
</div>
</td>
<td scope="col" class="column-description desc">
<div class="plugin-description">
<p><?php echo esc_html( $module['desc'] ); ?></p>
</div>
<?php
if ( $module_enabled && $module['links'] ) {
$counter = 0;
foreach ( $module['links'] as $link ) {
$counter++;
if ( ! isset( $link['name'] ) ) {
continue;
}
// Target of link.
$target = isset( $link['target'] ) ? $link['target'] : '_self';
// Output separator.
echo 1 < $counter ? '|' : '';
?>
<span class="edit">
<a target="<?php echo esc_attr( $target ); ?>" href="<?php echo esc_url( isset( $link['url'] ) ? $link['url'] : '' ); ?>" role="button">
<?php echo esc_html( $link['name'] ); ?>
</a>
</span>
<?php
}
}
?>
</td>
<td scope="col" class="manage-column">
<?php if ( $module['badge'] ) { ?>
<div class="pk-badge pk-badge-primary"><?php echo esc_attr( $module['badge'] ); ?></div>
<?php } ?>
</td>
</tr>
<?php
}
}
if ( ! $counter ) {
?>
<tr>
<td scope="col" colspan="4"><?php esc_html_e( 'No modules avaliable.', 'powerkit' ); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php wp_nonce_field(); ?>
</form>
<script>
if ( window.history.replaceState ) {
if ( window.location.href.indexOf( 'action=' ) >= 0 ) {
window.history.pushState( null, '', '<?php echo esc_url( $page_link ); ?>' );
}
}
</script>
</div>
</div>
</div>
</div>
</div>
<?php
}
/**
* Handler actions.
*/
public function handler_actions() {
// Check wpnonce.
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'] ) ) { // Input var ok; sanitization ok.
return;
}
if ( ! isset( $_REQUEST['action'] ) ) { // Input var ok; sanitization ok.
return;
}
$action = sanitize_title( $_REQUEST['action'] ); // Input var ok; sanitization ok.
// Bulk Actions.
if ( isset( $_REQUEST['checked'] ) && is_array( $_REQUEST['checked'] ) ) { // Input var ok; sanitization ok.
$checked = array_map( 'sanitize_key', $_REQUEST['checked'] ); // Input var ok; sanitization ok.
foreach ( $checked as $slug ) {
if ( 'activate-selected' === $action ) {
$this->set_module_state( $slug, 1 );
} elseif ( 'deactivate-selected' === $action ) {
$this->set_module_state( $slug, 0 );
}
}
}
if ( ! isset( $_REQUEST['slug'] ) ) { // Input var ok.
return;
}
$slug = sanitize_key( $_REQUEST['slug'] ); // Input var ok.
// Activate module.
if ( 'activate' === $action && $slug ) {
$this->set_module_state( $slug, 1 );
}
// Deactivate module.
if ( 'deactivate' === $action && $slug ) {
$this->set_module_state( $slug, 0 );
}
}
/**
* Set state module.
*
* @param string $slug The slug module.
* @param bool $state The state module.
*/
public function set_module_state( $slug, $state ) {
update_option( sprintf( 'powerkit_enabled_%s', $slug ), $state );
if ( $state ) {
$this->msg = sprintf( '<div id="message" class="updated fade"><p><strong>%s</strong></p></div>', esc_html__( 'Module activated.', 'powerkit' ) );
} else {
$this->msg = sprintf( '<div id="message" class="updated fade"><p><strong>%s</strong></p></div>', esc_html__( 'Module deactivated.', 'powerkit' ) );
}
}
}
new Admin_Powerkit_Manager();
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
@@ -0,0 +1,4 @@
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,105 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="powerkit-icons" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe002;" glyph-name="mail, email" d="M170.667 810.667h682.667q53 0 90.5-37.5t37.5-90.5v-512q0-53-37.5-90.5t-90.5-37.5h-682.667q-53 0-90.5 37.5t-37.5 90.5v512q0 53 37.5 90.5t90.5 37.5zM896 170.667v466l-357.333-286q-11.333-9.333-26.667-9.333t-26.667 9.333l-357.333 286v-466q0-17.667 12.5-30.167t30.167-12.5h682.667q17.667 0 30.167 12.5t12.5 30.167zM853.333 725.334h-682.667q-6.333 0-14-2.333l355.333-284.333 355.333 284.333q-7.667 2.333-14 2.333z" />
<glyph unicode="&#xe018;" glyph-name="video" d="M128 725.334h469.333q53 0 90.5-37.5t37.5-90.5v-77.667l298.667 163v-512l-298.667 163v-77.667q0-53-37.5-90.5t-90.5-37.5h-469.333q-53 0-90.5 37.5t-37.5 90.5v341.333q0 53 37.5 90.5t90.5 37.5zM597.333 640h-469.333q-17.667 0-30.167-12.5t-12.5-30.167v-341.333q0-17.667 12.5-30.167t30.167-12.5h469.333q17.667 0 30.167 12.5t12.5 30.167v341.333q0 17.667-12.5 30.167t-30.167 12.5zM938.667 314.334v224.667l-205.667-112.333z" />
<glyph unicode="&#xe900;" glyph-name="comment" d="M854 256.667v512h-684v-598l86 86h598zM854 852.667c46 0 84-38 84-84v-512c0-46-38-86-84-86h-598l-170-170v768c0 46 38 84 84 84h684z" />
<glyph unicode="&#xe901;" glyph-name="like" d="M516 146.667c204 184 338 306 338 430 0 86-64 148-150 148-66 0-130-42-152-100h-80c-22 58-86 100-152 100-86 0-150-62-150-148 0-124 134-246 338-430l4-4zM704 810.667c132 0 234-102 234-234 0-162-144-292-364-492l-62-56-62 54c-220 200-364 332-364 494 0 132 102 234 234 234 74 0 146-36 192-90 46 54 118 90 192 90z" />
<glyph unicode="&#xe902;" glyph-name="refresh-cw" d="M887.467 337.067c-21.333 8.533-46.933-4.267-55.467-25.6-17.067-46.933-42.667-93.867-81.067-128-59.733-64-149.333-98.133-238.933-98.133 0 0 0 0 0 0-89.6 0-174.933 34.133-243.2 102.4l-119.467 110.933h149.333c25.6 0 42.667 17.067 42.667 42.667s-17.067 42.667-42.667 42.667h-256c0 0 0 0 0 0-4.267 0-8.533 0-8.533-4.267 0 0-4.267 0-4.267 0s-4.267 0-4.267-4.267c-4.267 0-8.533-4.267-8.533-8.533 0 0 0 0 0 0s0-4.267-4.267-4.267c0-4.267-4.267-4.267-4.267-8.533s0-4.267 0-8.533c0 0 0-4.267 0-4.267v-256c0-25.6 17.067-42.667 42.667-42.667s42.667 17.067 42.667 42.667v157.867l123.733-119.467c72.533-81.067 179.2-123.733 294.4-123.733 0 0 0 0 0 0 115.2 0 221.867 42.667 302.933 123.733 42.667 42.667 81.067 98.133 102.4 157.867 4.267 25.6-8.533 51.2-29.867 55.467zM1024 507.734c0 0 0 4.267 0 4.267v256c0 25.6-17.067 42.667-42.667 42.667s-42.667-17.067-42.667-42.667v-157.867l-123.733 119.467c-42.667 42.667-98.133 81.067-157.867 102.4-110.933 34.133-226.133 29.867-328.533-21.333-102.4-46.933-179.2-132.267-217.6-243.2-8.533-21.333 4.267-46.933 25.6-51.2 21.333-8.533 46.933 4.267 55.467 25.6 29.867 85.333 93.867 153.6 174.933 196.267 81.067 38.4 174.933 42.667 260.267 12.8 46.933-17.067 93.867-42.667 128-81.067l119.467-115.2h-149.333c-25.6 0-42.667-17.067-42.667-42.667s17.067-42.667 42.667-42.667h256c4.267 0 12.8 0 17.067 4.267 0 0 0 0 0 0 4.267 4.267 8.533 4.267 12.8 8.533 0 0 0 0 0 0s0 4.267 4.267 4.267c0 4.267 4.267 4.267 4.267 8.533 4.267 4.267 4.267 8.533 4.267 12.8z" />
<glyph unicode="&#xe903;" glyph-name="reply" d="M426 554.667c298-42 428-256 470-470-106 150-256 218-470 218v-174l-298 298 298 298v-170z" />
<glyph unicode="&#xe904;" glyph-name="powerkit" d="M386.203-48.431l27.48 224.93h89.312c126.227 0 221.493 32.152 276.271 91.693 53.587 58.35 61.923 129.8 61.923 186.959 0 52.396-7.145 123.846-66.686 182.196s-140.517 70.259-231.020 70.259h-265.554l-81.487-662.83c-119.594 93.724-196.442 239.5-196.442 403.224 0 282.77 229.23 512 512 512s512-229.23 512-512c0-282.77-229.23-512-512-512-43.406 0-85.55 5.401-125.797 15.569zM514.903 540.89c28.58 0 71.449 1.191 97.647-26.198 11.908-11.908 22.626-33.343 22.626-67.877 0-17.862-2.382-47.633-25.007-70.259-30.961-30.961-83.358-33.343-111.937-33.343h-63.114l23.816 197.677h55.969z" />
<glyph unicode="&#xe905;" glyph-name="twitch" d="M96 960l-96-160v-736h256v-128h128l128 128h160l288 288v608h-864zM832 416l-160-160h-160l-128-128v128h-192v576h640v-416zM608 704h96v-256h-96v256zM416 704h96v-256h-96v256z" />
<glyph unicode="&#xe906;" glyph-name="medium" d="M121.429 688.64c1.28 12.587-3.541 25.003-12.928 33.451l-95.573 115.2v17.195h296.832l229.461-503.253 201.728 503.253h283.051v-17.195l-81.792-78.379c-7.040-5.376-10.539-14.208-9.088-22.955v-576c-1.451-8.704 2.048-17.493 9.088-22.912l79.787-78.379v-17.195h-401.493v17.195l82.645 80.299c8.107 8.107 8.107 10.496 8.107 22.955v465.536l-229.973-584.021h-31.019l-267.733 584.021v-391.424c-2.219-16.469 3.243-33.024 14.805-44.928l107.52-130.56v-17.152h-304.853v17.195l107.52 130.56c11.52 11.861 16.64 28.587 13.909 44.885v452.608z" />
<glyph unicode="&#xe907;" glyph-name="bloglovin" d="M512 0c-9.143 0-18.286 3.429-25.143 10.286l-356.571 344c-4.571 4-130.286 118.857-130.286 256 0 167.429 102.286 267.429 273.143 267.429 100 0 193.714-78.857 238.857-123.429 45.143 44.571 138.857 123.429 238.857 123.429 170.857 0 273.143-100 273.143-267.429 0-137.143-125.714-252-130.857-257.143l-356-342.857c-6.857-6.857-16-10.286-25.143-10.286z" />
<glyph unicode="&#xe908;" glyph-name="up" d="M797.867 328.534l-256 256c-17.067 17.067-42.667 17.067-59.733 0l-256-256c-17.067-17.067-17.067-42.667 0-59.733s42.667-17.067 59.733 0l226.133 226.133 226.133-226.133c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733z" />
<glyph unicode="&#xe909;" glyph-name="telegram" d="M512 960c-282.8 0-512-229.2-512-512s229.2-512 512-512 512 229.2 512 512-229.2 512-512 512zM763.6 609l-84-395.8c-5.8-28.2-22.8-34.8-46.4-21.8l-128 94.6-61.4-59.8c-7.2-7-12.8-12.8-25.6-12.8-16.6 0-13.8 6.2-19.4 22l-43.6 143.2-126.6 39.4c-27.4 8.4-27.6 27.2 6.2 40.6l493.2 190.4c22.4 10.2 44.2-5.4 35.6-40z" />
<glyph unicode="&#xe90a;" glyph-name="fb-messenger" d="M512 960c-282.752 0-512-212.224-512-474.048 0-149.248 74.432-282.24 190.72-369.28v-180.672l174.4 95.68c46.528-12.8 95.808-19.84 146.88-19.84 282.752 0 512 212.288 512 474.112 0 261.76-229.248 474.048-512 474.048zM562.88 321.6l-130.368 139.072-254.4-139.072 279.808 297.088 133.568-139.072 251.264 139.072-279.872-297.088z" />
<glyph unicode="&#xe90b;" glyph-name="reddit" d="M256 320c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64s-64 28.654-64 64zM640 320c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64s-64 28.654-64 64zM643.112 183.222c16.482 12.986 40.376 10.154 53.364-6.332s10.152-40.378-6.334-53.366c-45.896-36.158-115.822-59.524-178.142-59.524-62.322 0-132.248 23.366-178.144 59.522-16.486 12.99-19.32 36.882-6.332 53.368 12.99 16.482 36.882 19.318 53.366 6.332 26.422-20.818 78.722-43.222 131.11-43.222s104.688 22.404 131.112 43.222zM1024 448c0 70.692-57.308 128-128 128-48.116 0-89.992-26.57-111.852-65.82-65.792 35.994-145.952 59.246-233.28 64.608l76.382 171.526 146.194-42.2c13.152-37.342 48.718-64.114 90.556-64.114 53.020 0 96 42.98 96 96s-42.98 96-96 96c-36.56 0-68.342-20.442-84.554-50.514l-162.906 47.024c-18.224 5.258-37.538-3.722-45.252-21.052l-103.77-233.026c-85.138-5.996-163.262-29.022-227.636-64.236-21.864 39.25-63.766 65.804-111.882 65.804-70.692 0-128-57.308-128-128 0-52.312 31.402-97.254 76.372-117.102-8.070-24.028-12.372-49.104-12.372-74.898 0-176.73 200.576-320 448-320 247.422 0 448 143.27 448 320 0 25.792-4.3 50.862-12.368 74.886 44.97 19.85 76.368 64.802 76.368 117.114zM864 772c19.882 0 36-16.118 36-36s-16.118-36-36-36-36 16.118-36 36 16.118 36 36 36zM64 448c0 35.29 28.71 64 64 64 25.508 0 47.572-15.004 57.846-36.646-33.448-25.366-61.166-54.626-81.666-86.738-23.524 9.47-40.18 32.512-40.18 59.384zM512 12c-205.45 0-372 109.242-372 244s166.55 244 372 244c205.45 0 372-109.242 372-244s-166.55-244-372-244zM919.82 388.616c-20.5 32.112-48.218 61.372-81.666 86.738 10.276 21.642 32.338 36.646 57.846 36.646 35.29 0 64-28.71 64-64 0-26.872-16.656-49.914-40.18-59.384z" />
<glyph unicode="&#xe90c;" glyph-name="instagram" d="M512 867.8c136.8 0 153-0.6 206.8-3 50-2.2 77-10.6 95-17.6 23.8-9.2 41-20.4 58.8-38.2 18-18 29-35 38.4-58.8 7-18 15.4-45.2 17.6-95 2.4-54 3-70.2 3-206.8s-0.6-153-3-206.8c-2.2-50-10.6-77-17.6-95-9.2-23.8-20.4-41-38.2-58.8-18-18-35-29-58.8-38.4-18-7-45.2-15.4-95-17.6-54-2.4-70.2-3-206.8-3s-153 0.6-206.8 3c-50 2.2-77 10.6-95 17.6-23.8 9.2-41 20.4-58.8 38.2-18 18-29 35-38.4 58.8-7 18-15.4 45.2-17.6 95-2.4 54-3 70.2-3 206.8s0.6 153 3 206.8c2.2 50 10.6 77 17.6 95 9.2 23.8 20.4 41 38.2 58.8 18 18 35 29 58.8 38.4 18 7 45.2 15.4 95 17.6 53.8 2.4 70 3 206.8 3zM512 960c-139 0-156.4-0.6-211-3-54.4-2.4-91.8-11.2-124.2-23.8-33.8-13.2-62.4-30.6-90.8-59.2-28.6-28.4-46-57-59.2-90.6-12.6-32.6-21.4-69.8-23.8-124.2-2.4-54.8-3-72.2-3-211.2s0.6-156.4 3-211c2.4-54.4 11.2-91.8 23.8-124.2 13.2-33.8 30.6-62.4 59.2-90.8 28.4-28.4 57-46 90.6-59 32.6-12.6 69.8-21.4 124.2-23.8 54.6-2.4 72-3 211-3s156.4 0.6 211 3c54.4 2.4 91.8 11.2 124.2 23.8 33.6 13 62.2 30.6 90.6 59s46 57 59 90.6c12.6 32.6 21.4 69.8 23.8 124.2 2.4 54.6 3 72 3 211s-0.6 156.4-3 211c-2.4 54.4-11.2 91.8-23.8 124.2-12.6 34-30 62.6-58.6 91-28.4 28.4-57 46-90.6 59-32.6 12.6-69.8 21.4-124.2 23.8-54.8 2.6-72.2 3.2-211.2 3.2v0zM512 711c-145.2 0-263-117.8-263-263s117.8-263 263-263 263 117.8 263 263c0 145.2-117.8 263-263 263zM512 277.4c-94.2 0-170.6 76.4-170.6 170.6s76.4 170.6 170.6 170.6c94.2 0 170.6-76.4 170.6-170.6s-76.4-170.6-170.6-170.6zM846.8 721.4c0-33.91-27.49-61.4-61.4-61.4s-61.4 27.49-61.4 61.4c0 33.91 27.49 61.4 61.4 61.4s61.4-27.49 61.4-61.4z" />
<glyph unicode="&#xe90d;" glyph-name="minus" d="M810.667 469.334h-597.333c-25.6 0-42.667-17.067-42.667-42.667s17.067-42.667 42.667-42.667h597.333c25.6 0 42.667 17.067 42.667 42.667s-17.067 42.667-42.667 42.667z" />
<glyph unicode="&#xe90e;" glyph-name="line" d="M826.24 539.52c14.848 0 26.88-12.16 26.88-26.88s-12.032-26.88-26.88-26.88h-74.88v-48h74.88c14.848 0 26.88-12.032 26.88-26.88 0-14.72-12.032-26.88-26.88-26.88h-101.76c-14.72 0-26.752 12.16-26.752 26.88v203.52c0 14.72 12.032 26.88 26.88 26.88h101.76c14.72 0 26.752-12.16 26.752-26.88 0-14.848-12.032-26.88-26.88-26.88h-74.88v-48h74.88zM661.76 410.88c0-11.52-7.424-21.76-18.432-25.472-2.752-0.896-5.632-1.28-8.512-1.28-8.96 0-16.64 3.84-21.76 10.688l-104.256 141.504v-125.44c0-14.72-11.904-26.88-26.88-26.88-14.72 0-26.688 12.16-26.688 26.88v203.52c0 11.52 7.36 21.76 18.304 25.408 2.56 0.96 5.76 1.408 8.32 1.408 8.32 0 16-4.48 21.12-10.88l105.024-142.016v126.080c0 14.72 12.032 26.88 26.88 26.88 14.72 0 26.88-12.16 26.88-26.88v-203.52zM416.768 410.88c0-14.72-12.032-26.88-26.88-26.88-14.72 0-26.752 12.16-26.752 26.88v203.52c0 14.72 12.032 26.88 26.88 26.88 14.72 0 26.752-12.16 26.752-26.88v-203.52zM311.552 384h-101.76c-14.72 0-26.88 12.16-26.88 26.88v203.52c0 14.72 12.16 26.88 26.88 26.88 14.848 0 26.88-12.16 26.88-26.88v-176.64h74.88c14.848 0 26.88-12.032 26.88-26.88 0-14.72-12.032-26.88-26.88-26.88zM1024 520.32c0 229.12-229.76 415.616-512 415.616s-512-186.496-512-415.616c0-205.312 182.144-377.344 428.16-409.92 16.64-3.584 39.36-11.008 45.12-25.216 5.12-12.8 3.392-32.64 1.664-46.080l-7.040-43.52c-1.92-12.8-10.24-50.56 44.8-27.52s295.040 174.080 402.56 297.6c73.536 80.576 108.736 163.136 108.736 254.656z" />
<glyph unicode="&#xe90f;" glyph-name="github" d="M512.008 947.358c-282.738 0-512.008-229.218-512.008-511.998 0-226.214 146.704-418.132 350.136-485.836 25.586-4.738 34.992 11.11 34.992 24.632 0 12.204-0.48 52.542-0.696 95.324-142.448-30.976-172.504 60.41-172.504 60.41-23.282 59.176-56.848 74.916-56.848 74.916-46.452 31.778 3.51 31.124 3.51 31.124 51.4-3.61 78.476-52.766 78.476-52.766 45.672-78.27 119.776-55.64 149.004-42.558 4.588 33.086 17.852 55.68 32.506 68.464-113.73 12.942-233.276 56.85-233.276 253.032 0 55.898 20.004 101.574 52.76 137.428-5.316 12.9-22.854 64.972 4.952 135.5 0 0 43.006 13.752 140.84-52.49 40.836 11.348 84.636 17.036 128.154 17.234 43.502-0.198 87.336-5.886 128.256-17.234 97.734 66.244 140.656 52.49 140.656 52.49 27.872-70.528 10.35-122.6 5.036-135.5 32.82-35.856 52.694-81.532 52.694-137.428 0-196.654-119.778-239.95-233.79-252.624 18.364-15.89 34.724-47.046 34.724-94.812 0-68.508-0.596-123.644-0.596-140.508 0-13.628 9.222-29.594 35.172-24.566 203.322 67.776 349.842 259.626 349.842 485.768 0 282.78-229.234 511.998-511.992 511.998z" />
<glyph unicode="&#xe910;" glyph-name="arrow-left-circle" d="M512 896c-260.267 0-469.333-209.067-469.333-469.333s209.067-469.333 469.333-469.333 469.333 209.067 469.333 469.333-209.067 469.333-469.333 469.333zM512 42.667c-213.333 0-384 170.667-384 384s170.667 384 384 384c213.333 0 384-170.667 384-384s-170.667-384-384-384zM682.667 469.334h-238.933l98.133 98.133c17.067 17.067 17.067 42.667 0 59.733s-42.667 17.067-59.733 0l-170.667-170.667c-4.267-4.267-8.533-8.533-8.533-12.8-4.267-8.533-4.267-21.333 0-34.133 4.267-4.267 4.267-8.533 8.533-12.8l170.667-170.667c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-98.133 98.133h238.933c25.6 0 42.667 17.067 42.667 42.667s-17.067 42.667-42.667 42.667z" />
<glyph unicode="&#xe911;" glyph-name="arrow-right-circle" d="M512 896c-260.267 0-469.333-209.067-469.333-469.333s209.067-469.333 469.333-469.333 469.333 209.067 469.333 469.333-209.067 469.333-469.333 469.333zM512 42.667c-213.333 0-384 170.667-384 384s170.667 384 384 384c213.333 0 384-170.667 384-384s-170.667-384-384-384zM721.067 443.734c-4.267 4.267-4.267 8.533-8.533 12.8l-170.667 170.667c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l98.133-98.133h-238.933c-25.6 0-42.667-17.067-42.667-42.667s17.067-42.667 42.667-42.667h238.933l-98.133-98.133c-17.067-17.067-17.067-42.667 0-59.733 8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8l170.667 170.667c4.267 4.267 8.533 8.533 8.533 12.8 4.267 12.8 4.267 21.333 0 34.133z" />
<glyph unicode="&#xe912;" glyph-name="check" d="M883.2 712.534c-17.067 17.067-42.667 17.067-59.733 0l-439.467-439.467-183.467 183.467c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l213.333-213.333c8.533-8.533 17.067-12.8 29.867-12.8s21.333 4.267 29.867 12.8l469.333 469.333c17.067 17.067 17.067 42.667 0 59.733z" />
<glyph unicode="&#xe913;" glyph-name="x" d="M571.733 426.667l226.133 226.133c17.067 17.067 17.067 42.667 0 59.733s-42.667 17.067-59.733 0l-226.133-226.133-226.133 226.133c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l226.133-226.133-226.133-226.133c-17.067-17.067-17.067-42.667 0-59.733 8.533-8.533 17.067-12.8 29.867-12.8s21.333 4.267 29.867 12.8l226.133 226.133 226.133-226.133c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-226.133 226.133z" />
<glyph unicode="&#xe914;" glyph-name="chevron-right" d="M669.867 456.534l-256 256c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l226.133-226.133-226.133-226.133c-17.067-17.067-17.067-42.667 0-59.733 8.533-8.533 17.067-12.8 29.867-12.8s21.333 4.267 29.867 12.8l256 256c17.067 17.067 17.067 42.667 0 59.733z" />
<glyph unicode="&#xe915;" glyph-name="chevron-left" d="M443.733 426.667l226.133 226.133c17.067 17.067 17.067 42.667 0 59.733s-42.667 17.067-59.733 0l-256-256c-17.067-17.067-17.067-42.667 0-59.733l256-256c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-226.133 226.133z" />
<glyph unicode="&#xe916;" glyph-name="zoom-in" d="M925.867 72.534l-157.867 157.867c51.2 64 85.333 149.333 85.333 238.933 0 213.333-170.667 384-384 384s-384-170.667-384-384c0-213.333 170.667-384 384-384 89.6 0 174.933 29.867 238.933 85.333l157.867-157.867c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733zM170.667 469.334c0 166.4 132.267 298.667 298.667 298.667s298.667-132.267 298.667-298.667c0-81.067-34.133-157.867-85.333-209.067 0 0 0 0 0 0s0 0 0 0c-55.467-55.467-128-85.333-209.067-85.333-170.667-4.267-302.933 128-302.933 294.4zM597.333 512h-85.333v85.333c0 25.6-17.067 42.667-42.667 42.667s-42.667-17.067-42.667-42.667v-85.333h-85.333c-25.6 0-42.667-17.067-42.667-42.667s17.067-42.667 42.667-42.667h85.333v-85.333c0-25.6 17.067-42.667 42.667-42.667s42.667 17.067 42.667 42.667v85.333h85.333c25.6 0 42.667 17.067 42.667 42.667s-17.067 42.667-42.667 42.667z" />
<glyph unicode="&#xe917;" glyph-name="snapchat" horiz-adv-x="951" d="M484.571 877.714c102.857 1.143 188-56.571 230.857-149.143 13.143-28 15.429-71.429 15.429-102.286 0-36.571-2.857-72.571-5.143-109.143 4.571-2.286 10.857-4 16-4 20.571 0 37.714 15.429 58.286 15.429 19.429 0 47.429-13.714 47.429-36.571 0-54.857-114.857-44.571-114.857-92.571 0-8.571 3.429-16.571 6.857-24.571 27.429-60 79.429-117.714 141.143-143.429 14.857-6.286 29.714-9.714 45.714-13.143 10.286-2.286 16-9.714 16-20 0-38.857-98.857-54.857-125.143-58.857-11.429-17.714-2.857-59.429-33.143-59.429-23.429 0-46.857 7.429-72 7.429-12 0-24-0.571-35.429-2.857-68-11.429-90.857-84.571-202.286-84.571-107.429 0-133.143 73.143-199.429 84.571-12 2.286-24 2.857-36 2.857-25.714 0-50.286-8.571-70.857-8.571-32 0-22.286 42.286-34.286 60.571-26.286 4-125.143 20-125.143 58.857 0 10.286 5.714 17.714 16 20 16 3.429 30.857 6.857 45.714 13.143 61.143 25.143 114.286 83.429 141.143 143.429 3.429 8 6.857 16 6.857 24.571 0 48-115.429 38.857-115.429 92 0 22.286 26.286 36.571 46.286 36.571 17.714 0 35.429-14.857 57.714-14.857 6.286 0 12.571 1.143 18.286 4-2.286 36-5.143 72-5.143 108.571 0 30.857 2.286 74.857 15.429 102.857 50.286 108.571 135.429 148 249.143 149.143z" />
<glyph unicode="&#xe918;" glyph-name="flickr" d="M0 416c0 123.712 100.288 224 224 224s224-100.288 224-224c0-123.712-100.288-224-224-224s-224 100.288-224 224zM576 416c0 123.712 100.288 224 224 224s224-100.288 224-224c0-123.712-100.288-224-224-224s-224 100.288-224 224z" />
<glyph unicode="&#xe919;" glyph-name="bell" d="M605.867 81.067c-21.333 12.8-46.933 4.267-59.733-17.067s-38.4-25.6-59.733-17.067c-8.533 4.267-12.8 8.533-17.067 17.067-12.8 21.333-38.4 25.6-59.733 17.067-21.333-12.8-25.6-38.4-17.067-59.733 12.8-21.333 25.6-34.133 46.933-46.933s42.667-17.067 64-17.067c42.667 0 85.333 21.333 110.933 64 21.333 21.333 12.8 46.933-8.533 59.733zM938.667 256c-46.933 0-85.333 38.4-85.333 85.333v213.333c0 187.733-153.6 341.333-341.333 341.333s-341.333-153.6-341.333-341.333v-213.333c0-46.933-38.4-85.333-85.333-85.333-25.6 0-42.667-17.067-42.667-42.667s17.067-42.667 42.667-42.667h853.333c25.6 0 42.667 17.067 42.667 42.667s-17.067 42.667-42.667 42.667zM234.667 256c12.8 25.6 21.333 55.467 21.333 85.333v213.333c0 140.8 115.2 256 256 256s256-115.2 256-256v-213.333c0-29.867 8.533-59.733 21.333-85.333h-554.667z" />
<glyph unicode="&#xe91a;" glyph-name="globe, website" d="M512 896c-260.267 0-469.333-209.067-469.333-469.333s209.067-469.333 469.333-469.333 469.333 209.067 469.333 469.333-209.067 469.333-469.333 469.333zM891.733 469.334h-170.667c-8.533 119.467-46.933 230.4-115.2 328.533 153.6-38.4 268.8-170.667 285.867-328.533zM388.267 384h251.733c-12.8-115.2-55.467-226.133-123.733-315.733-76.8 89.6-119.467 200.533-128 315.733zM388.267 469.334c12.8 115.2 55.467 226.133 123.733 315.733 72.533-93.867 115.2-204.8 123.733-315.733h-247.467zM413.867 797.867c-64-98.133-102.4-209.067-110.933-328.533h-170.667c17.067 157.867 132.267 290.133 281.6 328.533zM132.267 384h170.667c8.533-119.467 46.933-230.4 115.2-328.533-153.6 38.4-268.8 170.667-285.867 328.533zM610.133 55.467c64 98.133 102.4 209.067 115.2 328.533h170.667c-21.333-157.867-136.533-290.133-285.867-328.533z" />
<glyph unicode="&#xe91b;" glyph-name="link" d="M900.267 819.2c-98.133 98.133-256 98.133-354.133 0l-76.8-72.533c-17.067-17.067-17.067-42.667 0-59.733s42.667-17.067 59.733 0l72.533 72.533c68.267 64 170.667 64 238.933 0s68.267-174.933 4.267-238.933l-128-128c-4.267-4.267-12.8-12.8-17.067-17.067-76.8-55.467-183.467-42.667-238.933 34.133-12.8 17.067-42.667 21.333-59.733 8.533s-21.333-42.667-8.533-59.733c51.2-68.267 128-102.4 204.8-102.4 51.2 0 106.667 17.067 153.6 51.2 8.533 8.533 17.067 17.067 29.867 25.6l128 128c98.133 98.133 93.867 264.533-8.533 358.4zM490.667 166.4l-72.533-72.533c-68.267-64-170.667-64-238.933 0s-68.267 174.933-4.267 238.933l128 128c4.267 4.267 12.8 12.8 17.067 17.067 38.4 25.6 81.067 38.4 128 34.133 46.933-8.533 85.333-29.867 110.933-68.267 12.8-17.067 42.667-21.333 59.733-8.533s21.333 42.667 8.533 59.733c-42.667 55.467-102.4 89.6-166.4 98.133-64 12.8-132.267-4.267-187.733-46.933-8.533-8.533-17.067-17.067-25.6-25.6l-128-128c-98.133-102.4-93.867-264.533 4.267-362.667 51.2-46.933 115.2-72.533 179.2-72.533s128 25.6 179.2 72.533l72.533 72.533c17.067 17.067 17.067 42.667 0 59.733s-46.933 21.333-64 4.267z" />
<glyph unicode="&#xe91c;" glyph-name="xing" horiz-adv-x="805" d="M341.143 569.714c0 0-5.714-9.714-146.857-260.571-7.429-12.571-17.143-26.286-37.143-26.286h-136.571c-8 0-14.286 4-17.714 9.714s-4 13.143 0 20.571l144.571 256c0.571 0 0.571 0 0 0.571l-92 159.429c-4 7.429-4.571 15.429-0.571 21.143 3.429 5.714 10.286 8.571 18.286 8.571h136.571c20.571 0 30.857-13.714 37.714-25.714 93.143-162.857 93.714-163.429 93.714-163.429zM801.714 936.571c4-5.714 4-13.714 0-21.143l-301.714-533.714c-0.571 0-0.571-0.571 0-0.571l192-351.429c4-7.429 4-15.429 0.571-21.143-4-5.714-10.286-8.571-18.286-8.571h-136.571c-20.571 0-31.429 13.714-37.714 25.714-193.714 354.857-193.714 355.429-193.714 355.429s9.714 17.143 303.429 538.286c7.429 13.143 16 25.714 36.571 25.714h137.714c8 0 14.286-2.857 17.714-8.571z" />
<glyph unicode="&#xe91d;" glyph-name="ok" horiz-adv-x="731" d="M365.714 432.571c-142.857 0-259.429 116-259.429 258.857 0 143.429 116.571 259.429 259.429 259.429s259.429-116 259.429-259.429c0-142.857-116.571-258.857-259.429-258.857zM365.714 819.428c-70.286 0-127.429-57.143-127.429-128 0-70.286 57.143-127.429 127.429-127.429s127.429 57.143 127.429 127.429c0 70.857-57.143 128-127.429 128zM664.571 401.143c25.143-51.429-3.429-76-68.571-118.286-54.857-34.857-130.286-48.571-180-53.714l41.714-41.143 152.571-152.571c22.857-23.429 22.857-61.143 0-84l-6.857-7.429c-23.429-22.857-61.143-22.857-84.571 0-38.286 38.857-94.286 94.857-152.571 153.143l-152.571-153.143c-23.429-22.857-61.143-22.857-84 0l-6.857 7.429c-23.429 22.857-23.429 60.571 0 84 38.857 38.857 94.286 94.857 152.571 152.571l41.143 41.143c-49.143 5.143-125.714 18.286-181.143 53.714-65.143 42.286-93.714 66.857-68.571 118.286 14.857 29.143 55.429 53.714 109.143 11.429 0 0 72.571-57.714 189.714-57.714s189.714 57.714 189.714 57.714c53.714 42.286 94.286 17.714 109.143-11.429z" />
<glyph unicode="&#xe91e;" glyph-name="wechat" horiz-adv-x="1170" d="M331.429 687.428c0 31.429-20.571 52-52 52-30.857 0-62.286-20.571-62.286-52 0-30.857 31.429-51.429 62.286-51.429 31.429 0 52 20.571 52 51.429zM756 397.714c0 20.571-20.571 41.143-52 41.143-20.571 0-41.143-20.571-41.143-41.143 0-21.143 20.571-41.714 41.143-41.714 31.429 0 52 20.571 52 41.714zM621.143 687.428c0 31.429-20.571 52-51.429 52-31.429 0-62.286-20.571-62.286-52 0-30.857 30.857-51.429 62.286-51.429 30.857 0 51.429 20.571 51.429 51.429zM984 397.714c0 20.571-21.143 41.143-52 41.143-20.571 0-41.143-20.571-41.143-41.143 0-21.143 20.571-41.714 41.143-41.714 30.857 0 52 20.571 52 41.714zM832 624.571c-13.143 1.714-26.286 2.286-40 2.286-196.571 0-352-146.857-352-327.429 0-30.286 4.571-59.429 13.143-86.857-13.143-1.143-25.714-1.714-38.857-1.714-52 0-93.143 10.286-145.143 20.571l-144.571-72.571 41.143 124.571c-103.429 72.571-165.714 166.286-165.714 280 0 197.143 186.286 352 414.286 352 203.429 0 382.286-124 417.714-290.857zM1170.286 304c0-93.143-61.714-176-145.143-238.286l31.429-103.429-113.714 62.286c-41.714-10.286-83.429-21.143-124.571-21.143-197.143 0-352 134.857-352 300.571s154.857 300.571 352 300.571c186.286 0 352-134.857 352-300.571z" />
<glyph unicode="&#xe91f;" glyph-name="weibo" d="M752.026 457.318c-14.029 4.301-23.706 7.27-16.333 26.010 15.923 40.806 17.613 75.981 0.358 101.12-32.41 47.104-121.037 44.595-222.618 1.28 0 0.102-31.898-14.182-23.757 11.622 15.667 51.046 13.261 93.85-11.059 118.528-55.091 56.218-201.574-2.099-327.27-129.997-94.157-95.795-148.787-197.274-148.787-285.082 0-167.987 211.558-280.32 418.56-280.32 271.309 0 451.84 170.701 451.84 298.086 0 77.056-63.693 120.73-120.934 138.752zM421.683 95.795c-165.12-16.384-307.763 58.726-318.464 167.68-10.701 109.005 114.483 210.688 279.654 227.226 165.171 16.384 307.763-58.675 318.464-167.68 10.701-109.107-114.483-210.842-279.654-227.226zM1021.44 594.074c-0.051 169.574-137.523 306.995-307.2 306.995-19.814 0-35.789-15.974-35.789-35.789s15.974-35.789 35.789-35.789c130.099 0 235.571-105.523 235.571-235.622 0-19.814 16.026-35.789 35.84-35.789s35.789 16.026 35.789 35.84v0.154zM879.053 599.296c-16.333 79.974-79.411 143.002-159.386 159.386-19.354 3.994-38.298-8.499-42.291-27.904-3.942-19.302 8.499-38.298 27.904-42.291 52.019-10.598 92.979-51.61 103.629-103.578 3.994-19.405 22.938-31.795 42.291-27.904 19.302 3.994 31.846 22.989 27.853 42.291zM336.998 383.898c-66.56-13.414-111.462-69.222-100.301-124.621 11.162-55.501 74.086-89.6 140.646-76.186 66.509 13.414 111.411 69.222 100.301 124.621-11.162 55.398-74.189 89.6-140.646 76.186z" />
<glyph unicode="&#xe920;" glyph-name="android" d="M640 724.667v44h-42v-44h42zM426 724.667v44h-42v-44h42zM662 846.667c64-46 106-122 106-206h-512c0 84 40 160 104 206l-56 56c-8 8-8 22 0 30s22 8 30 0l64-64c34 18 74 28 114 28s78-10 112-28l64 64c8 8 22 8 30 0s8-22 0-30zM874 596.667c36 0 64-28 64-64v-298c0-36-28-64-64-64s-64 28-64 64v298c0 36 28 64 64 64zM150 596.667c36 0 64-28 64-64v-298c0-36-28-64-64-64s-64 28-64 64v298c0 36 28 64 64 64zM256 170.667v426h512v-426c0-24-18-42-42-42h-44v-150c0-36-28-64-64-64s-64 28-64 64v150h-84v-150c0-36-28-64-64-64s-64 28-64 64v150h-44c-24 0-42 18-42 42z" />
<glyph unicode="&#xe921;" glyph-name="apple" d="M791.498 415.908c-1.294 129.682 105.758 191.876 110.542 194.966-60.152 88.020-153.85 100.078-187.242 101.472-79.742 8.074-155.596-46.948-196.066-46.948-40.368 0-102.818 45.754-168.952 44.552-86.916-1.292-167.058-50.538-211.812-128.38-90.304-156.698-23.126-388.84 64.89-515.926 43.008-62.204 94.292-132.076 161.626-129.58 64.842 2.588 89.362 41.958 167.756 41.958s100.428-41.958 169.050-40.67c69.774 1.296 113.982 63.398 156.692 125.796 49.39 72.168 69.726 142.038 70.924 145.626-1.548 0.706-136.060 52.236-137.408 207.134zM662.562 796.478c35.738 43.358 59.86 103.512 53.28 163.522-51.478-2.096-113.878-34.29-150.81-77.55-33.142-38.376-62.148-99.626-54.374-158.436 57.466-4.484 116.128 29.204 151.904 72.464z" />
<glyph unicode="&#xe922;" glyph-name="yelp" d="M641.946 334.285l231.578-75.059c0 0 33.126-6.093 32.768-28.262-0.205-15.616-10.086-33.382-10.086-33.382l-97.792-141.107c0 0-17.459-14.643-35.123-14.643-17.613 0-37.939 27.494-37.939 27.494l-123.75 208.538c0 0-13.926 30.413 2.56 47.155 15.104 15.36 37.786 9.267 37.786 9.267zM592.384 430.080c11.827-20.275 44.544-14.387 44.544-14.387l231.066 68.147c0 0 31.488 12.954 35.994 30.157 4.403 17.254-5.222 38.042-5.222 38.042l-110.438 131.277c0 0-9.574 16.589-29.44 18.278-21.914 1.894-35.379-24.883-35.379-24.883l-130.56-207.36c0.051 0.051-11.469-20.582-0.563-39.27zM483.226 510.925c27.187 6.758 31.539 46.643 31.539 46.643l-1.843 332.032c0 0-4.096 40.96-22.323 52.070-28.621 17.51-37.069 8.397-45.261 7.168l-191.846-71.936c0 0-18.79-6.298-28.57-22.118-13.978-22.374 14.182-55.245 14.182-55.245l199.373-274.33c0 0 19.712-20.531 44.749-14.285zM435.866 376.576c0.666 25.6-30.464 41.011-30.464 41.011l-206.234 105.114c0 0-30.566 12.698-45.414 3.84-11.315-6.758-21.402-19.046-22.374-29.85l-13.414-166.861c0 0-1.997-28.928 5.427-42.086 10.496-18.637 45.107-5.683 45.107-5.683l240.742 53.709c9.318 6.349 25.702 6.963 26.624 40.806zM495.718 286.515c-20.685 10.701-45.414-11.469-45.414-11.469l-161.178-179.098c0 0-20.122-27.392-15.002-44.186 4.813-15.77 12.8-23.603 24.064-29.133l161.894-51.558c0 0 19.61-4.096 34.509 0.256 21.094 6.195 17.203 39.526 17.203 39.526l3.635 242.483c0-0.051-0.819 23.296-19.712 33.178z" />
<glyph unicode="&#xe923;" glyph-name="stackoverflow" horiz-adv-x="878" d="M736.571 18.286h-638.857v274.286h-91.429v-365.714h821.714v365.714h-91.429v-274.286zM198.286 317.714l18.857 89.714 447.429-94.286-18.857-89.143zM257.143 531.428l38.286 83.429 414.286-193.714-38.286-82.857zM372 734.857l58.286 70.286 350.857-293.143-58.286-70.286zM598.857 950.857l272.571-366.286-73.143-54.857-272.571 366.286zM188.571 110.286v90.857h457.143v-90.857h-457.143z" />
<glyph unicode="&#xe924;" glyph-name="codepen" d="M224.256 448l-96.256-67.371v134.784zM896 380.629l-96.256 67.371 96.256 67.371zM725.333 395.904l137.045-95.957-307.712-199.979v176.512zM373.077 448l138.923 97.237 138.923-97.237-138.923-97.237zM161.621 299.989l137.045 95.915 170.667-119.467v-176.512zM535.765 910.123c-6.784 4.565-14.976 7.211-23.765 7.211s-16.981-2.645-23.765-7.211l-426.155-276.992c-11.776-7.765-19.413-20.864-19.413-35.797v-298.667c0.043-7.893 2.219-15.616 6.315-22.357 1.749-2.901 3.883-5.589 6.357-8.021 2.005-2.005 4.267-3.797 6.741-5.419l0.811-0.512 425.344-276.48c6.784-4.565 14.976-7.211 23.765-7.211s16.981 2.645 23.765 7.211l426.155 276.992c11.776 7.765 19.413 20.864 19.413 35.797v298.667c-0.043 7.893-2.219 15.659-6.315 22.357-1.749 2.859-3.883 5.547-6.357 7.979-2.005 2.005-4.267 3.797-6.741 5.419l-0.811 0.512zM554.667 619.563v176.469l307.712-200.021-137.045-95.915zM469.333 796.032v-176.512l-170.667-119.467-137.045 95.957z" />
<glyph unicode="&#xe925;" glyph-name="slideshare" d="M498.857 528c0-63.429-55.429-115.429-123.429-115.429s-123.429 52-123.429 115.429c0 64 55.429 115.429 123.429 115.429s123.429-51.429 123.429-115.429zM785.714 528c0-63.429-54.857-115.429-123.429-115.429-68 0-123.429 52-123.429 115.429 0 64 55.429 115.429 123.429 115.429 68.571 0 123.429-51.429 123.429-115.429zM914.286 425.143v381.143c0 65.714-21.143 91.429-81.714 91.429h-635.429c-63.429 0-81.143-21.714-81.143-91.429v-384.571c135.429-70.857 251.429-58.286 314.857-56 26.857 0.571 44-4.571 54.286-15.429 1.714-1.714 3.429-3.429 5.714-5.143 12-11.429 23.429-20.571 34.857-29.143 2.286 31.429 20 51.429 67.429 49.714 64.571-2.857 183.429-15.429 321.143 59.429zM1007.429 428c-36.571-45.143-106.286-100.571-212.571-144 112.571-383.429-274.857-444.571-268.571-248 0-3.429-0.571 105.714-0.571 186.857-8.571 1.714-17.143 4-27.429 6.286 0-81.714-0.571-196.571-0.571-193.143 6.286-196.571-381.143-135.429-268.571 248-106.286 43.429-176 98.857-212.571 144-18.286 27.429 1.714 56.571 32 35.429 4-2.857 8.571-5.714 12.571-8.571v396.571c0 54.857 41.143 99.429 92 99.429h718.286c50.857 0 92-44.571 92-99.429v-396.571l12 8.571c30.286 21.143 50.286-8 32-35.429z" />
<glyph unicode="&#xe926;" glyph-name="gitlab" d="M59.429 547.428l452.571-580-496 360c-13.714 10.286-19.429 28-14.286 44l57.714 176zM323.429 547.428h377.143l-188.571-580zM210.286 897.143l113.143-349.714h-264l113.143 349.714c6.286 17.714 31.429 17.714 37.714 0zM964.571 547.428l57.714-176c5.143-16-0.571-33.714-14.286-44l-496-360 452.571 580zM964.571 547.428h-264l113.143 349.714c6.286 17.714 31.429 17.714 37.714 0z" />
<glyph unicode="&#xe927;" glyph-name="freecodecamp" horiz-adv-x="1317" d="M258.857 15.428c0-16-14.286-30.857-30.286-30.857-2.286 0-5.143 1.143-7.429 1.714v0c-32 7.429-73.143 55.429-92.571 80-89.143 112.571-128.571 244-128.571 386.286 0 132.571 40 246.286 121.714 350.857 18.857 24.571 74.857 89.143 108 89.143 14.286 0 29.143-11.429 29.143-26.286 0-17.143-25.143-40.571-36-51.429-31.429-32.571-60.571-65.714-84-105.143-48.571-81.143-68-162.286-68-256.571 0-101.143 18.857-192.571 70.286-280.571 21.714-37.143 47.429-68 77.714-98.857 12-13.143 40-38.857 40-58.286zM1026.286 92c0-21.143-14.286-38.857-36.571-38.857h-617.714c-20 0-36.571 16.571-36.571 36.571 0 21.143 14.286 38.857 36.571 38.857h617.714c20 0 36.571-16.571 36.571-36.571zM903.429 441.143c0-48-10.857-92.571-38.286-133.143-18.857-28-57.143-64-87.429-79.429-4.571-2.857-10.286-5.714-15.429-5.714-4.571 0-13.143 5.143-13.143 10.286 0 16.571 69.714 56 69.714 132.571 0 25.143-6.286 53.143-20 74.286-4 5.714-18.286 24-26.286 24-1.714 0-1.714-1.143-1.714-2.857 0-13.714 8.571-26.857 8.571-41.143 0-18.286-22.286-27.429-37.714-27.429-26.857 0-37.714 18.857-37.714 43.429 0 16.571 1.714 33.714 1.714 50.286 0 12-0.571 15.429-5.714 26.286-8 15.429-34.286 46.857-53.143 46.857-5.143 0-6.857 0-6.857-5.143 0-8 18.286-16.571 18.286-45.714 0-76-104.571-89.714-104.571-165.714 0-34.286 4.571-62.857 24-91.429 12-17.714 25.143-28 45.143-36 5.143-1.714 10.286-2.286 10.286-8.571s-5.143-9.143-10.286-9.143c-2.857 0-16 5.143-18.857 6.286v0c-88 32-154.857 108.571-154.857 204.571 0 113.714 136.571 213.143 136.571 322.286 0 21.143-3.429 36-14.286 53.714-6.286 10.286-21.714 30.286-32 36.571-4.571 2.286-10.857 6.286-10.857 12 0 9.714 16.571 11.429 23.429 11.429 20.571 0 44-7.429 62.857-16.571 79.429-37.714 96-95.429 109.714-175.429 3.429-18.857 10.286-78.857 37.714-78.857 17.714 0 29.143 12 29.143 29.143 0 25.714-22.857 53.714-22.857 68 0 4 2.286 5.714 5.714 5.714 14.286 0 44-30.286 53.143-40 55.429-58.857 76-116 76-195.429zM1316.571 424.571c0-100.571-26.857-201.143-78.857-287.429-24-40-102.857-152-154.857-152-12 0-26.286 14.857-26.286 26.857 0 19.429 66.857 81.714 83.429 102.857 70.857 89.143 104.571 189.714 104.571 303.429 0 93.714-11.429 169.714-53.143 254.857-25.714 52.571-52.571 88-93.143 130.286-13.143 13.714-41.714 39.429-41.714 60 0 14.286 14.857 29.714 29.143 29.714 37.714 0 92-69.714 112-96.571 76.571-102.857 109.143-208.571 117.714-335.429 0.571-12 1.143-24.571 1.143-36.571z" />
<glyph unicode="&#xe928;" glyph-name="jsfiddle" horiz-adv-x="1170" d="M1028.571 509.714c82.857-34.286 141.714-115.429 141.714-209.714 0-125.143-103.429-226.857-230.286-226.857-4.571 0-8.571 0.571-12.571 0.571h-695.429c-128 7.429-232 105.143-232 232 0 85.143 46.286 159.429 115.429 200-4.571 14.857-6.857 30.286-6.857 46.857 0 87.429 71.429 158.286 160.571 158.286 36.571 0 70.857-12.571 98.286-33.143 56 115.429 174.857 195.429 313.714 195.429 192.571 0 348-153.714 348-342.857 0-6.857-0.571-13.714-0.571-20.571zM267.429 357.714c0-96.571 76-150.857 166.857-150.857 56 0 96.571 17.714 137.143 56.571-16.571 20.571-34.857 40.571-52 61.143-23.429-22.857-49.143-37.143-82.286-37.143-40.571 0-75.429 26.857-75.429 69.143 0 41.714 34.857 69.143 74.286 69.143 125.714 0 152.571-219.429 335.429-219.429 89.143 0 164.571 56 164.571 149.714 0 94.857-76 150.286-166.286 150.286-56 0-97.714-16-137.714-55.429 18.286-20 35.429-41.143 53.143-61.714 22.857 22.286 48.571 36.571 81.143 36.571 37.714 0 75.429-26.857 75.429-66.857 0-44-32-72-74.857-72-121.714 0-154.286 219.429-332.571 219.429-88.571 0-166.857-54.286-166.857-148.571z" />
<glyph unicode="&#xe929;" glyph-name="bitbucket" horiz-adv-x="809" d="M465.714 460c6.286-48-52-85.714-92.571-61.143-45.714 20-45.714 92.571-1.143 113.143 38.286 23.429 93.714-7.429 93.714-52zM529.143 472c-10.286 81.143-102.286 134.857-177.143 101.143-47.429-21.143-79.429-71.429-77.143-124.571 2.857-69.714 69.143-126.857 138.857-120.571s124 74.286 115.429 144zM665.714 781.714c-25.143 33.143-68 38.857-105.714 45.143-106.857 17.143-216.571 17.714-323.429-1.143-35.429-5.714-75.429-12-97.714-44 36.571-34.286 88.571-39.429 135.429-45.143 84.571-10.857 171.429-11.429 256-0.571 47.429 5.714 100 10.286 135.429 45.714zM698.286 190.286c-16-56-6.857-131.429-66.286-164-102.286-56.571-226.286-62.857-338.857-42.857-59.429 10.857-129.143 29.714-161.714 85.714-14.286 54.857-23.429 110.857-32.571 166.857l3.429 9.143 10.286 5.143c170.286-112.571 408.571-112.571 579.429 0 26.857-8 6.857-40.571 6.286-60zM801.714 739.428c-19.429-125.143-41.714-249.714-63.429-374.286-6.286-36.571-41.714-57.143-71.429-72.571-106.857-53.714-231.429-62.857-348.571-50.286-79.429 8.571-160.571 29.714-225.143 79.429-30.286 23.429-30.286 63.429-36 97.143-20 117.143-42.857 234.286-57.143 352.571 6.857 51.429 64.571 73.714 107.429 89.714 57.143 21.143 118.286 30.857 178.857 36.571 129.143 12.571 261.143 8 386.286-28.571 44.571-13.143 92.571-31.429 122.857-69.714 13.714-17.714 9.143-40 6.286-60z" />
<glyph unicode="&#xe92a;" glyph-name="foursquare" d="M251.904 921.6c-26.010 0-47.104-21.094-47.104-47.104v-845.619c0-32 39.168-47.411 61.030-24.064l228.915 245.248c3.482 3.789 8.346 5.939 13.517 5.939h165.734c24.883 0 46.336 17.562 51.251 41.984l108.083 538.317c8.858 44.134-24.883 85.299-69.888 85.299h-511.539zM452.506 348.672l-145.306-170.854v623.821c0 9.677 7.885 17.562 17.562 17.562h365.568c17.51 0 30.618-16.026 27.136-33.178l-21.146-105.216c-1.741-8.858-9.523-15.206-18.534-15.206h-189.952c-14.95 0-27.034-12.083-27.034-27.034v-62.464c0-7.117 5.786-12.902 12.954-12.902h168.653c15.667 0 27.443-14.336 24.371-29.747l-31.437-156.57c-2.202-10.752-11.674-18.483-22.63-18.483h-139.11c-8.141 0-15.821-3.533-21.094-9.728z" />
<glyph unicode="&#xe92b;" glyph-name="500px" horiz-adv-x="815" d="M800.571 66.857l-3.429-3.429c-42.857-42.857-92.571-76.571-148-100-57.714-24-118.286-36.571-181.143-36.571s-124 12.571-181.143 36.571c-55.429 23.429-105.714 57.143-148 100-42.857 42.286-76.571 92-100 147.429-14.286 34.857-25.714 70.857-30.857 108v0c-2.286 16 20 19.429 27.429 20.571 17.714 2.857 29.714 1.714 32-11.429 0.571-0.571 0.571-1.143 0.571-2.286 2.286-11.429 8-45.714 26.286-90.857 18.857-46.857 48-90.286 86.857-129.143 37.143-37.143 80.571-66.286 129.143-86.857 49.714-21.143 102.857-32 157.714-32 54.286 0 107.429 10.857 157.714 32 48 20.571 91.429 49.714 128.571 86.857l3.429 3.429c4 4 8.571 5.143 14.286 3.429 5.143-1.143 11.429-5.714 18.857-12.571v0c18.286-18.857 14.286-28 9.714-33.143zM530.857 418.286l-37.714-37.714 36-36c4-4 11.429-12.571-4-28-6.286-6.286-12.571-9.714-18.286-9.714-4 0-7.429 1.714-10.857 5.714l-35.429 34.857-37.714-37.714c-1.143-1.143-4-2.857-8.571-2.857-5.143 0-11.429 2.857-17.714 9.143l-1.143 1.143c-4 3.429-10.286 9.714-10.286 16.571 0 3.429 1.714 6.286 4.571 9.714l37.714 37.143-37.714 37.714c-6.286 6.286-3.429 14.286 8 25.714 6.857 6.857 12.571 10.286 17.714 10.286 2.857 0 5.143-1.143 7.429-2.857l37.143-37.714 37.143 37.143c6.286 6.286 16.571 3.429 27.429-7.429 6.857-6.857 14.286-16.571 6.286-25.143zM800 385.714c0-45.143-9.143-89.143-26.286-130.286-17.143-40-41.143-75.429-72-106.286s-66.857-54.857-106.857-72c-41.143-17.714-85.143-26.286-130.286-26.286s-89.143 8.571-130.286 26.286c-40 17.143-76 41.143-106.857 72s-54.857 66.286-71.429 106.286c-3.429 7.429-8.571 21.714-8.571 22.857h-0.571c-5.143 16 17.714 22.857 24.571 25.143 16.571 5.143 29.143 7.429 34.286-6.857 13.714-36.571 34.857-72 55.429-95.429h0.571v194.857c1.143 48 21.143 96.571 58.286 132.571 38.286 37.714 89.714 58.857 144.571 58.857 112 0 202.857-90.286 202.857-201.143 0-112-91.429-202.857-202.857-202.857-22.286 0-38.857 1.714-64 9.143-2.857 1.143-16 6.857-7.429 34.857 2.286 7.429 9.143 29.143 25.143 24.571 1.143 0 29.143-6.857 44-6.857 79.429 0 141.714 61.714 141.714 140.571 0 37.143-14.857 72-41.143 97.714-26.286 26.286-61.714 40.571-100 40.571-39.429 0-75.429-16-101.714-45.714-22.857-25.714-36.571-60-36.571-91.429v-236c41.143-25.143 88.571-38.286 138.286-38.286 73.143 0 144 29.143 194.857 80 51.429 51.429 80 120.571 80 193.143 0 73.143-28.571 141.714-80.571 193.714-51.429 51.429-120 80-193.714 80s-142.857-28.571-194.286-80c-0.571-0.571-33.143-34.286-44-49.714l-1.143-1.143c-6.857-9.714-13.143-18.857-41.714-12.571-14.286 3.429-29.714 12-29.714 24.571v388.571c0 10.286 8 21.714 21.714 21.714h501.143c17.143 0 17.143-24 17.143-31.429 0-8 0-31.429-17.143-31.429h-463.429v-276h0.571c32 33.714 87.429 69.143 120 82.857 40.571 17.143 86.286 26.286 132 26.286 45.143 0 89.143-8.571 130.286-26.286 40-17.143 76-41.143 106.857-72s54.857-66.286 72-106.286c17.143-41.714 26.286-85.143 26.286-130.857zM782.286 717.714c10.857-9.714 3.429-20-7.429-32.571-6.857-6.857-14.286-14.857-22.286-14.857-3.429 0-6.286 1.143-9.143 4-41.143 35.429-78.286 59.429-118.286 76-49.714 21.714-102.857 32-157.714 32-48.571 0-101.714-9.714-149.714-28-14.857-5.714-22.857 13.714-25.714 21.143-3.429 9.143-5.143 16.571-4.571 21.714 1.143 5.714 4 9.714 9.143 11.429 46.857 20.571 110.857 32.571 170.857 32.571 62.286 0 123.429-12.571 180.571-36.571 52.571-22.286 95.429-49.714 134.286-86.857z" />
<glyph unicode="&#xe92c;" glyph-name="delicious" horiz-adv-x="878" d="M841.143 164.571v274.286h-402.286v402.286h-274.286c-70.857 0-128-57.143-128-128v-274.286h402.286v-402.286h274.286c70.857 0 128 57.143 128 128zM877.714 713.143v-548.571c0-90.857-73.714-164.571-164.571-164.571h-548.571c-90.857 0-164.571 73.714-164.571 164.571v548.571c0 90.857 73.714 164.571 164.571 164.571h548.571c90.857 0 164.571-73.714 164.571-164.571z" />
<glyph unicode="&#xe92d;" glyph-name="deviantart" horiz-adv-x="585" d="M585.143 777.714l-173.143-332.571 13.714-17.714h159.429v-237.143h-289.714l-25.143-17.143-81.143-156c-0.571 0-16-16-17.143-17.143h-172v173.143l173.143 333.143-13.714 17.143h-159.429v237.143h289.714l25.143 17.143 81.143 156c0.571 0 16 16 17.143 17.143h172v-173.143z" />
<glyph unicode="&#xe92e;" glyph-name="houzz" horiz-adv-x="585" d="M292.571 270.286l292.571 168.571v-337.714l-292.571-169.143v338.286zM0 438.857v-337.714l292.571 169.143-292.571 168.571zM292.571 945.714v-337.714l-292.571-169.143v337.714zM292.571 608l292.571 168.571v-337.714z" />
<glyph unicode="&#xe92f;" glyph-name="meetup" horiz-adv-x="1093" d="M762.286 245.714c-6.286 41.143-81.714 9.143-86.286 54.286-6.286 64 87.429 202.286 80 256-6.857 48-38.857 58.286-66.857 58.857-26.857 0.571-33.714-4-42.857-9.143-5.714-3.429-13.143-9.714-23.429 0.571-12.571 12-22.286 23.429-38.857 25.714-24.571 4-35.429-4-53.143-19.429-6.857-5.714-24-25.714-40-18.286-6.857 3.429-30.857 15.429-48 22.857-32.571 14.286-80-9.143-97.143-40-25.714-45.714-76-226.286-83.429-250.286-17.143-53.143 21.714-97.143 73.714-94.286 22.286 1.143 36.571 9.143 50.857 34.857 8 14.857 83.429 215.429 89.143 225.143 4 6.857 17.714 16 29.143 10.286 11.429-6.286 13.714-18.857 12-30.286-2.286-19.429-56-141.714-57.714-155.429-6.857-45.714 53.714-53.143 77.143-8 7.429 14.286 91.429 185.143 98.857 196.571 8.571 12.571 14.857 16.571 23.429 16 6.286 0 16.571-1.714 14.286-21.714-2.857-18.857-70.286-144.571-77.714-175.429-9.143-41.143 13.143-82.857 49.714-101.143 22.857-11.429 125.143-31.429 117.143 22.286zM218.857 122.286c2.286-11.429-4.571-22.286-16-24.571-10.857-2.286-21.714 4.571-24 16-2.286 10.857 4.571 22.286 15.429 24.571s22.286-4.571 24.571-16zM544.571-28c9.143-13.143 5.714-30.857-6.857-40-13.143-9.143-30.857-5.714-40 7.429-8.571 13.143-5.143 30.857 7.429 40 13.143 9.143 30.857 5.714 39.429-7.429zM101.143 436c-13.714-20.571-41.143-25.714-61.143-11.429-20 13.714-25.143 41.714-11.429 61.714 13.714 20.571 41.143 25.714 61.143 12 20-14.286 25.143-41.714 11.429-62.286zM838.286 49.143c14.286-21.143 9.143-50.286-12-65.143-21.143-14.286-49.714-9.143-64 12s-9.143 50.286 11.429 65.143c21.143 14.857 49.714 9.143 64.571-12zM902.286 394.286c52.571-86.286 30.286-200-52.571-258.286-34.857-24.571-74.286-35.429-113.714-34.286-24-94.286-138.857-129.143-210.286-65.143-2.286-1.714-5.143-3.429-7.429-5.714-78.286-54.286-184.571-34.857-238.857 44.571-19.429 28.571-29.143 61.143-30.286 93.714-130.857 21.714-180 188-82.286 279.429-56.571 93.714 1.143 214.857 106.857 229.714 50.286 132.571 215.429 195.429 327.429 108.571 134.857 44.571 272.571-58.857 261.714-202.286 82.286-25.143 105.714-133.714 39.429-190.286zM260 771.428c10.286-15.429 6.857-36.571-8.571-47.429-14.857-10.286-36-6.857-46.286 8.571s-6.857 36.571 8.571 47.429c14.857 10.286 36 6.857 46.286-8.571zM350.857 932c2.857-12.571-5.143-25.143-17.714-28s-25.143 5.143-28 18.286c-2.286 12.571 5.714 25.143 18.286 28s25.143-5.143 27.429-18.286zM1028.571 390.286c3.429-15.429-6.286-30.286-21.143-33.143-14.857-3.429-29.714 6.286-32.571 21.143-3.429 15.429 6.286 30.286 21.143 33.714 14.857 2.857 29.714-6.857 32.571-21.714zM649.143 900.571c12-20.571 5.714-48-15.429-60.571-20.571-12.571-47.429-5.714-59.429 14.857-12.571 21.143-5.714 48.571 14.857 61.143s47.429 5.714 60-15.429zM1075.429 525.714c2.857-11.429-4.571-22.286-15.429-25.143-11.429-2.286-22.286 5.143-24.571 16-2.286 11.429 4.571 22.857 16 25.143 10.857 2.286 21.714-4.571 24-16zM966.286 663.428c11.429-17.143 7.429-40.571-9.143-52.571-17.143-11.429-40.571-7.429-52 9.714s-7.429 40.571 9.714 52.571c16.571 12 40 7.429 51.429-9.714z" />
<glyph unicode="&#xe930;" glyph-name="producthunt" d="M657.143 515.428c0-42.286-34.286-76.571-77.143-76.571v0h-144.571v153.714h144.571c42.857 0 77.143-34.286 77.143-77.143zM759.429 515.428c0 99.429-80 179.429-179.429 179.429v0h-247.429v-512h102.857v153.714h144.571c99.429 0 179.429 80 179.429 178.857zM1024 438.857c0-282.857-229.143-512-512-512s-512 229.143-512 512 229.143 512 512 512 512-229.143 512-512z" />
<glyph unicode="&#xe931;" glyph-name="tripadvisor" horiz-adv-x="1317" d="M372 381.143c0-29.714-24-53.714-53.143-53.714-29.714 0-53.714 24-53.714 53.714 0 29.143 24 53.143 53.714 53.143 29.143 0 53.143-24 53.143-53.143zM1031.429 381.714c0-29.714-24-53.714-53.714-53.714s-53.714 24-53.714 53.714 24 53.143 53.714 53.143 53.714-23.429 53.714-53.143zM437.143 381.143c0 60.571-49.714 110.286-110.286 110.286-61.143 0-110.286-49.714-110.286-110.286 0-61.143 49.143-110.286 110.286-110.286 60.571 0 110.286 49.143 110.286 110.286zM1096 381.714c0 60.571-49.143 110.286-110.286 110.286-60.571 0-110.286-49.714-110.286-110.286 0-61.143 49.714-110.286 110.286-110.286 61.143 0 110.286 49.143 110.286 110.286zM485.714 381.143c0-88-70.857-159.429-158.857-159.429s-159.429 71.429-159.429 159.429c0 87.429 71.429 158.857 159.429 158.857s158.857-71.429 158.857-158.857zM1145.143 381.714c0-88-71.429-158.857-159.429-158.857-87.429 0-158.857 70.857-158.857 158.857s71.429 158.857 158.857 158.857c88 0 159.429-70.857 159.429-158.857zM594.286 380c0 145.714-118.286 264-264 264-145.143 0-263.429-118.286-263.429-264s118.286-264 263.429-264c145.714 0 264 118.286 264 264zM976 707.428c-94.286 41.143-200.571 63.429-317.714 63.429s-233.714-22.286-327.429-62.857c181.143-0.571 327.429-146.857 327.429-328 0 177.714 141.143 322.286 317.714 327.429zM1249.714 380c0 145.714-117.714 264-263.429 264s-264-118.286-264-264 118.286-264 264-264 263.429 118.286 263.429 264zM1097.714 703.428h218.857c-34.286-40-59.429-93.714-65.714-130.857 39.429-54.286 62.857-120.571 62.857-192.571 0-181.143-146.857-327.429-327.429-327.429-102.857 0-194.286 46.857-254.286 120.571 0 0-26.857-32-73.714-102.286-8 16.571-48.571 74.286-73.143 102.857-60-74.286-152-121.143-254.857-121.143-180.571 0-327.429 146.286-327.429 327.429 0 72 23.429 138.286 62.857 192.571-6.286 37.143-31.429 90.857-65.714 130.857h208.571c112 74.857 274.857 121.714 449.714 121.714s327.429-46.857 439.429-121.714z" />
<glyph unicode="&#xe932;" glyph-name="steam" d="M904 618.286c0-77.143-62.857-139.429-139.429-139.429-77.143 0-139.429 62.286-139.429 139.429s62.286 139.429 139.429 139.429c76.571 0 139.429-62.286 139.429-139.429zM464 194.286c0 79.429-63.429 142.857-142.857 142.857-10.286 0-20.571-1.143-30.857-3.429l59.429-24c58.286-23.429 86.857-89.143 63.429-147.429s-89.714-86.857-148-62.857c-23.429 9.143-46.857 18.857-70.286 28 24-45.143 71.429-76 126.286-76 79.429 0 142.857 63.429 142.857 142.857zM938.286 617.714c0 96-78.286 174.286-174.286 174.286-96.571 0-174.857-78.286-174.857-174.286 0-96.571 78.286-174.286 174.857-174.286 96 0 174.286 77.714 174.286 174.286zM1024 617.714c0-144-116.571-260-260-260l-249.714-182.286c-9.143-98.286-92.571-175.429-193.143-175.429-92.571 0-170.857 65.714-189.714 153.143l-131.429 52.571v245.143l222.286-89.714c29.143 17.714 62.857 27.429 98.857 27.429 6.857 0 13.714-0.571 20-1.143l162.286 232.571c1.143 142.286 117.714 257.714 260.571 257.714 143.429 0 260-116.571 260-260z" />
<glyph unicode="&#xe933;" glyph-name="thumbtack" horiz-adv-x="658" d="M274.286 457.143v256c0 10.286-8 18.286-18.286 18.286s-18.286-8-18.286-18.286v-256c0-10.286 8-18.286 18.286-18.286s18.286 8 18.286 18.286zM658.286 256c0-20-16.571-36.571-36.571-36.571h-245.143l-29.143-276c-1.143-9.143-8.571-16.571-17.714-16.571h-0.571c-9.143 0-16.571 6.286-18.286 15.429l-43.429 277.143h-230.857c-20 0-36.571 16.571-36.571 36.571 0 93.714 70.857 182.857 146.286 182.857v292.571c-40 0-73.143 33.143-73.143 73.143s33.143 73.143 73.143 73.143h365.714c40 0 73.143-33.143 73.143-73.143s-33.143-73.143-73.143-73.143v-292.571c75.429 0 146.286-89.143 146.286-182.857z" />
<glyph unicode="&#xe934;" glyph-name="goodreads" d="M833.067 278.315v660.779h-87.851v-123.989h-2.731c-9.003 19.413-20.523 38.016-35.925 55.765-15.36 17.579-32.725 33.152-52.565 46.677-19.883 13.397-41.045 23.936-64.811 31.403-23.595 7.211-48.64 11.051-75.563 11.051-51.627 0-98.133-9.6-138.496-28.587-40.405-19.072-74.368-45.099-101.76-78.080s-48.341-71.509-62.72-115.669c-14.336-44.245-21.589-90.837-21.589-140.075 0-51.157 6.016-99.243 18.133-144.299 12.203-45.099 31.445-84.309 58.368-117.845 26.923-33.28 60.245-59.605 101.333-78.208 41.003-18.603 90.411-28.203 148.096-28.203 53.248 0 99.413 13.44 139.179 40.363s69.888 62.848 90.411 107.733h2.603v-97.451c0-87.211-17.963-153.899-53.931-200.747-35.84-46.123-94.891-69.888-176.896-69.888-24.405 0-48.128 2.603-71.211 7.723-23.125 5.12-44.203 13.44-63.445 24.32-18.645 11.563-35.285 25.643-48.768 44.288-13.483 18.56-22.443 41.003-26.965 67.968h-89.899c2.859-37.845 13.44-70.571 31.445-98.133 18.091-27.563 41.003-50.005 68.352-67.968 27.349-17.323 58.325-30.123 92.672-38.485 34.603-8.277 69.931-12.8 106.411-12.8 59.008 0 108.416 8.32 148.736 23.68 40.405 16.043 73.131 38.485 98.176 68.608 25.643 30.208 43.563 66.091 55.168 109.056 11.52 42.965 17.92 91.051 17.92 143.659l-1.877-2.645zM513.749 302.080c-40.747 0-76.117 8.064-105.771 24.363-29.739 16.213-54.485 37.632-73.899 64.128-19.925 26.496-34.005 56.832-43.605 91.264s-14.165 69.675-14.165 105.984c0 37.163 4.48 73.6 12.843 109.355 8.96 35.84 23.040 67.712 42.325 95.573 19.243 27.819 44.245 50.432 73.728 67.584s65.408 25.813 107.093 25.813 76.928-8.917 106.453-26.496c28.843-17.707 53.205-40.917 71.808-69.717 18.603-28.885 32.043-60.971 40.405-96.213 8.32-35.243 12.16-70.656 12.16-105.899 0-36.352-5.12-71.595-14.72-105.984-9.643-34.432-24.405-64.768-44.288-91.264-19.84-26.496-43.563-47.915-72.448-64.128-28.843-16.299-62.208-24.363-100.651-24.363h2.731z" />
<glyph unicode="&#xe935;" glyph-name="mastodon" d="M989.568 623.829c0 222.123-145.536 287.232-145.536 287.232-73.387 33.707-199.424 47.872-330.283 48.939h-3.243c-130.901-1.067-256.853-15.232-330.24-48.939 0 0-145.536-65.109-145.536-287.232 0-50.859-0.981-111.701 0.64-176.171 5.291-217.259 39.851-431.317 240.683-484.48 92.587-24.491 172.117-29.653 236.16-26.112 116.139 6.4 181.333 41.472 181.333 41.472l-3.84 84.267s-82.987-26.155-176.171-22.997c-92.373 3.157-189.824 9.941-204.757 123.349-1.305 9.295-2.050 20.032-2.050 30.944 0 0.296 0.001 0.592 0.002 0.889v-0.046s90.667-22.187 205.525-27.435c70.229-3.2 136.107 4.139 203.008 12.075 128.299 15.317 240 94.379 254.037 166.613 22.059 113.707 20.267 277.632 20.267 277.632zM817.877 337.579h-106.539v261.077c0 55.040-23.168 82.944-69.461 82.944-51.2 0-76.885-33.109-76.885-98.645v-142.891h-105.941v142.933c0 65.536-25.685 98.645-76.885 98.645-46.293 0-69.461-27.947-69.461-82.944v-261.077h-106.539v268.928c0 54.997 13.995 98.688 42.112 130.987 29.013 32.341 66.944 48.896 114.091 48.896 54.528 0 95.829-20.949 123.136-62.891l26.496-44.501 26.539 44.501c27.307 41.941 68.608 62.891 123.136 62.891 47.104 0 85.077-16.555 114.091-48.896 28.075-32.299 42.069-75.989 42.069-130.987v-268.971z" />
<glyph unicode="&#xe936;" glyph-name="pixelfed" horiz-adv-x="1023" d="M922.857 950.857c52 0 100-38.857 100-93.143 0-30.286-12-59.429-25.714-86.286-44.571-84.571-194.286-364-265.714-429.714-34.857-32.571-76-52-124.571-52-96.571 0-175.429 82.286-175.429 178.286 0 45.714 18.857 90.286 52.571 121.143l364.571 330.857c20 18.286 46.286 30.857 74.286 30.857zM403.429 360c29.714-57.714 84-101.143 146.857-117.714l0.571-40.571c3.429-162.857-109.714-274.857-273.143-274.857-193.714 0-277.714 154.286-277.714 329.714 21.143-14.286 94.857-73.143 118.857-73.143 14.286 0 26.286 8 31.429 21.143 48.571 126.857 124.571 149.714 253.143 155.429z" />
<glyph unicode="&#xe937;" glyph-name="microblog" d="M913.067 204.8c-85.333-110.933-42.667-204.8-12.8-251.733 12.8-17.067-4.267-17.067-12.8-17.067-72.253 13.472-132.694 55.732-170.052 114.172l-0.615 1.028c-8.533 4.267-12.8 8.533-21.333 4.267-59.733-17.067-119.467-29.867-183.467-25.6-281.6 0-512 204.8-512 460.8s230.4 469.333 512 469.333 512-209.067 512-469.333c0-106.667-42.667-204.8-110.933-285.867zM512 362.667l136.533-93.867c2.488-1.498 5.491-2.384 8.701-2.384 9.426 0 17.067 7.641 17.067 17.067 0 0.841-0.061 1.668-0.178 2.477l0.011-0.092-51.2 162.133 132.267 102.4c1.807 2.666 2.885 5.955 2.885 9.495 0 7.402-4.712 13.703-11.299 16.068l-0.119 0.037h-166.4l-55.467 162.133c-3.142 3.551-7.711 5.778-12.8 5.778s-9.658-2.227-12.784-5.76l-0.016-0.018-55.467-162.133h-170.667c-6.643-2.436-11.298-8.706-11.298-16.062 0-5.654 2.749-10.665 6.984-13.771l0.048-0.033 128-102.4-42.667-157.867c-0.006-0.162-0.009-0.353-0.009-0.544 0-9.426 7.641-17.067 17.067-17.067 1.519 0 2.992 0.199 4.394 0.571l-0.119-0.027 136.533 93.867z" />
<glyph unicode="&#xe938;" glyph-name="star-half" d="M1024 562.95l-353.78 51.408-158.22 320.582-158.216-320.582-353.784-51.408 256-249.538-60.432-352.352 316.432 166.358 316.432-166.358-60.434 352.352 256.002 249.538zM512 206.502l-0.942-0.496 0.942 570.768 111.736-226.396 249.836-36.304-180.788-176.222 42.678-248.83-223.462 117.48z" />
<glyph unicode="&#xe939;" glyph-name="star-full" d="M1024 562.95l-353.78 51.408-158.22 320.582-158.216-320.582-353.784-51.408 256-249.538-60.432-352.352 316.432 166.358 316.432-166.358-60.434 352.352 256.002 249.538z" />
<glyph unicode="&#xe93a;" glyph-name="star-empty" d="M1024 562.95l-353.78 51.408-158.22 320.582-158.216-320.582-353.784-51.408 256-249.538-60.432-352.352 316.432 166.358 316.432-166.358-60.434 352.352 256.002 249.538zM512 206.502l-223.462-117.48 42.676 248.83-180.786 176.222 249.84 36.304 111.732 226.396 111.736-226.396 249.836-36.304-180.788-176.222 42.678-248.83-223.462 117.48z" />
<glyph unicode="&#xe93b;" glyph-name="strava" d="M656.512 194.389l-89.131 175.616h-130.773l219.904-434.005 219.733 434.005h-130.816zM446.421 608.896l121.003-238.848h178.005l-299.008 589.952-298.667-589.995h177.877z" />
<glyph unicode="&#xe93c;" glyph-name="mix" d="M204.8 699.733v-646.4c0-57.6-44.8-100.267-102.4-100.267s-102.4 44.8-102.4 100.267v906.667h1024v-569.6c0-55.467-46.933-100.267-102.4-100.267-57.6 0-104.533 44.8-104.533 100.267v51.2c0 57.6-44.8 100.267-102.4 100.267-48.512 0-90.496-34.261-100.267-80v-163.2c0-57.6-46.933-100.267-102.4-100.267-57.6 0-102.4 44.8-102.4 100.267v394.667c0 55.467-46.933 100.267-102.4 100.267-0.106 0-0.231 0.001-0.356 0.001-53.55 0-97.5-41.106-102.017-93.485l-0.027-0.382z" />
<glyph unicode="&#xe93d;" glyph-name="share" d="M691.797 166.486c1.067 1.408 2.048 2.859 2.987 4.437 0.853 1.493 1.621 3.029 2.304 4.565 3.115 4.608 6.656 8.917 10.581 12.843 15.488 15.488 36.736 25.003 60.331 25.003s44.843-9.515 60.331-25.003 25.003-36.736 25.003-60.331-9.515-44.843-25.003-60.331-36.736-25.003-60.331-25.003-44.843 9.515-60.331 25.003-25.003 36.736-25.003 60.331c0 13.867 3.285 26.923 9.131 38.485zM695.509 680.278c-0.384 0.725-0.768 1.451-1.195 2.176s-0.853 1.451-1.323 2.133c-6.571 12.075-10.325 25.941-10.325 40.747 0 23.595 9.515 44.843 25.003 60.331s36.736 25.003 60.331 25.003 44.843-9.515 60.331-25.003 25.003-36.736 25.003-60.331-9.515-44.843-25.003-60.331-36.736-25.003-60.331-25.003-44.843 9.515-60.331 25.003c-4.608 4.608-8.704 9.728-12.16 15.275zM328.491 471.723c0.384-0.725 0.768-1.451 1.195-2.176s0.853-1.451 1.323-2.133c6.571-12.075 10.325-25.941 10.325-40.747s-3.755-28.672-10.368-40.789c-0.469-0.683-0.896-1.408-1.323-2.133s-0.811-1.408-1.152-2.133c-3.456-5.547-7.552-10.667-12.16-15.275-15.488-15.488-36.736-25.003-60.331-25.003s-44.843 9.515-60.331 25.003-25.003 36.736-25.003 60.331 9.515 44.843 25.003 60.331 36.736 25.003 60.331 25.003 44.843-9.515 60.331-25.003c4.608-4.608 8.704-9.728 12.16-15.275zM603.733 678.912l-226.475-132.139c-0.171 0.213-0.384 0.384-0.597 0.597-30.805 30.805-73.557 49.963-120.661 49.963s-89.856-19.157-120.661-50.005-50.005-73.557-50.005-120.661 19.157-89.856 50.005-120.661 73.557-50.005 120.661-50.005 89.856 19.157 120.661 50.005c0.213 0.213 0.384 0.384 0.597 0.597l226.517-132.011c-4.181-14.805-6.443-30.464-6.443-46.592 0-47.104 19.157-89.856 50.005-120.661s73.557-50.005 120.661-50.005 89.856 19.157 120.661 50.005 50.005 73.557 50.005 120.661-19.157 89.856-50.005 120.661-73.557 50.005-120.661 50.005-89.856-19.157-120.661-50.005c-0.128-0.128-0.299-0.299-0.427-0.427l-226.645 132.053c4.181 14.763 6.4 30.293 6.4 46.379s-2.219 31.659-6.4 46.421l226.475 132.181c0.171-0.213 0.384-0.384 0.597-0.597 30.805-30.848 73.557-50.005 120.661-50.005s89.856 19.157 120.661 50.005 50.005 73.557 50.005 120.661-19.157 89.856-50.005 120.661-73.557 50.005-120.661 50.005-89.856-19.157-120.661-50.005-50.005-73.557-50.005-120.661c0-16.085 2.219-31.659 6.4-46.421z" />
<glyph unicode="&#xe93e;" glyph-name="eye" d="M4.523 445.739c-5.803-11.691-6.229-25.728 0-38.144 0 0 16.896-33.664 47.787-78.635 19.243-27.989 44.288-61.099 74.965-94.635 38.144-41.771 85.504-84.779 141.611-119.467 68.053-42.069 149.589-72.192 243.115-72.192s175.061 30.123 243.115 72.192c56.107 34.688 103.467 77.696 141.611 119.467 30.635 33.536 55.723 66.645 74.965 94.635 30.891 44.971 47.787 78.635 47.787 78.635 5.803 11.691 6.229 25.728 0 38.144 0 0-16.896 33.664-47.787 78.635-19.243 27.989-44.288 61.099-74.965 94.635-38.144 41.771-85.504 84.779-141.611 119.467-68.053 42.069-149.589 72.192-243.115 72.192s-175.061-30.123-243.115-72.192c-56.107-34.688-103.467-77.696-141.611-119.467-30.677-33.536-55.723-66.603-74.965-94.635-30.891-44.971-47.787-78.635-47.787-78.635zM91.307 426.667c6.955 11.989 17.365 29.056 31.317 49.408 17.493 25.429 40.107 55.296 67.627 85.376 34.347 37.589 75.733 74.923 123.477 104.448 57.6 35.584 123.776 59.435 198.272 59.435s140.672-23.851 198.229-59.435c47.744-29.525 89.131-66.859 123.477-104.448 27.477-30.080 50.133-59.947 67.627-85.376 13.995-20.352 24.405-37.376 31.317-49.408-6.955-11.989-17.365-29.056-31.317-49.408-17.493-25.429-40.107-55.296-67.627-85.376-34.347-37.589-75.733-74.923-123.477-104.448-57.557-35.584-123.733-59.435-198.229-59.435s-140.672 23.851-198.229 59.435c-47.744 29.525-89.131 66.859-123.477 104.448-27.477 30.080-50.133 59.947-67.627 85.376-13.995 20.352-24.405 37.419-31.36 49.408zM682.667 426.667c0 47.104-19.157 89.856-50.005 120.661s-73.557 50.005-120.661 50.005-89.856-19.157-120.661-50.005-50.005-73.557-50.005-120.661 19.157-89.856 50.005-120.661 73.557-50.005 120.661-50.005 89.856 19.157 120.661 50.005 50.005 73.557 50.005 120.661zM597.333 426.667c0-23.595-9.515-44.843-25.003-60.331s-36.736-25.003-60.331-25.003-44.843 9.515-60.331 25.003-25.003 36.736-25.003 60.331 9.515 44.843 25.003 60.331 36.736 25.003 60.331 25.003 44.843-9.515 60.331-25.003 25.003-36.736 25.003-60.331z" />
<glyph unicode="&#xe93f;" glyph-name="watch" d="M469.333 554.667v-128c0-11.776 4.779-22.443 12.501-30.165l64-64c16.683-16.683 43.691-16.683 60.331 0s16.683 43.691 0 60.331l-51.499 51.499v110.336c0 23.552-19.115 42.667-42.667 42.667s-42.667-19.115-42.667-42.667zM654.080 116.224l-7.083-77.355c-1.024-11.349-6.272-21.12-14.208-28.075-7.68-6.784-17.707-10.795-28.587-10.795h-184.789c-11.52-0.043-21.76 4.267-29.44 11.477-7.467 6.997-12.416 16.597-13.397 27.435l-7.083 77.525c43.349-19.968 91.648-31.104 142.507-31.104 50.688 0 98.816 11.051 142.080 30.891zM349.312 624.342c44.245 36.48 100.864 58.325 162.688 58.325 70.699 0 134.656-28.587 181.035-74.965s74.965-110.336 74.965-181.035-28.587-134.656-74.965-181.035c-4.437-4.437-9.003-8.704-13.781-12.8-1.493-1.323-3.029-2.603-4.565-3.84-44.245-36.48-100.864-58.325-162.688-58.325-70.699 0-134.656 28.587-181.035 74.965s-74.965 110.336-74.965 181.035 28.587 134.656 74.965 181.035c4.437 4.437 9.003 8.704 13.781 12.8 1.493 1.323 3.029 2.603 4.565 3.84zM746.283 674.902l-13.44 147.413c-2.987 32.256-17.835 61.013-40.021 81.792-22.997 21.547-54.016 34.688-87.808 34.56h-185.771c-32.213-0.128-62.037-12.203-84.693-32.299-23.552-20.821-39.467-50.432-42.539-84.139l-13.397-146.475c-2.688-2.517-5.376-5.12-7.979-7.723-61.696-61.739-99.968-147.115-99.968-241.365s38.272-179.627 99.968-241.365c2.475-2.475 4.992-4.907 7.509-7.296l13.44-146.987c2.987-32.256 17.835-61.013 40.021-81.792 22.997-21.547 54.016-34.688 87.808-34.56h184.661c32.384-0.043 62.421 12.032 85.205 32.171 23.595 20.864 39.637 50.517 42.667 84.267l13.397 146.475c2.688 2.517 5.376 5.12 7.979 7.723 61.739 61.739 100.011 147.115 100.011 241.365s-38.272 179.627-99.968 241.365c-2.304 2.304-4.693 4.608-7.040 6.869zM369.92 737.11l7.083 77.355c1.024 11.307 6.272 21.077 14.123 28.032 7.637 6.784 17.579 10.795 28.459 10.837h185.429c11.52 0.043 21.76-4.267 29.44-11.477 7.467-6.997 12.416-16.597 13.397-27.435l7.083-77.696c-43.477 20.053-91.904 31.275-142.933 31.275-50.688 0-98.816-11.051-142.080-30.891z" />
<glyph unicode="&#xe940;" glyph-name="arrow-right" d="M481.835 695.168l225.835-225.835h-494.336c-23.552 0-42.667-19.115-42.667-42.667s19.115-42.667 42.667-42.667h494.336l-225.835-225.835c-16.683-16.683-16.683-43.691 0-60.331s43.691-16.683 60.331 0l298.667 298.667c3.925 3.925 7.083 8.619 9.259 13.824 4.309 10.453 4.309 22.229 0 32.683-2.091 5.035-5.163 9.728-9.259 13.824l-298.667 298.667c-16.683 16.683-43.691 16.683-60.331 0s-16.683-43.691 0-60.331z" />
<glyph unicode="&#xe941;" glyph-name="arrow-left" d="M542.165 158.166l-225.835 225.835h494.336c23.552 0 42.667 19.115 42.667 42.667s-19.115 42.667-42.667 42.667h-494.336l225.835 225.835c16.683 16.683 16.683 43.691 0 60.331s-43.691 16.683-60.331 0l-298.667-298.667c-4.096-4.096-7.168-8.789-9.259-13.824-2.176-5.205-3.243-10.795-3.243-16.341 0-10.923 4.181-21.845 12.501-30.165l298.667-298.667c16.683-16.683 43.691-16.683 60.331 0s16.683 43.691 0 60.331z" />
<glyph unicode="&#xe942;" glyph-name="arrow-down" d="M780.501 456.832l-225.835-225.835v494.336c0 23.552-19.115 42.667-42.667 42.667s-42.667-19.115-42.667-42.667v-494.336l-225.835 225.835c-16.683 16.683-43.691 16.683-60.331 0s-16.683-43.691 0-60.331l298.667-298.667c4.096-4.096 8.789-7.168 13.824-9.259s10.539-3.243 16.341-3.243c5.547 0 11.136 1.067 16.341 3.243 5.035 2.091 9.728 5.163 13.824 9.259l298.667 298.667c16.683 16.683 16.683 43.691 0 60.331s-43.691 16.683-60.331 0z" />
<glyph unicode="&#xe943;" glyph-name="arrow-up" d="M243.499 396.502l225.835 225.835v-494.336c0-23.552 19.115-42.667 42.667-42.667s42.667 19.115 42.667 42.667v494.336l225.835-225.835c16.683-16.683 43.691-16.683 60.331 0s16.683 43.691 0 60.331l-298.667 298.667c-4.096 4.096-8.789 7.168-13.824 9.259-5.205 2.176-10.795 3.243-16.341 3.243-10.923 0-21.845-4.181-30.165-12.501l-298.667-298.667c-16.683-16.683-16.683-43.691 0-60.331s43.691-16.683 60.331 0z" />
<glyph unicode="&#xe944;" glyph-name="bloglovin-ico" d="M1007.062 798.316c-19.248 60.054-83.922 102.4-143.976 66.214-90.851-55.435-41.576-176.313 53.125-181.702-19.248-43.886-46.965-78.532-84.692-107.789 37.726-80.072 92.391-53.125 132.427 7.699 40.036 59.284 65.444 145.516 43.116 215.579zM569.744 459.549c34.647 34.647 73.913 53.125 97.011 100.090 54.665 109.329 4.62 262.544-112.409 304.89-64.674 23.098-133.197 18.478-200.18 18.478h-307.97v-854.617h361.865c71.603 0 145.516-5.389 207.88 36.956 123.188 84.692 123.188 361.095-46.195 394.202zM215.579 721.323c73.913 0 185.552 20.788 253.305-13.089 60.054-30.027 59.284-124.728 0.77-155.525-25.408-13.089-56.974-9.239-84.692-9.239h-169.383v177.853zM485.053 201.624c-27.717-14.629-61.594-11.549-92.391-11.549h-177.083v192.481h161.684c33.107 0 69.293 3.080 100.090-12.319 63.134-30.797 73.143-133.967 7.699-168.614z" />
<glyph unicode="&#xe945;" glyph-name="youtube" d="M961.707 675.413c-10.773 40.64-42.613 72.64-82.987 83.52-73.173 19.733-366.72 19.733-366.72 19.733s-293.547 0-366.72-19.733c-40.373-10.88-72.213-42.88-82.987-83.52-19.627-73.707-19.627-227.413-19.627-227.413s0-153.707 19.627-227.413c10.773-40.64 42.613-72.64 82.987-83.52 73.173-19.733 366.72-19.733 366.72-19.733s293.547 0 366.72 19.733c40.373 10.88 72.213 42.88 82.987 83.52 19.627 73.707 19.627 227.413 19.627 227.413s0 153.707-19.627 227.413zM416 308.427v279.147l245.333-139.573-245.333-139.573z" />
<glyph unicode="&#xe946;" glyph-name="notice" d="M496 848c-229.76 0-416-186.24-416-416s186.24-416 416-416 416 186.24 416 416-186.24 416-416 416zM496 196c-26.528 0-48 21.504-48 48s21.472 48 48 48c26.496 0 48-21.504 48-48s-21.504-48-48-48zM544 404c0-26.496-21.504-48-48-48-26.528 0-48 21.504-48 48v224c0 26.528 21.472 48 48 48 26.496 0 48-21.472 48-48v-224z" />
<glyph unicode="&#xe947;" glyph-name="discord" d="M862.805 960c59.989 0 108.373-48.512 111.232-105.6v-918.4l-114.219 96.981-62.72 57.088-68.437 59.648 28.587-94.080h-598.955c-59.819 0-108.373 45.44-108.373 105.643v692.907c0 57.088 48.64 105.685 108.587 105.685h704zM601.771 717.525h-1.28l-8.619-8.533c88.448-25.6 131.243-65.579 131.243-65.579-57.003 28.501-108.373 42.752-159.744 48.512-37.12 5.76-74.24 2.731-105.6 0h-8.533c-20.053 0-62.72-8.533-119.893-31.36-19.925-8.661-31.36-14.336-31.36-14.336s42.752 42.752 136.96 65.579l-5.76 5.76c0 0-71.339 2.731-148.352-54.187 0 0-77.013-134.144-77.013-299.52 0 0 42.667-74.24 159.701-77.056 0 0 17.067 22.741 34.347 42.752-65.707 19.968-91.307 59.904-91.307 59.904s5.717-2.816 14.293-8.533h2.56c1.28 0 1.877-0.64 2.56-1.28v-0.256c0.683-0.683 1.28-1.28 2.56-1.28 14.080-5.803 28.16-11.52 39.68-17.067 19.883-8.619 45.44-17.195 76.8-22.869 39.68-5.76 85.163-8.533 136.96 0 25.6 5.76 51.2 11.392 76.8 22.827 16.64 8.533 37.12 17.067 59.605 31.445 0 0-25.6-39.936-94.080-59.904 14.080-19.883 33.92-42.667 33.92-42.667 117.077 2.56 162.56 76.8 165.12 73.643 0 165.12-77.44 299.52-77.44 299.52-69.76 51.797-135.040 53.76-146.56 53.76zM608.939 529.237c29.995 0 54.187-25.6 54.187-56.96 0-31.573-24.32-57.173-54.187-57.173s-54.187 25.6-54.187 56.917c0.085 31.573 24.448 57.088 54.187 57.216zM415.104 529.237c29.867 0 54.016-25.6 54.016-56.96 0-31.573-24.32-57.173-54.187-57.173s-54.187 25.6-54.187 56.917c0 31.573 24.32 57.088 54.357 57.216z" />
<glyph unicode="&#xe948;" glyph-name="tiktok" d="M534.613 959.147c55.893 0.853 111.36 0.427 166.827 0.853 3.413-65.28 26.88-131.84 74.667-177.92 47.787-47.36 115.2-69.12 180.907-76.373v-171.947c-61.44 2.133-123.307 14.933-179.2 41.387-24.32 11.093-46.933 25.173-69.12 39.68-0.427-124.587 0.427-249.173-0.853-373.333-3.413-59.733-23.040-119.040-57.6-168.107-55.893-81.92-152.747-135.253-252.16-136.96-61.013-3.413-122.027 13.227-174.080 43.947-86.187 50.773-146.773 143.787-155.733 243.627-0.853 21.333-1.28 42.667-0.427 63.573 7.68 81.067 47.787 158.72 110.080 211.627 70.827 61.44 169.813 90.88 262.4 73.387 0.853-63.147-1.707-126.293-1.707-189.44-42.24 13.653-91.733 9.813-128.853-15.787-26.88-17.493-47.36-44.373-58.027-74.667-8.96-21.76-6.4-45.653-5.973-68.693 10.24-69.973 77.653-128.853 149.333-122.453 47.787 0.427 93.44 28.16 118.187 68.693 8.107 14.080 17.067 28.587 17.493 45.227 4.267 76.373 2.56 152.32 2.987 228.693 0.427 171.947-0.427 343.467 0.853 514.987z" />
<glyph unicode="&#xe949;" glyph-name="facebook" d="M1023.919 448.038c0 282.748-229.21 511.962-511.957 511.962s-511.962-229.214-511.962-511.962c0-255.535 187.217-467.332 431.966-505.741v357.751h-129.988v147.989h129.988v112.794c0 128.311 76.433 199.185 193.374 199.185 56.013 0 114.603-10.001 114.603-10.001v-125.99h-64.555c-63.599 0-83.435-39.462-83.435-79.949v-96.038h141.99l-22.699-147.989h-119.292v-357.751c244.753 38.409 431.966 250.206 431.966 505.741z" />
<glyph unicode="&#xf041;" glyph-name="map-marker" horiz-adv-x="585" d="M438.857 585.143q0 60.571-42.857 103.429t-103.429 42.857-103.429-42.857-42.857-103.429 42.857-103.429 103.429-42.857 103.429 42.857 42.857 103.429zM585.143 585.143q0-62.286-18.857-102.286l-208-442.286q-9.143-18.857-27.143-29.714t-38.571-10.857-38.571 10.857-26.571 29.714l-208.571 442.286q-18.857 40-18.857 102.286 0 121.143 85.714 206.857t206.857 85.714 206.857-85.714 85.714-206.857z" />
<glyph unicode="&#xf079;" glyph-name="retweet" horiz-adv-x="1097" d="M731.429 91.428q0-7.429-5.429-12.857t-12.857-5.429h-548.571q-4.571 0-7.714 1.143t-5.143 4-3.143 4.571-1.714 6.571-0.571 6.571v342.857h-109.714q-14.857 0-25.714 10.857t-10.857 25.714q0 13.714 8.571 23.429l182.857 219.429q10.857 12.571 28 12.571t28-12.571l182.857-219.429q8.571-9.714 8.571-23.429 0-14.857-10.857-25.714t-25.714-10.857h-109.714v-219.429h329.143q9.143 0 14.286-6.286l91.429-109.714q4-6.286 4-12zM1097.143 329.143q0-13.714-8.571-23.429l-182.857-219.429q-11.429-13.143-28-13.143t-28 13.143l-182.857 219.429q-8.571 9.714-8.571 23.429 0 14.857 10.857 25.714t25.714 10.857h109.714v219.429h-329.143q-9.143 0-14.286 6.857l-91.429 109.714q-4 5.143-4 11.429 0 7.429 5.429 12.857t12.857 5.429h548.571q4.571 0 7.714-1.143t5.143-4 3.143-4.571 1.714-6.571 0.571-6.571v-342.857h109.714q14.857 0 25.714-10.857t10.857-25.714z" />
<glyph unicode="&#xf095;" glyph-name="phone, viber" horiz-adv-x="805" d="M804.571 242.286q0-15.429-5.714-40.286t-12-39.143q-12-28.571-69.714-60.571-53.714-29.143-106.286-29.143-15.429 0-30 2t-32.857 7.143-27.143 8.286-31.714 11.714-28 10.286q-56 20-100 47.429-73.143 45.143-151.143 123.143t-123.143 151.143q-27.429 44-47.429 100-1.714 5.143-10.286 28t-11.714 31.714-8.286 27.143-7.143 32.857-2 30q0 52.571 29.143 106.286 32 57.714 60.571 69.714 14.286 6.286 39.143 12t40.286 5.714q8 0 12-1.714 10.286-3.429 30.286-43.429 6.286-10.857 17.143-30.857t20-36.286 17.714-30.571q1.714-2.286 10-14.286t12.286-20.286 4-16.286q0-11.429-16.286-28.571t-35.429-31.429-35.429-30.286-16.286-26.286q0-5.143 2.857-12.857t4.857-11.714 8-13.714 6.571-10.857q43.429-78.286 99.429-134.286t134.286-99.429q1.143-0.571 10.857-6.571t13.714-8 11.714-4.857 12.857-2.857q10.286 0 26.286 16.286t30.286 35.429 31.429 35.429 28.571 16.286q8 0 16.286-4t20.286-12.286 14.286-10q14.286-8.571 30.571-17.714t36.286-20 30.857-17.143q40-20 43.429-30.286 1.714-4 1.714-12z" />
<glyph unicode="&#xf099;" glyph-name="twitter" horiz-adv-x="951" d="M925.714 717.714q-38.286-56-92.571-95.429 0.571-8 0.571-24 0-74.286-21.714-148.286t-66-142-105.429-120.286-147.429-83.429-184.571-31.143q-154.857 0-283.429 82.857 20-2.286 44.571-2.286 128.571 0 229.143 78.857-60 1.143-107.429 36.857t-65.143 91.143q18.857-2.857 34.857-2.857 24.571 0 48.571 6.286-64 13.143-106 63.714t-42 117.429v2.286q38.857-21.714 83.429-23.429-37.714 25.143-60 65.714t-22.286 88q0 50.286 25.143 93.143 69.143-85.143 168.286-136.286t212.286-56.857q-4.571 21.714-4.571 42.286 0 76.571 54 130.571t130.571 54q80 0 134.857-58.286 62.286 12 117.143 44.571-21.143-65.714-81.143-101.714 53.143 5.714 106.286 28.571z" />
<glyph unicode="&#xf09e;" glyph-name="feed, rss" horiz-adv-x="805" d="M219.429 182.857q0-45.714-32-77.714t-77.714-32-77.714 32-32 77.714 32 77.714 77.714 32 77.714-32 32-77.714zM512 112.571q1.143-16-9.714-27.429-10.286-12-26.857-12h-77.143q-14.286 0-24.571 9.429t-11.429 23.714q-12.571 130.857-105.429 223.714t-223.714 105.429q-14.286 1.143-23.714 11.429t-9.429 24.571v77.143q0 16.571 12 26.857 9.714 9.714 24.571 9.714h2.857q91.429-7.429 174.857-46t148-103.714q65.143-64.571 103.714-148t46-174.857zM804.571 111.428q1.143-15.429-10.286-26.857-10.286-11.429-26.286-11.429h-81.714q-14.857 0-25.429 10t-11.143 24.286q-6.857 122.857-57.714 233.429t-132.286 192-192 132.286-233.429 58.286q-14.286 0.571-24.286 11.143t-10 24.857v81.714q0 16 11.429 26.286 10.286 10.286 25.143 10.286h1.714q149.714-7.429 286.571-68.571t243.143-168q106.857-106.286 168-243.143t68.571-286.571z" />
<glyph unicode="&#xf0d2;" glyph-name="pinterest" horiz-adv-x="878" d="M877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857q-63.429 0-124.571 18.286 33.714 53.143 44.571 93.714 5.143 19.429 30.857 120.571 11.429-22.286 41.714-38.571t65.143-16.286q69.143 0 123.429 39.143t84 107.714 29.714 154.286q0 65.143-34 122.286t-98.571 93.143-145.714 36q-60 0-112-16.571t-88.286-44-62.286-63.143-38.286-74-12.286-76.571q0-59.429 22.857-104.571t66.857-63.429q17.143-6.857 21.714 11.429 1.143 4 4.571 17.714t4.571 17.143q3.429 13.143-6.286 24.571-29.143 34.857-29.143 86.286 0 86.286 59.714 148.286t156.286 62q86.286 0 134.571-46.857t48.286-121.714q0-97.143-39.143-165.143t-100.286-68q-34.857 0-56 24.857t-13.143 59.714q4.571 20 15.143 53.429t17.143 58.857 6.571 43.143q0 28.571-15.429 47.429t-44 18.857q-35.429 0-60-32.571t-24.571-81.143q0-41.714 14.286-69.714l-56.571-238.857q-9.714-40-7.429-101.143-117.714 52-190.286 160.571t-72.571 241.714q0 119.429 58.857 220.286t159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
<glyph unicode="&#xf0d5;" glyph-name="google-plus, googleplus" horiz-adv-x="1317" d="M821.143 429.143q0-118.857-49.714-211.714t-141.714-145.143-210.857-52.286q-85.143 0-162.857 33.143t-133.714 89.143-89.143 133.714-33.143 162.857 33.143 162.857 89.143 133.714 133.714 89.143 162.857 33.143q163.429 0 280.571-109.714l-113.714-109.143q-66.857 64.571-166.857 64.571-70.286 0-130-35.429t-94.571-96.286-34.857-132.857 34.857-132.857 94.571-96.286 130-35.429q47.429 0 87.143 13.143t65.429 32.857 44.857 44.857 28 47.429 12.286 42.286h-237.714v144h395.429q6.857-36 6.857-69.714zM1316.571 498.857v-120h-119.429v-119.429h-120v119.429h-119.429v120h119.429v119.429h120v-119.429h119.429z" />
<glyph unicode="&#xf0e1;" glyph-name="linkedin" horiz-adv-x="878" d="M199.429 593.714v-566.286h-188.571v566.286h188.571zM211.429 768.571q0.571-41.714-28.857-69.714t-77.429-28h-1.143q-46.857 0-75.429 28t-28.571 69.714q0 42.286 29.429 70t76.857 27.714 76-27.714 29.143-70zM877.714 352v-324.571h-188v302.857q0 60-23.143 94t-72.286 34q-36 0-60.286-19.714t-36.286-48.857q-6.286-17.143-6.286-46.286v-316h-188q1.143 228 1.143 369.714t-0.571 169.143l-0.571 27.429h188v-82.286h-1.143q11.429 18.286 23.429 32t32.286 29.714 49.714 24.857 65.429 8.857q97.714 0 157.143-64.857t59.429-190z" />
<glyph unicode="&#xf173;" glyph-name="tumblr" horiz-adv-x="624" d="M539.429 191.428l45.714-135.429q-13.143-20-63.429-37.714t-101.143-18.286q-59.429-1.143-108.857 14.857t-81.429 42.286-54.286 60.571-31.714 68.571-9.429 67.429v310.857h-96v122.857q41.143 14.857 73.714 39.714t52 51.429 33.143 58.286 19.429 56.571 8.571 50.571q0.571 2.857 2.571 4.857t4.286 2h139.429v-242.286h190.286v-144h-190.857v-296q0-17.143 3.714-32t12.857-30 28.286-23.714 46.571-8q44.571 1.143 76.571 16.571z" />
<glyph unicode="&#xf17d;" glyph-name="dribbble" horiz-adv-x="878" d="M585.143 93.714q-24 137.714-80 284.571h-1.143l-1.143-0.571q-9.143-3.429-24.571-9.429t-57.714-28-78.286-46.857-74.857-65.429-58.857-84.571l-8.571 6.286q105.143-85.714 238.857-85.714 75.429 0 146.286 29.714zM479.429 440.571q-12 28-30.286 63.429-177.714-53.143-384.571-53.143-0.571-4-0.571-12 0-70.857 25.143-135.143t70.857-115.143q28.571 50.857 70.571 95.143t81.429 71.143 74.571 46.286 56.857 27.429l21.143 7.429q2.286 0.571 7.429 2t7.429 2.571zM418.286 561.714q-68.571 121.714-139.429 216-78.857-37.143-133.714-106.286t-73.143-155.429q172.571 0 346.286 45.714zM809.143 379.428q-120 34.286-233.714 16.571 49.714-136.571 73.143-268 63.429 42.857 105.714 108.286t54.857 143.143zM349.143 802.857q-0.571 0-1.143-0.571 0.571 0.571 1.143 0.571zM686.286 720q-105.714 93.714-247.429 93.714-43.429 0-88.571-10.857 74.857-97.143 140.571-218.286 39.429 14.857 74.286 34.571t55.143 35.143 37.429 32.571 21.429 23.143zM813.714 442.857q-1.714 132.571-85.143 234.286l-0.571-0.571q-5.143-6.857-10.857-14t-24.857-25.429-40.571-34.571-57.143-37.143-75.143-36.857q14.286-30.286 25.143-54.286 1.143-3.429 3.714-10t4.286-9.429q20.571 2.857 42.571 4t42 1.143 39.429-0.857 36.571-2.286 32.286-3.143 27.429-3.714 20.857-3.429 14.286-2.571zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
<glyph unicode="&#xf189;" glyph-name="vk, vkontakte" horiz-adv-x="1104" d="M1095.429 653.714q13.143-36.571-85.714-168-13.714-18.286-37.143-48.571-44.571-57.143-51.429-74.857-9.714-23.429 8-46.286 9.714-12 46.286-46.857h0.571l2.286-2.286q80.571-74.857 109.143-126.286 1.714-2.857 3.714-7.143t4-15.143-0.286-19.429-14.286-15.714-33.714-7.143l-146.286-2.286q-13.714-2.857-32 2.857t-29.714 12.571l-11.429 6.857q-17.143 12-40 36.571t-39.143 44.286-34.857 33.143-32.286 8.857q-1.714-0.571-4.571-2t-9.714-8.286-12.286-16.857-9.714-29.714-3.714-44.286q0-8.571-2-15.714t-4.286-10.571l-2.286-2.857q-10.286-10.857-30.286-12.571h-65.714q-40.571-2.286-83.429 9.429t-75.143 30.286-58.857 37.714-40.286 32.857l-14.286 13.714q-5.714 5.714-15.714 17.143t-40.857 52-60.571 86.286-70 120.571-74.571 155.429q-3.429 9.143-3.429 15.429t1.714 9.143l2.286 3.429q8.571 10.857 32.571 10.857l156.571 1.143q6.857-1.143 13.143-3.714t9.143-4.857l2.857-1.714q9.143-6.286 13.714-18.286 11.429-28.571 26.286-59.143t23.429-46.571l9.143-16.571q16.571-34.286 32-59.429t27.714-39.143 23.714-22 19.429-8 15.429 2.857q1.143 0.571 2.857 2.857t6.857 12.571 7.714 26.857 5.429 46.286 0 71.429q-1.143 22.857-5.143 41.714t-8 26.286l-3.429 6.857q-14.286 19.429-48.571 24.571-7.429 1.143 2.857 13.714 9.714 10.857 21.714 17.143 30.286 14.857 136.571 13.714 46.857-0.571 77.143-7.429 11.429-2.857 19.143-7.714t11.714-13.714 6-18.286 2-26-0.571-31.429-1.429-40.286-0.857-47.143q0-6.286-0.571-24t-0.286-27.429 2-23.143 6.571-22.286 12.857-14q4.571-1.143 9.714-2.286t14.857 6.286 21.714 19.714 29.714 38.286 38.857 61.429q34.286 59.429 61.143 128.571 2.286 5.714 5.714 10t6.286 6l2.286 1.714 2.857 1.429t7.429 1.714 11.429 0.286l164.571 1.143q22.286 2.857 36.571-1.429t17.714-9.429z" />
<glyph unicode="&#xf1a4;" glyph-name="stumbleupon" horiz-adv-x="1097" d="M606.857 544v67.429q0 24-17.143 41.143t-41.143 17.143-41.143-17.143-17.143-41.143v-349.714q0-100-72-170.857t-173.143-70.857q-101.714 0-173.429 71.714t-71.714 173.429v152h187.429v-149.714q0-24.571 17.143-41.429t41.143-16.857 41.143 16.857 17.143 41.429v354.286q0 97.714 72.286 166.857t172.286 69.143q100.571 0 172.571-69.714t72-168v-77.714l-111.429-33.143zM909.714 417.143h187.429v-152q0-101.714-71.714-173.429t-173.429-71.714q-101.143 0-173.143 71.143t-72 171.714v153.143l74.857-34.857 111.429 33.143v-154.286q0-24 17.143-40.857t41.143-16.857 41.143 16.857 17.143 40.857v157.143z" />
<glyph unicode="&#xf1b4;" glyph-name="behance" horiz-adv-x="1170" d="M1056 757.143h-292v-70.857h292v70.857zM912 513.714q-51.429 0-83.429-30t-35.429-81.429h233.143q-10.286 111.429-114.286 111.429zM921.143 179.428q36 0 69.714 18.286t43.429 49.714h126.286q-57.143-175.429-244-175.429-122.286 0-194.571 75.429t-72.286 198.286q0 118.857 74.571 197.429t192.286 78.571q78.857 0 137.429-38.857t87.429-102.286 28.857-141.714q0-9.714-1.143-26.857h-376q0-63.429 32.857-98t95.143-34.571zM158.286 208h169.143q117.143 0 117.143 95.429 0 102.857-113.714 102.857h-172.571v-198.286zM158.286 514.857h160.571q44.571 0 70.571 20.857t26 64.857q0 82.286-108.571 82.286h-148.571v-168zM0 805.714h339.429q49.714 0 88.571-8t72.286-27.143 51.429-55.143 18-88q0-103.429-98.286-150.286 65.143-18.286 98.286-65.714t33.143-116.571q0-42.857-14-78t-37.714-59.143-56.286-40.571-69.143-24-76.571-7.429h-349.143v720z" />
<glyph unicode="&#xf1bc;" glyph-name="spotify" horiz-adv-x="878" d="M644 259.428q0 18.286-17.143 29.143-110.286 65.714-255.429 65.714-76 0-164-19.429-24-5.143-24-29.714 0-11.429 7.714-19.714t20.286-8.286q2.857 0 21.143 4.571 75.429 15.429 138.857 15.429 129.143 0 226.857-58.857 10.857-6.286 18.857-6.286 10.857 0 18.857 7.714t8 19.714zM698.857 382.286q0 22.857-20 34.857-135.429 80.571-313.143 80.571-87.429 0-173.143-24-27.429-7.429-27.429-36.571 0-14.286 10-24.286t24.286-10q4 0 21.143 4.571 69.714 18.857 143.429 18.857 159.429 0 278.857-70.857 13.714-7.429 21.714-7.429 14.286 0 24.286 10t10 24.286zM760.571 524q0 26.857-22.857 40-72 41.714-167.429 63.143t-196 21.429q-116.571 0-208-26.857-13.143-4-22-14.571t-8.857-27.714q0-17.714 11.714-29.714t29.429-12q6.286 0 22.857 4.571 76 21.143 175.429 21.143 90.857 0 176.857-19.429t144.857-54.286q12-6.857 22.857-6.857 16.571 0 28.857 11.714t12.286 29.429zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
<glyph unicode="&#xf1be;" glyph-name="soundcloud" horiz-adv-x="1317" d="M448 166.857l9.143 137.714-9.143 298.857q-0.571 5.714-4.286 9.714t-9.429 4q-5.143 0-9.143-4t-4-9.714l-8-298.857 8-137.714q0.571-5.714 4.286-9.429t8.857-3.714q12.571 0 13.714 13.143zM617.143 183.428l6.286 120.571-6.857 334.857q0 9.143-7.429 13.714-4.571 2.857-9.143 2.857t-9.143-2.857q-7.429-4.571-7.429-13.714l-0.571-3.429-5.714-330.857q0-0.571 6.286-134.857v-0.571q0-5.714 3.429-9.714 5.143-6.286 13.143-6.286 6.286 0 11.429 5.143 5.143 4 5.143 11.429zM20 377.714l11.429-73.143-11.429-72q-1.143-5.143-5.143-5.143t-5.143 5.143l-9.714 72 9.714 73.143q1.143 5.143 5.143 5.143t5.143-5.143zM69.143 422.857l14.857-118.286-14.857-116q-1.143-5.143-5.714-5.143-5.143 0-5.143 5.714l-13.143 115.429 13.143 118.286q0 5.143 5.143 5.143 4.571 0 5.714-5.143zM121.714 444.571l14.286-140-14.286-135.429q0-6.286-6.286-6.286-5.714 0-6.857 6.286l-12 135.429 12 140q1.143 6.857 6.857 6.857 6.286 0 6.286-6.857zM175.429 448.571l13.143-144-13.143-139.429q-1.143-7.429-8-7.429-7.429 0-7.429 7.429l-12 139.429 12 144q0 7.429 7.429 7.429 6.857 0 8-7.429zM229.143 438.286l12-133.714-12-140.571q-1.143-9.143-9.143-9.143-3.429 0-6 2.571t-2.571 6.571l-11.429 140.571 11.429 133.714q0 3.429 2.571 6t6 2.571q8 0 9.143-8.571zM282.857 521.714l12-217.143-12-140.571q0-4-2.857-7.143t-6.857-3.143q-9.143 0-10.286 10.286l-10.286 140.571 10.286 217.143q1.143 10.286 10.286 10.286 4 0 6.857-3.143t2.857-7.143zM336.571 570.857l10.857-267.429-10.857-139.429q0-4.571-3.143-7.714t-7.714-3.143q-10.286 0-11.429 10.857l-9.143 139.429 9.143 267.429q1.143 10.857 11.429 10.857 4.571 0 7.714-3.143t3.143-7.714zM392.571 593.714l10.286-289.143-10.286-138.286q-1.143-12-12.571-12-10.857 0-12 12l-9.143 138.286 9.143 289.143q0 5.143 3.714 8.857t8.286 3.714q5.143 0 8.571-3.714t4-8.857zM616.571 169.714v0 0zM503.429 596l8.571-291.429-8.571-136.571q0-5.714-4.286-10t-10-4.286-9.714 4-4.571 10.286l-8 136.571 8 291.429q0 6.286 4.286 10.286t10 4 10-4 4.286-10.286zM560 585.143l8-281.143-8-134.857q0-6.286-4.571-10.857t-10.857-4.571-10.857 4.571-5.143 10.857l-6.857 134.857 6.857 281.143q0.571 6.857 5.143 11.429t10.857 4.571 10.571-4.571 4.857-11.429zM681.143 304l-8-132q0-7.429-5.143-12.571t-12.571-5.143-12.571 5.143-5.714 12.571l-3.429 65.143-3.429 66.857 6.857 363.429v1.714q1.143 8.571 6.857 13.714 5.143 4 11.429 4 4.571 0 8.571-2.857 8-4.571 9.143-14.857zM1316.571 314.857q0-66.857-47.429-114t-114.286-47.143h-449.143q-7.429 1.143-12.571 6.286t-5.143 12.571v513.714q0 13.143 16 18.857 48.571 19.429 103.429 19.429 111.429 0 193.143-75.143t91.429-184.857q30.286 12.571 62.857 12.571 66.857 0 114.286-47.429t47.429-114.857z" />
<glyph unicode="&#xf219;" glyph-name="diamond" horiz-adv-x="1170" d="M121.143 512l356-380-171.429 380h-184.571zM585.143 70.857l199.429 441.143h-398.857zM307.429 585.143l116.571 219.429h-149.714l-164.571-219.429h197.714zM693.143 132l356 380h-184.571zM390.286 585.143h389.714l-116.571 219.429h-156.571zM862.857 585.143h197.714l-164.571 219.429h-149.714zM943.429 862.857l219.429-292.571q8-10.286 7.429-23.714t-9.714-23.143l-548.571-585.143q-10.286-11.429-26.857-11.429t-26.857 11.429l-548.571 585.143q-9.143 9.714-9.714 23.143t7.429 23.714l219.429 292.571q10.286 14.857 29.143 14.857h658.286q18.857 0 29.143-14.857z" />
<glyph unicode="&#xf232;" glyph-name="whatsapp" horiz-adv-x="878" d="M562.857 394.286q7.429 0 55.714-25.143t51.143-30.286q1.143-2.857 1.143-8.571 0-18.857-9.714-43.429-9.143-22.286-40.571-37.429t-58.286-15.143q-32.571 0-108.571 35.429-56 25.714-97.143 67.429t-84.571 105.714q-41.143 61.143-40.571 110.857v4.571q1.714 52 42.286 90.286 13.714 12.571 29.714 12.571 3.429 0 10.286-0.857t10.857-0.857q10.857 0 15.143-3.714t8.857-15.714q4.571-11.429 18.857-50.286t14.286-42.857q0-12-19.714-32.857t-19.714-26.571q0-4 2.857-8.571 19.429-41.714 58.286-78.286 32-30.286 86.286-57.714 6.857-4 12.571-4 8.571 0 30.857 27.714t29.714 27.714zM446.857 91.428q72.571 0 139.143 28.571t114.571 76.571 76.571 114.571 28.571 139.143-28.571 139.143-76.571 114.571-114.571 76.571-139.143 28.571-139.143-28.571-114.571-76.571-76.571-114.571-28.571-139.143q0-116 68.571-210.286l-45.143-133.143 138.286 44q90.286-59.429 197.143-59.429zM446.857 881.143q87.429 0 167.143-34.286t137.429-92 92-137.429 34.286-167.143-34.286-167.143-92-137.429-137.429-92-167.143-34.286q-111.429 0-208.571 53.714l-238.286-76.571 77.714 231.429q-61.714 101.714-61.714 222.286 0 87.429 34.286 167.143t92 137.429 137.429 92 167.143 34.286z" />
<glyph unicode="&#xf265;" glyph-name="get-pocket, pocket" horiz-adv-x="983" d="M894.286 877.714q37.143 0 62.857-26t25.714-63.143v-296.571q0-100.571-38.857-192t-104.286-157.143-156.571-104.286-191.143-38.571q-100.571 0-191.714 38.571t-156.857 104.286-104.571 157.143-38.857 192v296.571q0 36.571 26.286 62.857t62.857 26.286h805.143zM492 269.714q26.857 0 46.857 18.857l230.857 221.714q21.143 20 21.143 48.571 0 28-19.714 47.714t-47.714 19.714q-26.857 0-46.857-18.857l-184.571-177.143-184.571 177.143q-20 18.857-46.286 18.857-28 0-47.714-19.714t-19.714-47.714q0-29.143 20.571-48.571l231.429-221.714q18.857-18.857 46.286-18.857z" />
<glyph unicode="&#xf27d;" glyph-name="vimeo" horiz-adv-x="1029" d="M976.571 654.857q-5.714-134.857-189.714-372-190.286-246.286-321.143-246.286-81.143 0-137.143 150.286-25.143 91.429-75.429 275.429-41.143 149.714-89.714 149.714-10.286 0-72.571-43.429l-44 56q13.714 12 61.714 55.143t74.286 66q89.143 78.857 137.714 83.429 54.286 5.143 87.429-31.714t46.286-116.286q25.143-164 37.714-213.143 31.429-142.286 68.571-142.286 29.143 0 88 92 57.714 92 62.286 140.571 7.429 79.429-62.286 79.429-32.571 0-69.143-14.857 68.571 224.571 262.286 218.286 143.429-4.571 134.857-186.286z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 84 KiB

File diff suppressed because one or more lines are too long
@@ -0,0 +1,17 @@
/**
* Global Powerkit Scripts
*/
jQuery( document ).ready( function( $ ) {
// ToolTip.
$( '.pk-tippy' ).each(function( index, element ) {
tippy( element, {
arrow: true,
interactive: true,
placement: 'bottom',
content: $( element ).find( '.pk-alert' ).html()
});
});
} );
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,88 @@
<?php
/**
* Deprecated features and migration functions
*
* @package Powerkit
* @subpackage Core
*/
/**
* Migration to 2.0.7
*
* @param string $current Current version.
* @param string $new New version.
*/
add_action( 'powerkit_plugin_upgrade', function ( $current, $new ) {
if ( version_compare( $current, '2.0.7', '<' ) ) {
require_once POWERKIT_PATH . 'modules/post-views/helpers/db-powerkit-post-views.php';
$post_views_db = new Powerkit_Post_Views_DB();
$post_views_db->activate_single();
}
}, 10, 2 );
/**
* Migration to 2.2.2
*
* @param string $current Current version.
* @param string $new New version.
*/
add_action( 'powerkit_plugin_upgrade', function ( $current, $new ) {
if ( version_compare( $current, '2.2.2', '<' ) ) {
$transients = array(
'powerkit_connect_instagram_app_access_token',
'powerkit_connect_instagram_app_type',
'powerkit_connect_instagram_app_user_id',
'powerkit_connect_instagram_app_username',
'powerkit_connect_instagram_app_refresh',
'powerkit_connect_facebook_app_access_token',
'powerkit_connect_facebook_app_accounts',
'powerkit_connect_facebook_app_refresh',
'powerkit_connect_twitter_app_user_id',
'powerkit_connect_twitter_app_screen_name',
'powerkit_connect_twitter_app_oauth_token',
'powerkit_connect_twitter_app_oauth_token_secret',
);
foreach ( $transients as $key => $transient ) {
if ( get_transient( $transient ) && ! get_option( $transient ) ) {
update_option( $transient, get_transient( $transient ) );
}
}
if ( ! wp_next_scheduled( 'event_access_token_refresh' ) ) {
wp_schedule_event( time(), 'daily', 'event_access_token_refresh' );
}
}
}, 10, 2 );
/**
* Migration to 2.3.0
*
* @param string $current Current version.
* @param string $new New version.
*/
add_action( 'powerkit_plugin_upgrade', function ( $current, $new ) {
if ( version_compare( $current, '2.3.0', '<' ) ) {
if ( 'before' === get_option( 'powerkit_toc_display', 'none' ) ) {
update_option( 'powerkit_toc_enable_automatically', true );
}
if ( 'after' === get_option( 'powerkit_toc_display', 'none' ) ) {
update_option( 'powerkit_toc_enable_automatically', true );
}
}
}, 10, 2 );
/**
* Migration to 2.6.2
*
* @param string $current Current version.
* @param string $new New version.
*/
add_action( 'powerkit_plugin_upgrade', function ( $current, $new ) {
if ( version_compare( $current, '2.6.2', '<' ) && get_option( 'powerkit_db_version' ) ) {
update_option( 'powerkit_enabled_headers_footers', 1 );
}
}, 10, 2 );
@@ -0,0 +1,64 @@
<?php
/**
* Module admin carcase
*
* @package Powerkit
* @subpackage Core
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Module admin class.
*/
class Powerkit_Module_Admin {
/**
* The module slug.
*
* @var string $slug The module slug.
*/
public $slug = null;
/**
* __construct
*
* This function will initialize the initialize
*
* @param string $slug The module slug.
*/
public function __construct( $slug = null ) {
// Init slug of module.
$this->slug = $slug;
// Initialize.
$this->initialize();
// Actions.
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
}
/**
* Initialize
*
* This function will initialize the module
*/
public function initialize() {
/* do nothing */
}
/**
* Load the required dependencies for this module.
*
* @param string $page Current page.
*/
public function admin_enqueue_scripts( $page ) {
/* do nothing */
}
}
@@ -0,0 +1,71 @@
<?php
/**
* Module public carcase
*
* @package Powerkit
* @subpackage Core
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Module public class.
*/
class Powerkit_Module_Public {
/**
* The module slug.
*
* @var string $slug The module slug.
*/
public $slug = null;
/**
* __construct
*
* This function will initialize the initialize
*
* @param string $slug The module slug.
*/
public function __construct( $slug = null ) {
// Init slug of module.
$this->slug = $slug;
// Initialize.
$this->initialize();
// Actions.
add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
}
/**
* Initialize
*
* This function will initialize the module
*/
public function initialize() {
/* do nothing */
}
/**
* Load the required dependencies for this module.
*/
public function wp_enqueue_scripts() {
/* do nothing */
}
/**
* Load the required dependencies for this module in block editr.
*/
public function enqueue_block_editor_assets() {
/* do nothing */
}
}
@@ -0,0 +1,149 @@
<?php
/**
* Module carcase
*
* @package Powerkit
* @subpackage Core
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Module main class.
*/
class Powerkit_Module {
/**
* The module name.
*
* @var string $name The module name.
*/
public $name = null;
/**
* The module description.
*
* @var string $desc The module description.
*/
public $desc = null;
/**
* The module slug.
*
* @var string $slug The module slug.
*/
public $slug = null; // Required.
/**
* The module category.
*
* @var string $category The module category.
*/
public $category = 'basic';
/**
* The module priority.
*
* @var string $priority The module priority.
*/
public $priority = 9999;
/**
* The module type.
*
* @var string $type The module type.
*/
public $type = 'default';
/**
* The module public side of the site.
*
* @var string $category The module public side of the site.
*/
public $public = true;
/**
* The module enabled.
*
* @var string $enabled The module enabled.
*/
public $enabled = true;
/**
* The module badge.
*
* @var string $badge The module badge.
*/
public $badge = null;
/**
* The module load extensions.
*
* @var string $load_extensions The module load extensions.
*/
public $load_extensions = array();
/**
* The module actions links.
*
* @var string $links The module actions links.
*/
public $links = array();
/**
* __construct
*
* This function will initialize the initialize
*/
public function __construct() {
// Initialize.
$this->register();
// Register module info.
powerkit_register_module_info( array(
'name' => $this->name,
'desc' => $this->desc,
'slug' => $this->slug,
'type' => $this->type,
'category' => $this->category,
'priority' => $this->priority,
'public' => $this->public,
'enabled' => $this->enabled,
'badge' => $this->badge,
'load_extensions' => $this->load_extensions,
'links' => $this->links,
) );
// Check enabled module.
if ( ! powerkit_module_enabled( $this->slug ) ) {
return false;
}
// Define the functionality of the module.
$this->initialize();
}
/**
* Register
*
* This function will register the module
*/
public function register() {
/* do nothing */
}
/**
* Initialize
*
* This function will initialize the module
*/
public function initialize() {
/* do nothing */
}
}
@@ -0,0 +1,370 @@
<?php
/**
* The file that defines the core plugin class
*
* A class definition that includes attributes and functions used across both the
* public-facing side of the site and the admin area.
*
* @package Powerkit
* @subpackage Core
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! class_exists( 'Powerkit' ) ) {
/**
* Main Core Class
*/
class Powerkit {
/**
* The plugin version number.
*
* @var string $data The plugin version number.
*/
public $version;
/**
* The plugin data array.
*
* @var array $data The plugin data array.
*/
public $data = array();
/**
* The plugin settings array.
*
* @var array $settings The plugin data array.
*/
public $settings = array();
/**
* INIT (global theme queue)
*/
public function init() {
if ( ! function_exists( 'get_plugin_data' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
// Get plugin data.
$plugin_data = get_plugin_data( POWERKIT_PATH . '/powerkit.php' );
// Vars.
$this->version = $plugin_data['Version'];
// Settings.
$this->settings = array(
'name' => esc_html__( 'Powerkit', 'powerkit' ),
'version' => $plugin_data['Version'],
'documentation' => $plugin_data['AuthorURI'] . '/documentation/powerkit',
);
// Constants.
$this->define( 'POWERKIT', true );
$this->define( 'POWERKIT_VERSION', $plugin_data['Version'] );
// Include core.
require_once POWERKIT_PATH . 'core/core-powerkit-api.php';
require_once POWERKIT_PATH . 'core/core-powerkit-functions.php';
require_once POWERKIT_PATH . 'core/core-powerkit-helpers.php';
require_once POWERKIT_PATH . 'core/core-powerkit-post-meta.php';
// Include core classes.
require_once POWERKIT_PATH . 'core/class-powerkit-module.php';
require_once POWERKIT_PATH . 'core/class-powerkit-module-admin.php';
require_once POWERKIT_PATH . 'core/class-powerkit-module-public.php';
require_once POWERKIT_PATH . 'core/class-powerkit-deprecated.php';
// Include admin classes.
require_once POWERKIT_PATH . 'admin/class-admin-powerkit-manager.php';
// Include modules.
powerkit_load_files( 'modules' );
// Include extensions.
powerkit_load_files( 'extensions' );
// Actions.
add_action( 'powerkit_plugin_activation', array( $this, 'activation' ) );
add_action( 'plugins_loaded', array( $this, 'check_version' ) );
add_action( 'amp_post_template_css', array( $this, 'amp_enqueue_styles' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ), 5 );
add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 5 );
add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );
add_filter( 'style_loader_tag', array( $this, 'style_loader_tag' ), 10, 2 );
add_filter( 'wp_kses_allowed_html', array( $this, 'wp_kses_allowed_html' ), 10, 2 );
}
/**
* This function will safely define a constant
*
* @param string $name The name.
* @param mixed $value The value.
*/
public function define( $name, $value = true ) {
if ( ! defined( $name ) ) {
define( $name, $value );
}
}
/**
* Returns true if has setting.
*
* @param string $name The name.
*/
public function has_setting( $name ) {
return isset( $this->settings[ $name ] );
}
/**
* Returns a setting.
*
* @param string $name The name.
*/
public function get_setting( $name ) {
return isset( $this->settings[ $name ] ) ? $this->settings[ $name ] : null;
}
/**
* Updates a setting.
*
* @param string $name The name.
* @param mixed $value The value.
*/
public function update_setting( $name, $value ) {
$this->settings[ $name ] = $value;
return true;
}
/**
* Returns data.
*
* @param string $name The name.
*/
public function get_data( $name ) {
return isset( $this->data[ $name ] ) ? $this->data[ $name ] : null;
}
/**
* Sets data.
*
* @param string $name The name.
* @param mixed $value The value.
*/
public function set_data( $name, $value ) {
$this->data[ $name ] = $value;
}
/**
* Hook activation
*/
public function activation() {
if ( get_option( 'powerkit_db_version' ) ) {
return;
}
update_option( 'powerkit_db_version', powerkit_raw_setting( 'version' ), true );
}
/**
* Check current version
*/
public function check_version() {
// Version Data.
$new = powerkit_raw_setting( 'version' );
// Get db version.
$current = get_option( 'powerkit_db_version', $new );
// If versions don't match.
if ( ! empty( $current ) && ! empty( $new ) && $current !== $new ) {
/**
* If different versions call a special hook.
*
* @param string $current Current version.
* @param string $new New version.
*/
do_action( 'powerkit_plugin_upgrade', $current, $new );
update_option( 'powerkit_db_version', $new );
} elseif ( ! empty( $new ) && $current !== $new ) {
update_option( 'powerkit_db_version', $new );
}
}
/**
* AMP stylesheets.
*
* @since 1.0.0
*/
public function amp_enqueue_styles() {
powerkit_amp_style( POWERKIT_PATH . 'assets/css/amp.css' );
}
/**
* This function will register scripts and styles for admin dashboard.
*
* @param string $page Current page.
*/
public function admin_enqueue_scripts( $page ) {
wp_enqueue_style( 'powerkit', POWERKIT_URL . 'assets/css/powerkit.css', array(), powerkit_get_setting( 'version' ) );
}
/**
* This function will register scripts and styles
*/
public function wp_enqueue_scripts() {
// Scripts.
if ( is_user_logged_in() ) {
wp_enqueue_script( 'tippy', POWERKIT_URL . 'assets/js/tippy.all.min.js', array( 'jquery' ), powerkit_get_setting( 'version' ), true );
}
wp_enqueue_script( 'powerkit', POWERKIT_URL . 'assets/js/_scripts.js', array( 'jquery', 'tippy' ), powerkit_get_setting( 'version' ), true );
// Icons.
wp_enqueue_style( 'powerkit-icons', POWERKIT_URL . 'assets/fonts/powerkit-icons.woff', array(), powerkit_get_setting( 'version' ) );
wp_style_add_data( 'powerkit-icons', 'alt', 'alternate' );
// Styles.
wp_enqueue_style( 'powerkit', powerkit_style( POWERKIT_URL . 'assets/css/powerkit.css' ), array(), powerkit_get_setting( 'version' ) );
wp_style_add_data( 'powerkit', 'rtl', 'replace' );
}
/**
* Filters the HTML link tag of an enqueued style.
*
* @param string $tag The link tag for the enqueued style.
* @param string $handle The style's registered handle.
*/
public function style_loader_tag( $tag, $handle ) {
if ( 'powerkit-icons' === $handle ) {
return str_replace( "media='all'", "as='font' type='font/wof' crossorigin", $tag );
}
return $tag;
}
/**
* Sets up theme defaults and registers support for various WordPress features.
*/
public function after_setup_theme() {
// Register custom thumbnail sizes.
add_image_size( 'pk-small', 80, 80, true );
add_image_size( 'pk-thumbnail', 300, 225, true );
// Add editor style.
if ( is_rtl() ) {
add_editor_style( powerkit_style( POWERKIT_URL . 'assets/css/powerkit-rtl.css' ) );
} else {
add_editor_style( powerkit_style( POWERKIT_URL . 'assets/css/powerkit.css' ) );
}
}
/**
* Filters the HTML that is allowed for a given context.
*
* @param array $tags Tags by.
* @param string $context Context name.
*/
public function wp_kses_allowed_html( $tags, $context ) {
if ( 'pk-title' === $context ) {
$tags = array(
'a' => array(
'class' => true,
'href' => true,
'title' => true,
'target' => true,
'rel' => true,
),
'div' => array(
'class' => true,
'id' => true,
'style' => true,
),
'span' => array(
'class' => true,
'id' => true,
'style' => true,
),
'img' => array(
'class' => true,
'id' => true,
'src' => true,
'rel' => true,
'srcset' => true,
'size' => true,
),
'br' => array(),
'b' => array(),
'strong' => array(),
'i' => array(),
'p' => array(
'class' => true,
'id' => true,
'style' => true,
),
'h1' => array(
'class' => true,
'id' => true,
'style' => true,
),
'h2' => array(
'class' => true,
'id' => true,
'style' => true,
),
'h3' => array(
'class' => true,
'id' => true,
'style' => true,
),
'h4' => array(
'class' => true,
'id' => true,
'style' => true,
),
'h5' => array(
'class' => true,
'id' => true,
'style' => true,
),
'h6' => array(
'class' => true,
'id' => true,
'style' => true,
),
);
}
return $tags;
}
}
/**
* The main function responsible for returning the one true powerkit Instance to functions everywhere.
* Use this function like you would a global variable, except without needing to declare the global.
*
* Example: <?php $powerkit = powerkit(); ?>
*/
function powerkit() {
// Globals.
global $powerkit_instance;
// Init.
if ( ! isset( $powerkit_instance ) ) {
$powerkit_instance = new Powerkit();
$powerkit_instance->init();
}
return $powerkit_instance;
}
// Initialize.
powerkit();
}
@@ -0,0 +1,118 @@
<?php
/**
* The api functions for the plugin
*
* @package Powerkit
* @subpackage Core
* @version 1.0.0
* @since 1.0.0
*/
/**
* This function will return true for a non empty array
*
* @param array $array Array.
*/
function powerkit_is_array( $array ) {
return ( is_array( $array ) && ! empty( $array ) );
}
/**
* This function will return true for an empty var (allows 0 as true)
*
* @param mixed $value Value.
*/
function powerkit_is_empty( $value ) {
return ( empty( $value ) && ! is_numeric( $value ) );
}
/**
* Alias of powerkit()->has_setting()
*
* @param string $name The name.
*/
function powerkit_has_setting( $name = '' ) {
return powerkit()->has_setting( $name );
}
/**
* Alias of powerkit()->get_setting()
*
* @param string $name The name.
*/
function powerkit_raw_setting( $name = '' ) {
return powerkit()->get_setting( $name );
}
/**
* Alias of powerkit()->update_setting()
*
* @param string $name The name.
* @param mixed $value The value.
*/
function powerkit_update_setting( $name, $value ) {
return powerkit()->update_setting( $name, $value );
}
/**
* Alias of powerkit()->get_setting()
*
* @param string $name The name.
* @param mixed $value The value.
*/
function powerkit_get_setting( $name, $value = null ) {
// Check settings.
if ( powerkit_has_setting( $name ) ) {
$value = powerkit_raw_setting( $name );
}
// Filter.
$value = apply_filters( "powerkit_settings_{$name}", $value );
return $value;
}
/**
* This function will add a value into the settings array found in the acf object
*
* @param string $name The name.
* @param mixed $value The value.
*/
function powerkit_append_setting( $name, $value ) {
// Vars.
$setting = powerkit_raw_setting( $name );
// Bail ealry if not array.
if ( ! is_array( $setting ) ) {
$setting = array();
}
// Append.
$setting[] = $value;
// Update.
return powerkit_update_setting( $name, $setting );
}
/**
* Returns data.
*
* @param string $name The name.
*/
function powerkit_get_data( $name ) {
return powerkit()->get_data( $name );
}
/**
* Sets data.
*
* @param string $name The name.
* @param mixed $value The value.
*/
function powerkit_set_data( $name, $value ) {
return powerkit()->set_data( $name, $value );
}
@@ -0,0 +1,229 @@
<?php
/**
* The basic functions for the plugin and modules
*
* @package Powerkit
* @subpackage Core
* @version 1.0.0
* @since 1.0.0
*/
/**
* This function include files to the plugin.
*
* @param string $dir Directory where you need to search for files.
*/
function powerkit_load_files( $dir ) {
$path = POWERKIT_PATH . $dir;
// Loop through files.
foreach ( glob( $path . '/*' ) as $file ) {
$basename = basename( $file );
if ( is_file( $file ) ) {
require_once wp_normalize_path( $file );
} elseif ( file_exists( sprintf( '%1$s/%2$s/%2$s.php', $path, $basename ) ) ) {
require_once wp_normalize_path( sprintf( '%1$s/%2$s/%2$s.php', $path, $basename ) );
} elseif ( file_exists( sprintf( '%1$s/%2$s/class-powerkit-%2$s.php', $path, $basename ) ) ) {
require_once wp_normalize_path( sprintf( '%1$s/%2$s/class-powerkit-%2$s.php', $path, $basename ) );
}
}
}
/**
* This function checks if the module is enabled
*
* @param array $info The module info.
*/
function powerkit_register_module_info( $info ) {
$modules = (array) powerkit_get_data( 'modules' );
// Slug of module.
$slug = $info['slug'];
// Check exists slug.
if ( $slug ) {
// Enabled load extensions.
$module_enabled = get_option( 'powerkit_enabled_' . $slug, $info['enabled'] );
if ( $module_enabled && 'default' === $info['type'] && $info['load_extensions'] ) {
foreach ( $info['load_extensions'] as $extension ) {
$modules[ $extension ]['enabled'] = true;
}
}
// Add new info.
if ( isset( $modules[ $slug ] ) ) {
$modules[ $slug ] = array_merge( (array) $info, (array) $modules[ $slug ] );
} else {
$modules[ $slug ] = (array) $info;
}
// Update info.
powerkit_set_data( 'modules', $modules );
}
}
/**
* This function return modules.
*/
function powerkit_get_modules() {
$modules = powerkit_get_data( 'modules' );
// Sort modules.
if ( is_array( $modules ) && $modules ) {
$modules_keys = array_keys( $modules );
foreach ( $modules as $key => $row ) {
$modules_priority[ $key ] = $row['priority'];
$modules_name[ $key ] = $row['name'];
}
array_multisort( $modules_priority, SORT_ASC, $modules_name, SORT_ASC, $modules, $modules_keys );
$modules = array_combine( $modules_keys, $modules );
}
return $modules;
}
/**
* This function return meta info of module
*
* @param string $slug The slug.
* @param string $field The field.
*/
function powerkit_get_module_meta( $slug, $field = false ) {
$modules = (array) powerkit_get_data( 'modules' );
if ( $field ) {
if ( isset( $modules[ $slug ][ $field ] ) ) {
return $modules[ $slug ][ $field ];
}
}
if ( isset( $modules[ $slug ] ) ) {
return $modules[ $slug ];
}
}
/**
* This function return value from сonnect module.
*
* @param string $name The field name of сonnect.
*/
function powerkit_connect( $name ) {
$default = array(
'instagram_app_url' => 'https://api.codesupply.co/instagram-connect.php',
'instagram_app_id' => 'MjU5MzMzMzEwNDI0NzQxOA==',
'instagram_app_fb_client_id' => 'MzA1NDQ5ODgzNjk4NjQ5',
'instagram_app_fb_url' => 'https://api.codesupply.co/facebook-connect.php?business=true',
'instagram_app_type' => '',
'instagram_app_access_token' => '',
'instagram_app_user_id' => '',
'instagram_app_username' => '',
'facebook_app_id' => 'MzA1NDQ5ODgzNjk4NjQ5',
'facebook_app_url' => 'https://api.codesupply.co/facebook-connect.php',
'facebook_app_access_token' => '',
'facebook_app_accounts' => '',
'facebook_share_access_token' => 'MTc5NjYwNzk4Nzc0Mjk2JTdDZmV3YV9LRU9TMHBlbHNwUE9md19qcWxqcVRr',
'twitter_app_url' => 'https://api.codesupply.co/twitter-connect.php',
'twitter_app_consumer_key' => '',
'twitter_app_consumer_secret' => '',
'twitter_app_oauth_token' => '',
'twitter_app_oauth_token_secret' => '',
'twitter_app_user_id' => '',
'twitter_app_screen_name' => '',
'youtube_key' => 'QUl6YVN5QUxlUkNTMkVoWThnY0xndlRiTlU3a3g4cXdsVDNLdU9N',
'telegram_token' => 'NTM1NTAwMjM4OkFBR3dUVDBOMDhoeHFPamxHYVhDVDFGa01mb2c2blRnQ2ZR',
'soundcloud_client_id' => 'OTcyMjBmYjM0YWQwMzRiNWQ0YjU5Yjk2N2ZkMTcxN2U=',
'dribbble_token' => '',
'vimeo_token' => 'ODhiMDU4NjA4YWViMmU2MjdiYjc4MmY2MzNkNjVjNjQ=',
'behance_client_id' => 'R0QxcmhQcUpvaWdaN0xqcFFEVEltMkZjOGdPemkxajQ=',
'twitch_client_id' => 'dmk0MDZ5OWhhNDV5MmRzcmtzcDZvMTd1bWt5NTR3',
'vk_token' => 'ZWRkNjQ1ZGU3ZDQ1OTQwZjllMTMyYTMyNmIxM2MxNWJjNWYxMWNhMzRkY2MzYTc1MGE2MmQxOTI4YjY5MjExZThmNTU0Nzc5ZWU3OTNmMTk2YTJiNw==',
);
$name = str_replace( 'powerkit_connect_', '', $name );
// Set value by slug.
$value = get_option( 'powerkit_connect_' . $name );
// Set default value.
if ( ! $value && key_exists( $name, $default ) ) {
if ( base64_encode( base64_decode( $default[ $name ], true ) ) === $default[ $name ] ) {
$value = base64_decode( $default[ $name ] );
} else {
$value = $default[ $name ];
}
}
return $value;
}
/**
* This function checks if the module is enabled
*
* @param string $slug The module slug.
*/
function powerkit_module_enabled( $slug ) {
$module = powerkit_get_module_meta( $slug );
// Default status.
$status = $module['enabled'];
// Check database.
if ( 'default' === $module['type'] ) {
$enabled = get_option( 'powerkit_enabled_' . $slug, $module['enabled'] );
$status = '0' === $enabled ? false : $enabled;
}
return apply_filters( 'powerkit_module_enabled', $status, $slug );
}
/**
* This function return unique slug name to refer to this menu by.
*
* @param string $slug The module slug.
*/
function powerkit_get_page_slug( $slug ) {
return sprintf( 'powerkit_%s', $slug );
}
/**
* This function return admin page url.
*
* @param string $slug The module slug.
* @param string $type The type page.
*/
function powerkit_get_page_url( $slug, $type = 'general' ) {
switch ( $type ) {
case 'general':
return admin_url( sprintf( 'options-general.php?page=%s', powerkit_get_page_slug( $slug ) ) );
case 'writing':
return admin_url( sprintf( 'options-writing.php?page=%s', powerkit_get_page_slug( $slug ) ) );
case 'reading':
return admin_url( sprintf( 'options-reading.php?page=%s', powerkit_get_page_slug( $slug ) ) );
case 'discussion':
return admin_url( sprintf( 'options-reading.php?page=%s', powerkit_get_page_slug( $slug ) ) );
case 'media':
return admin_url( sprintf( 'options-media.php?page=%s', powerkit_get_page_slug( $slug ) ) );
case 'permalink':
return admin_url( sprintf( 'options-permalink.php?page=%s', powerkit_get_page_slug( $slug ) ) );
case 'themes':
return admin_url( sprintf( 'themes.php?page=%s', powerkit_get_page_slug( $slug ) ) );
case 'admin':
return admin_url( sprintf( 'admin.php?page=%s', powerkit_get_page_slug( $slug ) ) );
default:
return admin_url( sprintf( '%s?page=%s', $type, powerkit_get_page_slug( $slug ) ) );
}
}
@@ -0,0 +1,865 @@
<?php
/**
* The basic helpers functions
*
* @package Powerkit
* @subpackage Core
* @version 1.0.0
* @since 1.0.0
*/
/**
* Output error message.
*
* @param string $message The error message.
*/
function powerkit_alert_warning( $message ) {
if ( current_user_can( 'editor' ) || current_user_can( 'administrator' ) ) {
?>
<p class="pk-alert pk-alert-warning" role="alert">
<object>
<?php call_user_func( 'printf', '%s', $message ); ?>
</object>
<?php esc_html_e( ' Dont worry, this error is visible to site admins only, and your site visitors wont see it.', 'powerkit' ); ?>
</p>
<?php
}
}
/**
* Processing path of style.
*
* @param string $path URL to the stylesheet.
*/
function powerkit_style( $path ) {
// Check RTL.
if ( is_rtl() ) {
return $path;
}
// Check Dev.
$dev = POWERKIT_PATH . 'assets/css/powerkit-dev.css';
if ( file_exists( $dev ) ) {
return str_replace( '.css', '-dev.css', $path );
}
return $path;
}
/**
* Generate AMP style.
*
* @param string $path Path to the stylesheet.
*/
function powerkit_amp_style( $path ) {
if ( file_exists( $path ) ) {
$output = call_user_func( 'file_get_contents', $path );
call_user_func( 'printf', '%s', $output );
}
}
/**
* Check post views module.
*
* @return string Type.
*/
function powerkit_post_views_enabled() {
// Post Views Counter.
if ( class_exists( 'Post_Views_Counter' ) ) {
return 'post_views';
}
// Powerkit Post Views.
if ( powerkit_module_enabled( 'post_views' ) ) {
return 'pk_post_views';
}
}
/**
* Process shortcode atts.
*
* @param array $atts Attributes in shortcode tag.
*/
function powerkit_shortcode_atts( $atts ) {
if ( is_array( $atts ) ) {
foreach ( $atts as $name => $val ) {
if ( is_string( $val ) && 'true' === $val ) {
$atts[ $name ] = true;
}
if ( is_string( $val ) && 'false' === $val ) {
$atts[ $name ] = false;
}
}
}
return $atts;
}
/**
* Retrieves a post meta field for the given post ID.
*
* @param int $post_id Post ID.
* @param string $key Optional. The meta key to retrieve. By default, returns
* data for all keys. Default empty.
* @param bool $single Optional. If true, returns only the first value for the specified meta key.
* This parameter has no effect if $key is not specified. Default false.
* @param mixed $default Default value.
* @return mixed Will be an array if $single is false. Will be value of the meta
* field if $single is true.
*/
function powerkit_get_post_metadata( $post_id, $key = '', $single = false, $default = null ) {
if ( ! metadata_exists( 'post', $post_id, $key ) && $default ) {
return $default;
}
return get_metadata( 'post', $post_id, $key, $single );
}
/**
* Get locale in uniform format.
*/
function powerkit_get_locale() {
$locale = get_locale();
if ( preg_match( '#^[a-z]{2}\-[A-Z]{2}$#', $locale ) ) {
$locale = str_replace( '-', '_', $locale );
} elseif ( preg_match( '#^[a-z]{2}$#', $locale ) ) {
if ( function_exists( 'mb_strtoupper' ) ) {
$locale .= '_' . mb_strtoupper( $locale, 'UTF-8' );
} else {
$locale .= '_' . mb_strtoupper( $locale );
}
}
if ( empty( $locale ) ) {
$locale = 'en_US';
}
return apply_filters( 'powerkit_locale', $locale );
}
/**
* Get rounded number.
*
* @param int $number Input number.
* @param int $min_value Minimum value to round number.
* @param int $decimal How may decimals shall be in the rounded number.
*/
function powerkit_get_round_number( $number, $min_value = 1000, $decimal = 1 ) {
if ( $number < $min_value ) {
return number_format_i18n( $number );
}
$alphabets = array(
1000000000 => esc_html__( 'B', 'powerkit' ),
1000000 => esc_html__( 'M', 'powerkit' ),
1000 => esc_html__( 'K', 'powerkit' ),
);
foreach ( $alphabets as $key => $value ) {
if ( $number >= $key ) {
return number_format_i18n( round( $number / $key, $decimal ), $decimal ) . $value;
}
}
}
/**
* Convert dates to readable format
*
* @param string $a Time string (timeformat).
* @return string Formatted time.
*/
function powerkit_relative_time( $a ) {
// Get current timestampt.
$b = strtotime( 'now' );
// Get timestamp when tweet created.
$c = strtotime( $a );
// Get difference.
$d = $b - $c;
// Calculate different time values.
$minute = 60;
$hour = $minute * 60;
$day = $hour * 24;
$week = $day * 7;
if ( is_numeric( $d ) && $d > 0 ) :
// If less then 3 seconds.
if ( $d < 3 ) {
return esc_html__( 'right now', 'powerkit' );
}
// If less then minute.
if ( $d < $minute ) {
return floor( $d ) . esc_html__( ' seconds ago', 'powerkit' );
}
// If less then 2 minutes.
if ( $d < $minute * 2 ) {
return esc_html__( 'about 1 minute ago', 'powerkit' );
}
// If less then hour.
if ( $d < $hour ) {
return floor( $d / $minute ) . esc_html__( ' minutes ago', 'powerkit' );
}
// If less then 2 hours.
if ( $d < $hour * 2 ) {
return esc_html__( 'about 1 hour ago', 'powerkit' );
}
// If less then day.
if ( $d < $day ) {
return floor( $d / $hour ) . esc_html__( ' hours ago', 'powerkit' );
}
// If more then day, but less then 2 days.
if ( $d > $day && $d < $day * 2 ) {
return esc_html__( 'yesterday', 'powerkit' );
}
// If less then year.
if ( $d < $day * 365 ) {
return floor( $d / $day ) . esc_html__( ' days ago', 'powerkit' );
}
// else return more than a year.
return esc_html__( 'over a year ago', 'powerkit' );
endif;
}
/**
* Truncates string with specified length
*
* @param string $string Text string.
* @param int $length Letters length.
* @param string $etc End truncate.
* @param bool $break_words Break words or not.
* @return string
*/
function powerkit_str_truncate( $string, $length = 80, $etc = '&hellip;', $break_words = false ) {
if ( 0 === $length ) {
return '';
}
if ( function_exists( 'mb_strlen' ) ) {
// MultiBite string functions.
if ( mb_strlen( $string ) > $length ) {
$length -= min( $length, mb_strlen( $etc ) );
if ( ! $break_words ) {
$string = preg_replace( '/\s+?(\S+)?$/', '', mb_substr( $string, 0, $length + 1 ) );
}
return mb_substr( $string, 0, $length ) . $etc;
}
} else {
// Default string functions.
if ( strlen( $string ) > $length ) {
$length -= min( $length, strlen( $etc ) );
if ( ! $break_words ) {
$string = preg_replace( '/\s+?(\S+)?$/', '', substr( $string, 0, $length + 1 ) );
}
return substr( $string, 0, $length ) . $etc;
}
}
return $string;
}
/**
* Set number to Short Form
*
* @param int $n The number.
* @param int $decimal The decimal.
*/
function powerkit_abridged_number( $n, $decimal = 1 ) {
// First strip any formatting.
$n = (float) str_replace( ',', '', $n );
// Is this a number?
if ( ! is_numeric( $n ) ) {
return false;
}
// Return current count.
if ( $n < 1000 ) {
return number_format_i18n( $n );
}
// Add suffix.
$suffix = array(
1000000000 => esc_html__( 'B', 'powerkit' ), // Billion.
1000000 => esc_html__( 'M', 'powerkit' ), // Million.
1000 => esc_html__( 'K', 'powerkit' ), // Thousand.
);
foreach ( $suffix as $k => $v ) {
if ( $n >= $k ) {
return number_format_i18n( $n / $k, $decimal ) . $v;
}
}
}
/**
* Time ago
*
* @param string $time The time.
* @return string
*/
function powerkit_timing_ago( $time ) {
$periods = array( esc_html__( 'second', 'powerkit' ), esc_html__( 'minute', 'powerkit' ), esc_html__( 'hour', 'powerkit' ), esc_html__( 'day', 'powerkit' ), esc_html__( 'week', 'powerkit' ), esc_html__( 'month', 'powerkit' ), esc_html__( 'year', 'powerkit' ), esc_html__( 'decade', 'powerkit' ) );
$lengths = array( '60', '60', '24', '7', '4.35', '12', '10' );
$now = time();
$difference = $now - $time;
$tense = esc_html__( 'ago', 'powerkit' );
$lengths_count = count( $lengths );
for ( $j = 0; $difference >= $lengths[ $j ] && $j < $lengths_count - 1; $j++ ) {
$difference /= $lengths[ $j ];
}
$difference = round( $difference );
if ( 1 !== $difference ) {
$periods[ $j ] .= 's';
}
return "$difference $periods[$j] {$tense} ";
}
/**
* Encode data
*
* @param mixed $content The content.
* @param string $secret_key The key.
* @return string
*/
function powerkit_encode_data( $content, $secret_key = 'powerkit' ) {
$content = wp_json_encode( $content );
return base64_encode( $content );
}
/**
* Decode data
*
* @param string $content The content.
* @param string $secret_key The key.
* @return string
*/
function powerkit_decode_data( $content, $secret_key = 'powerkit' ) {
$content = base64_decode( $content );
return json_decode( $content );
}
/**
* Encrypt data
*
* @param mixed $content The content.
* @param string $secret_key The key.
* @return string
*/
function powerkit_encrypt_data( $content, $secret_key = 'powerkit' ) {
$content = maybe_serialize( $content );
if ( function_exists( 'openssl_encrypt' ) && function_exists( 'hash' ) ) {
$encrypt_method = 'AES-256-CBC';
$key = hash( 'sha256', $secret_key );
$iv = substr( hash( 'sha256', 'secret key' ), 0, 16 );
return base64_encode( openssl_encrypt( $content, $encrypt_method, $key, 0, $iv ) );
} else {
return base64_encode( $content );
}
}
/**
* Decrypt data
*
* @param string $content The content.
* @param string $secret_key The key.
* @return string
*/
function powerkit_decrypt_data( $content, $secret_key = 'powerkit' ) {
if ( function_exists( 'openssl_encrypt' ) && function_exists( 'hash' ) ) {
$encrypt_method = 'AES-256-CBC';
$key = hash( 'sha256', $secret_key );
$iv = substr( hash( 'sha256', 'secret key' ), 0, 16 );
$content = openssl_decrypt( base64_decode( $content ), $encrypt_method, $key, 0, $iv );
} else {
$content = base64_decode( $content );
}
$content = maybe_unserialize( $content );
return $content;
}
/**
* Generate uuid hash
*
* @param string $name The name.
* @param string $action The action.
*/
function powerkit_uuid_hash( $name = '_wpnonce', $action = -1 ) {
$user = wp_get_current_user();
$uid = (int) $user->ID;
if ( ! $uid ) {
$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
}
$token = wp_get_session_token();
$i = wp_nonce_tick();
$hash = substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
if ( ! isset( ${'_REQUEST'}[ $name ] ) ) {
${'_REQUEST'}[ $name ] = $hash;
}
}
/**
* Get the user uuid
*
* @return string
*/
function powerkit_get_user_uuid() {
if ( getenv( 'HTTP_CLIENT_IP' ) ) {
return getenv( 'HTTP_CLIENT_IP' );
} elseif ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) {
return getenv( 'HTTP_X_FORWARDED_FOR' );
} elseif ( getenv( 'HTTP_X_FORWARDED' ) ) {
return getenv( 'HTTP_X_FORWARDED' );
} elseif ( getenv( 'HTTP_FORWARDED_FOR' ) ) {
return getenv( 'HTTP_FORWARDED_FOR' );
} elseif ( getenv( 'HTTP_FORWARDED' ) ) {
return getenv( 'HTTP_FORWARDED' );
} elseif ( getenv( 'REMOTE_ADDR' ) ) {
return getenv( 'REMOTE_ADDR' );
}
return uniqid( 'x', true );
}
/**
* Convert by title Cyrillic characters to Latin characters
*
* @param string $text The text.
*/
function powerkit_text_with_translit( $text ) {
$gost = array(
'А' => 'A',
'Б' => 'B',
'В' => 'V',
'Г' => 'G',
'Ѓ' => 'G`',
'Ґ' => 'G`',
'Д' => 'D',
'Е' => 'E',
'Ё' => 'YO',
'Є' => 'YE',
'Ж' => 'ZH',
'З' => 'Z',
'Ѕ' => 'Z',
'И' => 'I',
'Й' => 'Y',
'Ј' => 'J',
'І' => 'I',
'Ї' => 'YI',
'К' => 'K',
'Ќ' => 'K',
'Л' => 'L',
'Љ' => 'L',
'М' => 'M',
'Н' => 'N',
'Њ' => 'N',
'О' => 'O',
'П' => 'P',
'Р' => 'R',
'С' => 'S',
'Т' => 'T',
'У' => 'U',
'Ў' => 'U',
'Ф' => 'F',
'Х' => 'H',
'Ц' => 'TS',
'Ч' => 'CH',
'Џ' => 'DH',
'Ш' => 'SH',
'Щ' => 'SHH',
'Ъ' => '``',
'Ы' => 'YI',
'Ь' => '`',
'Э' => 'E`',
'Ю' => 'YU',
'Я' => 'YA',
'а' => 'a',
'б' => 'b',
'в' => 'v',
'г' => 'g',
'ѓ' => 'g',
'ґ' => 'g',
'д' => 'd',
'е' => 'e',
'ё' => 'yo',
'є' => 'ye',
'ж' => 'zh',
'з' => 'z',
'ѕ' => 'z',
'и' => 'i',
'й' => 'y',
'ј' => 'j',
'і' => 'i',
'ї' => 'yi',
'к' => 'k',
'ќ' => 'k',
'л' => 'l',
'љ' => 'l',
'м' => 'm',
'н' => 'n',
'њ' => 'n',
'о' => 'o',
'п' => 'p',
'р' => 'r',
'с' => 's',
'т' => 't',
'у' => 'u',
'ў' => 'u',
'ф' => 'f',
'х' => 'h',
'ц' => 'ts',
'ч' => 'ch',
'џ' => 'dh',
'ш' => 'sh',
'щ' => 'shh',
'ь' => '',
'ы' => 'yi',
'ъ' => "'",
'э' => 'e`',
'ю' => 'yu',
'я' => 'ya',
);
return strtr( $text, $gost );
}
/**
* Check social links exists.
*/
function powerkit_social_links_exists() {
if ( ! powerkit_module_enabled( 'social_links' ) ) {
return;
}
if ( get_option( 'powerkit_social_links_multiple_list' ) ) {
return true;
}
}
/**
* Check mailchimp form exists.
*
* @param string $id The list ID.
*/
function powerkit_mailchimp_form_exists( $id = 'default' ) {
if ( ! powerkit_module_enabled( 'opt_in_forms' ) ) {
return;
}
$token = get_option( 'powerkit_mailchimp_token' );
if ( $token ) {
if ( ! $id || 'default' === $id ) {
$id = get_option( 'powerkit_mailchimp_list' );
}
if ( $id ) {
return true;
}
}
}
/**
* Check share buttons exists.
*
* @param string $location The location.
*/
function powerkit_share_buttons_exists( $location ) {
if ( ! powerkit_module_enabled( 'share_buttons' ) ) {
return;
}
if ( ! get_option( "powerkit_share_buttons_{$location}_display" ) ) {
return;
}
$accounts = get_option( "powerkit_share_buttons_{$location}_multiple_list", array( 'facebook', 'twitter', 'pinterest' ) );
if ( $accounts ) {
return true;
}
}
/**
* Get the available image sizes
*/
function powerkit_get_available_image_sizes() {
$wais = & $GLOBALS['_wp_additional_image_sizes'];
$sizes = array();
$image_sizes = get_intermediate_image_sizes();
if ( is_array( $image_sizes ) && $image_sizes ) {
foreach ( $image_sizes as $size ) {
if ( in_array( $size, array( 'thumbnail', 'medium', 'medium_large', 'large' ), true ) ) {
$sizes[ $size ] = array(
'width' => get_option( "{$size}_size_w" ),
'height' => get_option( "{$size}_size_h" ),
'crop' => (bool) get_option( "{$size}_crop" ),
);
} elseif ( isset( $wais[ $size ] ) ) {
$sizes[ $size ] = array(
'width' => $wais[ $size ]['width'],
'height' => $wais[ $size ]['height'],
'crop' => $wais[ $size ]['crop'],
);
}
// Size registered, but has 0 width and height.
if ( 0 === (int) $sizes[ $size ]['width'] && 0 === (int) $sizes[ $size ]['height'] ) {
unset( $sizes[ $size ] );
}
}
}
return $sizes;
}
/**
* Gets the data of a specific image size.
*
* @param string $size Name of the size.
*/
function powerkit_get_image_size( $size ) {
if ( ! is_string( $size ) ) {
return;
}
$sizes = powerkit_get_available_image_sizes();
return isset( $sizes[ $size ] ) ? $sizes[ $size ] : false;
}
/**
* Get the list available image sizes
*/
function powerkit_get_list_available_image_sizes() {
$intermediate_image_sizes = get_intermediate_image_sizes();
$image_sizes = array();
foreach ( $intermediate_image_sizes as $size ) {
$image_sizes[ $size ] = $size;
$data = powerkit_get_image_size( $size );
if ( isset( $data['width'] ) || isset( $data['height'] ) ) {
$width = '~';
$height = '~';
if ( isset( $data['width'] ) && $data['width'] ) {
$width = $data['width'] . 'px';
}
if ( isset( $data['height'] ) && $data['height'] ) {
$height = $data['height'] . 'px';
}
$image_sizes[ $size ] .= sprintf( ' [%s, %s]', $width, $height );
}
}
$image_sizes = apply_filters( 'powerkit_list_available_image_sizes', $image_sizes );
return $image_sizes;
}
/**
* Get fields array for Button in some PK blocks
*
* @param string $field_prefix Field prefix.
* @param string $section_name Section name.
* @param array $active_callback Active callback.
*/
function powerkit_get_gutenberg_button_fields( $field_prefix = 'button', $section_name = '', $active_callback = array() ) {
$fields = array(
array(
'key' => $field_prefix . 'Style',
'label' => esc_html__( 'Style', 'powerkit' ),
'section' => $section_name,
'type' => 'select',
'default' => '',
'choices' => array(
'' => esc_html__( 'Default', 'powerkit' ),
'outline' => esc_html__( 'Outline', 'powerkit' ),
'squared' => esc_html__( 'Squared', 'powerkit' ),
),
'active_callback' => $active_callback,
),
array(
'key' => $field_prefix . 'Size',
'label' => esc_html__( 'Size', 'powerkit' ),
'section' => $section_name,
'type' => 'select',
'default' => '',
'choices' => array(
'' => esc_html__( 'Default', 'powerkit' ),
'sm' => esc_html__( 'Small', 'powerkit' ),
'lg' => esc_html__( 'Large', 'powerkit' ),
),
'active_callback' => $active_callback,
),
array(
'key' => $field_prefix . 'FullWidth',
'label' => esc_html__( 'Full Width', 'powerkit' ),
'section' => $section_name,
'type' => 'toggle',
'default' => false,
'active_callback' => $active_callback,
),
array(
'key' => $field_prefix . 'ColorBg',
'label' => esc_html__( 'Background Color', 'powerkit' ),
'section' => $section_name,
'type' => 'color',
'default' => '',
'output' => array(
array(
'element' => '$ .wp-block-button a.wp-block-button__link',
'property' => 'background-color',
'suffix' => '!important',
),
),
'active_callback' => $active_callback,
),
array(
'key' => $field_prefix . 'ColorBgHover',
'label' => esc_html__( 'Background Color Hover', 'powerkit' ),
'section' => $section_name,
'type' => 'color',
'default' => '',
'output' => array(
array(
'element' => '$ .wp-block-button a.wp-block-button__link:hover, $ .wp-block-button a.wp-block-button__link:focus',
'property' => 'background-color',
'suffix' => '!important',
),
),
'active_callback' => $active_callback,
),
array(
'key' => $field_prefix . 'ColorText',
'label' => esc_html__( 'Text Color', 'powerkit' ),
'section' => $section_name,
'type' => 'color',
'default' => '',
'output' => array(
array(
'element' => '$ .wp-block-button__link',
'property' => 'color',
'suffix' => '!important',
),
),
'active_callback' => $active_callback,
),
array(
'key' => $field_prefix . 'ColorTextHover',
'label' => esc_html__( 'Text Color Hover', 'powerkit' ),
'section' => $section_name,
'type' => 'color',
'default' => '',
'output' => array(
array(
'element' => '$ .wp-block-button a.wp-block-button__link:hover, $ .wp-block-button a.wp-block-button__link:focus',
'property' => 'color',
'suffix' => '!important',
),
),
'active_callback' => $active_callback,
),
);
return $fields;
}
/**
* Print core/button in some PK blocks
*
* @param string $text Text of button.
* @param string $url Url of button.
* @param string $target Target.
* @param string $field_prefix Field prefix.
* @param array $attributes Attributes.
*/
function powerkit_print_gutenberg_blocks_button( $text, $url, $target = '', $field_prefix = 'button', $attributes = array() ) {
$class_name = 'wp-block-button';
$link_class_name = 'wp-block-button__link';
// Style.
if ( isset( $attributes[ $field_prefix . 'Style' ] ) && $attributes[ $field_prefix . 'Style' ] ) {
$class_name .= ' is-style-' . $attributes[ $field_prefix . 'Style' ];
}
// Size.
if ( isset( $attributes[ $field_prefix . 'Size' ] ) && $attributes[ $field_prefix . 'Size' ] ) {
$class_name .= ' is-pk-button-size-' . $attributes[ $field_prefix . 'Size' ];
}
// FullWidth.
if ( isset( $attributes[ $field_prefix . 'FullWidth' ] ) && $attributes[ $field_prefix . 'FullWidth' ] ) {
$class_name .= ' is-pk-button-full-width';
}
// Color.
if ( isset( $attributes[ $field_prefix . 'ColorText' ] ) && $attributes[ $field_prefix . 'ColorText' ] ) {
$link_class_name .= ' has-text-color';
}
// Background.
if ( isset( $attributes[ $field_prefix . 'ColorBg' ] ) && $attributes[ $field_prefix . 'ColorBg' ] ) {
$link_class_name .= ' has-background';
}
?>
<div class="<?php echo esc_attr( $class_name ); ?>">
<a class="<?php echo esc_attr( $link_class_name ); ?>" href="<?php echo esc_url( $url ); ?>" target="<?php echo esc_attr( $target ); ?>">
<?php echo wp_kses_post( $text ); ?>
</a>
</div>
<?php
}
@@ -0,0 +1,354 @@
<?php
/**
* Post Meta Helper Functions
*
* These helper functions return post meta.
*
* @package Powerkit
* @subpackage Core
* @version 1.0.0
* @since 1.0.0
*/
if ( ! function_exists( 'powerkit_allowed_post_meta' ) ) {
/**
* Allowed Post Meta
*
* @param bool $compact If compact version shall be displayed.
* @param array $exclude Exclude list.
*/
function powerkit_allowed_post_meta( $compact = false, $exclude = array() ) {
$allowed = array(
'category' => esc_html__( 'Category', 'powerkit' ),
'date' => esc_html__( 'Date', 'powerkit' ),
'author' => esc_html__( 'Author', 'powerkit' ),
'comments' => esc_html__( 'Comments count', 'powerkit' ),
);
if ( powerkit_post_views_enabled() ) {
$allowed['views'] = esc_html__( 'Views', 'powerkit' );
}
if ( powerkit_module_enabled( 'reading_time' ) ) {
$allowed['reading_time'] = esc_html__( 'Reading time', 'powerkit' );
}
$allowed = apply_filters( 'powerkit_allowed_post_meta', $allowed );
// Computes the difference of arrays.
$allowed = array_diff_key( $allowed, array_flip( (array) $exclude ) );
// If compact.
if ( $compact ) {
return array_keys( $allowed );
}
return $allowed;
}
}
if ( ! function_exists( 'powerkit_block_post_meta' ) ) {
/**
* Block Post Meta
*
* A wrapper function that returns all post meta types either
* in an ordered list <ul> or as a single element <span>.
*
* @param array $settings Settings of block.
* @param mixed $meta Contains post meta types.
* @param bool $echo Echo or return.
* @param bool $compact If meta compact.
*/
function powerkit_block_post_meta( $settings, $meta, $echo = true, $compact = false ) {
$allowed = array();
if ( isset( $settings['showMetaCategory'] ) && $settings['showMetaCategory'] ) {
$allowed[] = 'category';
}
if ( isset( $settings['showMetaAuthor'] ) && $settings['showMetaAuthor'] ) {
$allowed[] = 'author';
}
if ( isset( $settings['showMetaDate'] ) && $settings['showMetaDate'] ) {
$allowed[] = 'date';
}
if ( isset( $settings['showMetaComments'] ) && $settings['showMetaComments'] ) {
$allowed[] = 'comments';
}
if ( isset( $settings['showMetaViews'] ) && $settings['showMetaViews'] ) {
$allowed[] = 'views';
}
if ( isset( $settings['showMetaReadingTime'] ) && $settings['showMetaReadingTime'] ) {
$allowed[] = 'reading_time';
}
if ( isset( $settings['showMetaShares'] ) && $settings['showMetaShares'] ) {
$allowed[] = 'shares';
}
if ( isset( $settings['metaCompact'] ) && $settings['metaCompact'] ) {
$compact = true;
}
if ( ! $allowed ) {
return;
}
powerkit_get_post_meta( $meta, $compact, $echo, $allowed );
}
}
if ( ! function_exists( 'powerkit_get_post_meta' ) ) {
/**
* Post Meta
*
* A wrapper function that returns all post meta types either
* in an ordered list <ul> or as a single element <span>.
*
* @param mixed $meta Contains post meta types.
* @param bool $compact If compact version shall be displayed.
* @param bool $echo Echo or return.
* @param array $allowed Allowed meta types.
*/
function powerkit_get_post_meta( $meta, $compact = false, $echo = true, $allowed = array() ) {
$func_handler = apply_filters( 'powerkit_get_post_meta_handler', false );
if ( $func_handler ) {
return call_user_func( $func_handler, $meta, $compact, $echo, $allowed );
}
// Return if no post meta types provided.
if ( ! $meta ) {
return;
}
// Set default allowed post meta types.
if ( ! $allowed ) {
$allowed = powerkit_allowed_post_meta();
}
if ( is_array( $meta ) ) {
// Intersect provided and allowed meta types.
$meta = array_intersect( $allowed, $meta );
}
$output = null;
if ( $meta && is_array( $meta ) ) {
$output .= '<ul class="pk-post-meta post-meta">';
// Add normal meta types to the list.
foreach ( $meta as $type ) {
$function = "powerkit_get_meta_$type";
if ( function_exists( $function ) ) {
$output .= $function( 'li', $compact );
}
}
$output .= '</ul>';
} else {
if ( in_array( $meta, $allowed, true ) ) {
// Output single meta type.
$function = "powerkit_get_meta_$meta";
if ( function_exists( $function ) ) {
$output .= $function( 'div', $compact );
}
}
}
// If echo is enabled.
if ( $echo ) {
return call_user_func( 'printf', '%s', wp_kses( $output, 'post' ) );
}
return $output;
}
}
if ( ! function_exists( 'powerkit_get_meta_date' ) ) {
/**
* Post Date
*
* @param string $tag Element tag, i.e. div or span.
* @param bool $compact If compact version shall be displayed.
*/
function powerkit_get_meta_date( $tag = 'span', $compact = false ) {
$output = '<' . esc_html( $tag ) . ' class="pk-meta-date meta-date">';
if ( false === $compact ) {
$time_string = get_the_date();
} else {
$time_string = get_the_date( 'd.m.y' );
}
$output .= apply_filters( 'powerkit_post_meta_date_output', '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' );
$output .= '</' . esc_html( $tag ) . '>';
return $output;
}
}
if ( ! function_exists( 'powerkit_get_meta_author' ) ) {
/**
* Post Author
*
* @param string $tag Element tag, i.e. div or span.
* @param bool $compact If compact version shall be displayed.
*/
function powerkit_get_meta_author( $tag = 'span', $compact = false ) {
$authors = array( get_the_author_meta( 'ID' ) );
$output = '<' . esc_html( $tag ) . ' class="pk-meta-author meta-author">';
$output .= sprintf(
'<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
/* translators: %s: author name */
esc_attr( sprintf( __( 'View all posts by %s', 'powerkit' ), get_the_author() ) ),
// Author.
get_the_author()
);
$output .= '</' . esc_html( $tag ) . '>';
return $output;
}
}
if ( ! function_exists( 'powerkit_get_meta_category' ) ) {
/**
* Post Сategory
*
* @param string $tag Element tag, i.e. div or span.
* @param bool $compact If compact version shall be displayed.
* @param int $post_id Post ID.
*/
function powerkit_get_meta_category( $tag = 'span', $compact = false, $post_id = null ) {
if ( ! $post_id ) {
$post_id = get_the_ID();
}
$output = '<' . esc_html( $tag ) . ' class="pk-meta-category meta-category">';
$output .= get_the_category_list( '', '', $post_id );
$output .= '</' . esc_html( $tag ) . '>';
return $output;
}
}
if ( ! function_exists( 'powerkit_get_meta_comments' ) ) {
/**
* Post Comments
*
* @param string $tag Element tag, i.e. div or span.
* @param bool $compact If compact version shall be displayed.
*/
function powerkit_get_meta_comments( $tag = 'span', $compact = false ) {
$output = '';
$output .= '<' . esc_html( $tag ) . ' class="pk-meta-comments meta-comments">';
if ( true === $compact ) {
$output .= '<i class="pk-icon pk-icon-comment"></i>';
ob_start();
comments_popup_link( '0', '1', '%', 'comments-link', '' );
$output .= ob_get_clean();
} else {
ob_start();
comments_popup_link( esc_html__( 'No comments', 'powerkit' ), esc_html__( 'One comment', 'powerkit' ), '% ' . esc_html__( 'comments', 'powerkit' ), 'comments-link', '' );
$output .= ob_get_clean();
}
$output .= '</' . esc_html( $tag ) . '>';
return $output;
}
}
if ( ! function_exists( 'powerkit_get_meta_reading_time' ) ) {
/**
* Post Reading Time
*
* @param string $tag Element tag, i.e. div or span.
* @param bool $compact If compact version shall be displayed.
*/
function powerkit_get_meta_reading_time( $tag = 'span', $compact = false ) {
if ( ! powerkit_module_enabled( 'reading_time' ) ) {
return;
}
$reading_time = powerkit_get_post_reading_time();
$output = '<' . esc_html( $tag ) . ' class="pk-meta-reading-time meta-reading-time">';
if ( true === $compact ) {
$output .= '<i class="pk-icon pk-icon-watch"></i>' . intval( $reading_time ) . ' ' . esc_html( 'min', 'powerkit' );
} else {
/* translators: %s number of minutes */
$output .= esc_html( sprintf( _n( '%s minute read', '%s minute read', $reading_time, 'powerkit' ), $reading_time ) );
}
$output .= '</' . esc_html( $tag ) . '>';
return $output;
}
}
if ( ! function_exists( 'powerkit_get_meta_views' ) ) {
/**
* Post Reading Time
*
* @param string $tag Element tag, i.e. div or span.
* @param bool $compact If compact version shall be displayed.
*/
function powerkit_get_meta_views( $tag = 'span', $compact = false ) {
switch ( powerkit_post_views_enabled() ) {
case 'post_views':
$views = pvc_get_post_views();
break;
case 'pk_post_views':
$views = powerkit_get_post_views( null, false );
break;
default:
return;
}
// Don't display if minimum threshold is not met.
if ( $views < apply_filters( 'powerkit_post_minimum_views', 1 ) ) {
return;
}
$output = '<' . esc_html( $tag ) . ' class="pk-meta-views meta-views">';
$views_rounded = powerkit_get_round_number( $views );
if ( true === $compact ) {
$output .= '<i class="pk-icon pk-icon-eye"></i>' . esc_html( $views_rounded );
} else {
/* translators: %s number of post views */
$output .= esc_html( sprintf( _n( '%s view', '%s views', $views, 'powerkit' ), $views_rounded ) );
}
$output .= '</' . esc_html( $tag ) . '>';
return $output;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,47 @@
( function( $ ) {
'use strict';
$( function() {
/*
* AJAX Reset cache
*/
$( document ).on( 'click dblclick', 'a[href*="action=powerkit_reset_cache"]', function( e ) {
var $this = this;
$.ajax( {
type: 'POST',
url: window.pk_connect.ajax_url + '?action=powerkit_reset_cache',
data: {
page: $( $this ).attr( 'href' ).split( 'page=' ).pop().split( '&' ).shift(),
},
beforeSend: function() {
$( $this ).siblings( '.spinner, .status' ).remove();
$( $this ).after( '<span class="spinner is-active"></span>' );
},
success: function( data ) {
$( $this ).after( '<span class="status dashicons dashicons-yes"></span>' );
},
error: function() {
$( $this ).after( '<span class="status dashicons dashicons-no-alt"></span>' );
},
complete: function() {
$( $this ).siblings( '.spinner' ).remove();
setTimeout( function() {
$( $this ).siblings( '.status' ).fadeOut();
}, 2000 );
}
} );
// Refresh customizer.
if ( $( 'body' ).hasClass( 'wp-customizer' ) ) {
wp.customize.previewer.refresh();
}
return false;
} );
} );
} )( jQuery );
@@ -0,0 +1,159 @@
<?php
/**
* Fonts
*
* @package Powerkit
* @subpackage Extensions
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Fonts extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = 'fonts';
$this->slug = 'fonts';
$this->type = 'extension';
$this->category = 'basic';
$this->public = false;
$this->enabled = false;
}
/**
* Initialize module
*/
public function initialize() {
add_action( 'admin_menu', array( $this, 'register_options_page' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
add_filter( 'powerkit_fonts_choices', array( $this, 'kirki_fonts_choices' ) );
}
/**
* Register admin page
*
* @since 1.0.0
*/
public function register_options_page() {
add_theme_page( esc_html__( 'Fonts', 'powerkit' ), esc_html__( 'Fonts', 'powerkit' ), 'manage_options', powerkit_get_page_slug( $this->slug ), array( $this, 'settings_page' ) );
}
/**
* Build admin page
*
* @since 1.0.0
*/
public function settings_page() {
powerkit_uuid_hash();
// Check wpnonce.
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'] ) ) { // Input var ok; sanitization ok.
return;
}
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'You do not have sufficient rights to view this page.', 'powerkit' ) );
}
?>
<div class="wrap">
<h1 class="wp-heading-inline"><?php esc_html_e( 'Fonts', 'powerkit' ); ?></h1>
<hr class="wp-header-end">
<div class="settings">
<?php $fonts_settings = apply_filters( 'powerkit_fonts_register_settings', array() ); ?>
<?php if ( $fonts_settings ) : ?>
<div class="tabs">
<?php
$first_settings = current( $fonts_settings );
$tab = sanitize_title( isset( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : $first_settings['id'] ); // Input var ok; sanitization ok.
?>
<nav class="nav-tab-wrapper">
<?php
foreach ( $fonts_settings as $item ) {
$class = ( $item['id'] === $tab ) ? 'nav-tab-active' : '';
printf( '<a class="nav-tab %4$s" href="%1$s&tab=%2$s">%3$s</a>',
esc_url( powerkit_get_page_url( $this->slug, 'themes' ) ), esc_attr( $item['id'] ), esc_html( $item['name'] ), esc_attr( $class )
);
}
?>
</nav>
<?php
foreach ( $fonts_settings as $item ) {
if ( $item['id'] === $tab ) {
?>
<div id="tab-<?php echo esc_attr( $item['id'] ); ?>" class="tab-wrap">
<?php
if ( is_callable( $item['function'] ) ) {
call_user_func( $item['function'] );
}
?>
</div>
<?php
}
}
?>
</div>
<?php endif; ?>
</div>
</div>
<?php
}
/**
* Add support wp-custom-fonts in Kirki.
*
* @param array $settings Pre settings.
*/
public function kirki_fonts_choices( $settings = array() ) {
$fonts_list = apply_filters( 'powerkit_fonts_list', array() );
if ( ! $fonts_list ) {
return $settings;
}
$fonts_settings = array(
'fonts' => array(
'google' => array(),
'families' => isset( $fonts_list['families'] ) ? $fonts_list['families'] : null,
'variants' => isset( $fonts_list['variants'] ) ? $fonts_list['variants'] : null,
),
);
$fonts_settings = array_merge( (array) $fonts_settings, (array) $settings );
return $fonts_settings;
}
/**
* Register the stylesheets and JavaScript for the admin area.
*
* @param string $page Current page.
*/
public function admin_enqueue_scripts( $page ) {
if ( 'appearance_page_' . powerkit_get_page_slug( $this->slug ) === $page ) {
wp_enqueue_media();
wp_enqueue_script( 'admin-powerkit-fonts', plugin_dir_url( __FILE__ ) . 'js/admin-powerkit-fonts.js', array( 'jquery' ), powerkit_get_setting( 'version' ), false );
wp_localize_script( 'admin-powerkit-fonts', 'powerkitFonts', array(
'delete' => esc_html__( 'Are you sure you want to delete this font and all the files downloaded from it?', 'powerkit' ),
'title' => esc_html__( 'Select or Upload Font', 'powerkit' ),
'button' => esc_html__( 'Use This File', 'powerkit' ),
) );
}
}
}
new Powerkit_Fonts();
}
@@ -0,0 +1,101 @@
( function( $ ) {
'use strict';
$( function() {
/* Set all variables to be used in scope */
var powerkitFontsMediaFrame;
/* Add Font Link */
$( document ).on( 'click', '.upload-font-container .upload-font-link', function( event ) {
event.preventDefault();
var parentContainer = $( this ).parents( '.upload-font-container' );
// Options.
var options = {
title: powerkitFonts.title,
button: {
text: powerkitFonts.button,
},
library: {
type: parentContainer.data( 'type' )
},
multiple: false
};
powerkitFontsMediaFrame = wp.media( options );
// When an image is selected in the media frame...
powerkitFontsMediaFrame.on( 'select', function() {
// Get media attachment details from the frame state.
var attachment = powerkitFontsMediaFrame.state().get( 'selection' ).first().toJSON();
parentContainer.find( '.filename' ).val( attachment.filename ).change();
parentContainer.find( '.uploaded-font-id' ).val( attachment.id ).change();
parentContainer.find( '.upload-font-link' ).addClass( 'hidden' );
parentContainer.find( '.delete-font-link' ).removeClass( 'hidden' );
powerkitFontsMediaFrame.close();
} );
powerkitFontsMediaFrame.open();
} );
/* Delete Font Link */
$( document ).on( 'click', '.upload-font-container .delete-font-link', function( event ) {
event.preventDefault();
var parentContainer = $( this ).parents( '.upload-font-container' );
parentContainer.find( '.filename' ).val( '' ).change();
parentContainer.find( '.uploaded-font-id' ).val( '' ).change();
parentContainer.find( '.upload-font-link' ).removeClass( 'hidden' );
parentContainer.find( '.delete-font-link' ).addClass( 'hidden' );
} );
/* Delete alert */
$( document ).on( 'click', '.powerkit-fonts-delete', function( event ) {
return confirm( powerkitFonts.delete ) ? true : false;
} );
/* View code */
$( document ).find( '.powerkit-fonts-view-code' ).each( function( index, el ) {
var obj = $( el ).closest( 'tr' ).next();
// Reset td padding.
$( obj ).find( 'td' ).css( 'padding', 0 );
// Show tr.
$( obj ).removeClass( 'hidden' );
// Set height textarea.
$( obj ).find( 'textarea' ).css( 'min-height', '110px' ).height( 110 );
} );
/* View code slide toggle */
$( document ).on( 'click', '.powerkit-fonts-view-code', function( event ) {
$( this ).closest( 'tr' ).prevAll().find( '.template-box' ).slideUp();
$( this ).closest( 'tr' ).next().nextAll().find( '.template-box' ).slideUp();
$( this ).closest( 'tr' ).next().find( '.template-box' ).slideToggle();
return false;
} );
/* View code outside */
$( document ).on( 'click', function( event ) {
if ( !$( event.target ).closest( '.wp-list-table' ).length ) {
$( '.template-box' ).slideUp();
}
} );
} );
} )( jQuery );
@@ -0,0 +1,309 @@
<?php
/**
* Gallery
*
* @package Powerkit
* @subpackage Extensions
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Gallery extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = 'gallery';
$this->slug = 'gallery';
$this->type = 'extension';
$this->category = 'basic';
$this->public = false;
$this->enabled = false;
}
/**
* Initialize module
*/
public function initialize() {
add_action( 'admin_init', array( $this, 'gallery_init' ) );
add_action( 'post_gallery', array( $this, 'change_post_gallery' ), 10, 3 );
add_filter( 'jetpack_gallery_types', array( $this, 'jetpack_gallery_types' ) );
// Force Jetpack compatibility with our galleries.
add_filter( 'jp_carousel_force_enable', '__return_true' );
}
/**
* Gallery Shortcode Function
*
* @param string $output The current output.
* @param array $attr Attributes from the gallery shortcode.
* @param int $instance Numeric ID of the gallery shortcode instance.
*/
public function change_post_gallery( $output, $attr, $instance ) {
// Make sure we're overwriting only galleries with either layout or type attributes.
if ( ! ( isset( $attr['layout'] ) || isset( $attr['type'] ) ) ) {
return;
}
// Support for the deprecated layout attribute.
if ( isset( $attr['layout'] ) ) {
if ( 'grid' === $attr['layout'] ) {
$attr['type'] = 'default';
} else {
$attr['type'] = $attr['layout'];
}
}
if ( ! isset( $attr['type'] ) ) {
return;
}
// Return if type is neither justified nor slider.
$gallery_types = apply_filters( 'powerkit_gallery_types', array() );
if ( ! array_key_exists( $attr['type'], (array) $gallery_types ) ) {
return '';
}
global $post;
$atts = shortcode_atts(
array(
'order' => 'ASC',
'orderby' => 'menu_order ID',
'id' => $post ? $post->ID : 0,
'itemtag' => 'figure',
'icontag' => 'div',
'captiontag' => 'figcaption',
'columns' => 3,
'type' => 'default',
'size' => 'thumbnail',
'include' => '',
'exclude' => '',
'link' => '',
), $attr, 'gallery'
);
$settings = array(
'custom_class' => '',
'custom_attrs' => '',
);
$settings = apply_filters( 'powerkit_gallery_settings', $settings, $attr );
$id = intval( $atts['id'] );
if ( ! empty( $atts['include'] ) ) {
$_attachments = get_posts(
array(
'include' => $atts['include'],
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => $atts['order'],
'orderby' => $atts['orderby'],
)
);
$attachments = array();
foreach ( $_attachments as $key => $val ) {
$attachments[ $val->ID ] = $_attachments[ $key ];
}
} elseif ( ! empty( $atts['exclude'] ) ) {
$attachments = get_children(
array(
'post_parent' => $id,
'exclude' => $atts['exclude'],
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => $atts['order'],
'orderby' => $atts['orderby'],
)
);
} else {
$attachments = get_children(
array(
'post_parent' => $id,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => $atts['order'],
'orderby' => $atts['orderby'],
)
);
}
if ( empty( $attachments ) ) {
return '';
}
if ( is_feed() ) {
$output = "\n";
foreach ( $attachments as $att_id => $attachment ) {
$output .= wp_get_attachment_link( $att_id, $atts['size'], true ) . "\n";
}
return $output;
}
$itemtag = tag_escape( $atts['itemtag'] );
$captiontag = tag_escape( $atts['captiontag'] );
$custom_class = $settings['custom_class'];
$custom_attrs = $settings['custom_attrs'];
if ( 'justified' === $atts['type'] ) {
$captiontag = 'div';
}
$type = esc_attr( $atts['type'] );
$float = is_rtl() ? 'right' : 'left';
$selector = "gallery-{$instance}";
$size_class = sanitize_html_class( $atts['size'] );
$gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-type-{$type} gallery-size-{$size_class} {$custom_class}' {$custom_attrs}>";
$output = apply_filters( 'powerkit_gallery_style', $gallery_div );
$i = 0;
foreach ( $attachments as $id => $attachment ) {
$attr = ( trim( $attachment->post_excerpt ) ) ? array(
'aria-describedby' => "$selector-$id",
) : array();
// Add gallery type attribute.
$attr['data-gallery'] = $atts['type'];
if ( ! empty( $atts['link'] ) && 'file' === $atts['link'] ) {
$image_output = wp_get_attachment_link( $id, $atts['size'], false, false, false, $attr );
} elseif ( ! empty( $atts['link'] ) && 'none' === $atts['link'] ) {
$image_output = wp_get_attachment_image( $id, $atts['size'], false, $attr );
} else {
$image_output = wp_get_attachment_link( $id, $atts['size'], true, false, false, $attr );
}
$image_meta = wp_get_attachment_metadata( $id );
$output .= "<{$itemtag} class='gallery-item'>";
$output .= $image_output;
if ( $captiontag && trim( $attachment->post_excerpt ) ) {
$output .= "
<{$captiontag} class='caption wp-caption-text gallery-caption' id='$selector-$id'>
" . wptexturize( $attachment->post_excerpt ) . "
</{$captiontag}>";
}
$output .= "</{$itemtag}>";
}
$output .= '</div>';
return $output;
}
/**
* Add new gallery types if Jetpack is not installed
*/
public function gallery_init() {
add_action( 'print_media_templates', array( $this, 'print_media_templates' ) );
}
/**
* Add new gallery types to Jetpack if it's installed
*
* @param array $types Existing Jetpack gallery types.
*/
public function jetpack_gallery_types( $types ) {
$gallery_types = apply_filters(
'powerkit_gallery_types', array(
'default' => esc_html__( 'Default', 'powerkit' ),
)
);
$types = array_merge( $types, $gallery_types );
return $types;
}
/**
* Add Gallery Type Dropdown
*/
public function print_media_templates() {
// Return if Jetpack's Tiled Gallery.
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'tiled-gallery' ) ) {
return '';
}
$gallery_types = apply_filters(
'powerkit_gallery_types', array(
'default' => esc_html__( 'Default', 'powerkit' ),
)
);
$default_gallery_type = apply_filters( 'powerkit_default_gallery_type', 'default' );
?>
<script type="text/html" id="tmpl-pk-gallery-settings">
<label class="setting">
<span><?php esc_html_e( 'Type', 'powerkit' ); ?></span>
<select class="type" name="type" data-setting="type">
<?php foreach ( $gallery_types as $value => $caption ) : ?>
<option value="<?php echo esc_attr( $value ); ?>"><?php echo esc_html( $caption ); ?></option>
<?php endforeach; ?>
</select>
</label>
</script>
<script>
jQuery( document ).ready( function() {
_.extend( wp.media.gallery.defaults, {
type: '<?php echo esc_attr( $default_gallery_type ); ?>'
} );
// join default gallery settings template with yours -- store in list
if ( !wp.media.gallery.templates ) wp.media.gallery.templates = [ 'gallery-settings' ];
wp.media.gallery.templates.push( 'pk-gallery-settings' );
// loop through list -- allowing for other templates/settings
wp.media.view.Settings.Gallery = wp.media.view.Settings.Gallery.extend( {
template: function( view ) {
var output = '';
for ( var i in wp.media.gallery.templates ) {
output += wp.media.template( wp.media.gallery.templates[ i ] )( view );
}
return output;
},
render: function() {
var $el = this.$el;
wp.media.view.Settings.prototype.render.apply( this, arguments );
// Hide the Columns setting for all types except Default
$el.find( 'select[name=type]' ).on( 'change', function () {
var columnSetting = $el.find( 'select[name=columns]' ).closest( 'label.setting' );
if ( 'default' === jQuery( this ).val() || 'thumbnails' === jQuery( this ).val() ) {
columnSetting.show();
} else {
columnSetting.hide();
}
} ).change();
return this;
}
} );
} );
</script>
<?php
}
}
new Powerkit_Gallery();
}
@@ -0,0 +1,266 @@
<?php
/**
* Social Follow
*
* @package Powerkit
* @subpackage Extensions
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Social_Follow extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = 'Social Follow';
$this->slug = 'social_follow';
$this->type = 'extension';
$this->category = 'basic';
$this->public = false;
$this->enabled = true;
}
/**
* Transient Prefix
*
* @since 1.0.0
* @var string $cache_timeout Cache Timeout (minutes).
*/
private $trans_prefix = 'powerkit_social_follow_';
/**
* Initialize module
*/
public function initialize() {
// Reset cache.
add_filter( 'powerkit_reset_cache', array( $this, 'register_reset_cache' ) );
add_filter( 'powerkit_ajax_reset_cache', array( $this, 'register_reset_cache' ) );
}
/**
* Register Reset Cache
*
* @since 1.0.0
* @param array $list Change list reset cache.
* @access private
*/
public function register_reset_cache( $list ) {
$slug = powerkit_get_page_slug( $this->slug );
$list[ $slug ] = array(
'powerkit_social_follow',
);
return $list;
}
/**
* Return social follow
*
* @param string $name Name of social network.
* @param string $username Username of social network.
* @param string $type Type of social network.
*/
public function get_data( $name, $username, $type = null ) {
$social_function = sprintf( 'get_%s', $name );
if ( ! $username ) {
return;
}
if ( method_exists( $this, $social_function ) ) {
return $this->$social_function( $username, $type );
}
}
/**
* Get youtube data.
*
* @param string $username Username of social network.
* @param string $type Type of social network.
*/
public function get_youtube( $username, $type = null ) {
$result = array();
// Get data for social network.
$counter = new Powerkit_Links_Social_Counter();
$counter->trans_prefix = $this->trans_prefix;
$counter->config['youtube_slug'] = $username;
$counter->config['youtube_channel_type'] = $type;
$data = $counter->get_count( 'youtube', true );
// Followers.
// Manual Count Override.
$count_override = get_option( 'powerkit_social_links_youtube_override' );
if ( $count_override ) {
$result['followers'] = $count_override;
} elseif ( isset( $data['count'] ) && ! isset( $data['error'] ) ) {
$result['followers'] = $data['count'];
} elseif ( isset( $data['error'] ) ) {
powerkit_alert_warning( $data['error'] );
}
// Avatar.
if ( isset( $data['data'] ) && is_object( $data['data'] ) && isset( $data['data']->items[0]->snippet->thumbnails->default->url ) ) {
$result['avatar_1x'] = $data['data']->items[0]->snippet->thumbnails->default->url;
}
if ( isset( $data['data'] ) && is_object( $data['data'] ) && isset( $data['data']->items[0]->snippet->thumbnails->medium->url ) ) {
$result['avatar_2x'] = $data['data']->items[0]->snippet->thumbnails->medium->url;
}
// Username.
if ( isset( $data['data'] ) && is_object( $data['data'] ) && isset( $data['data']->items[0]->snippet->title ) ) {
$result['text'] = $data['data']->items[0]->snippet->title;
}
// Link.
if ( 'channel' === $type ) {
$result['link'] = sprintf( 'https://www.youtube.com/channel/%s/', $username );
} else {
$result['link'] = sprintf( 'https://www.youtube.com/user/%s/', $username );
}
return $result;
}
/**
* Get facebook data.
*
* @param string $username Username of social network.
* @param string $type Type of social network.
*/
public function get_facebook( $username, $type = null ) {
$result = array();
// Get data for social network.
$counter = new Powerkit_Links_Social_Counter();
$counter->trans_prefix = $this->trans_prefix;
$counter->config['facebook_user'] = $username;
$data = $counter->get_count( 'facebook', true );
// Followers.
// Manual Count Override.
$count_override = get_option( 'powerkit_social_links_facebook_override' );
if ( $count_override ) {
$result['followers'] = $count_override;
} elseif ( isset( $data['count'] ) && ! isset( $data['error'] ) ) {
$result['followers'] = $data['count'];
} elseif ( isset( $data['error'] ) ) {
powerkit_alert_warning( $data['error'] );
}
// Link.
$result['link'] = sprintf( 'https://facebook.com/%s/', $username );
// Avatar.
$result['avatar_1x'] = "https://graph.facebook.com/{$username}/picture?width=80&height=80";
$result['avatar_2x'] = "https://graph.facebook.com/{$username}/picture?width=160&height=160";
// Username.
$result['text'] = $username;
return $result;
}
/**
* Get instagram data.
*
* @param string $username Username of social network.
* @param string $type Type of social network.
*/
public function get_instagram( $username, $type = null ) {
$result = array();
// Get data for social network.
$counter = new Powerkit_Links_Social_Counter();
$counter->trans_prefix = $this->trans_prefix . md5( ( $username ) . powerkit_connect( 'instagram_app_access_token' ) );
$counter->config['instagram_user'] = $username;
$data = $counter->get_count( 'instagram', true );
// Followers.
// Manual Count Override.
$count_override = get_option( 'powerkit_social_links_instagram_override' );
if ( $count_override ) {
$result['followers'] = $count_override;
} elseif ( isset( $data['count'] ) && ! isset( $data['error'] ) ) {
$result['followers'] = $data['count'];
} elseif ( isset( $data['error'] ) ) {
powerkit_alert_warning( $data['error'] );
}
// Avatar parse json.
if ( isset( $data['data'] ) && is_object( $data['data'] ) && isset( $data['data']->profile_picture_url ) ) {
$result['avatar_1x'] = $data['data']->profile_picture_url;
}
if ( isset( $data['data'] ) && is_object( $data['data'] ) && isset( $data['data']->profile_picture_url ) ) {
$result['avatar_2x'] = $data['data']->profile_picture_url;
}
// Avatar parse html.
if ( isset( $data['data'] ) && is_array( $data['data'] ) && isset( $data['data']['entry_data']['ProfilePage'][0]['graphql']['user']['profile_pic_url'] ) ) {
$result['avatar_1x'] = $data['data']['entry_data']['ProfilePage'][0]['graphql']['user']['profile_pic_url'];
}
if ( isset( $data['data'] ) && is_array( $data['data'] ) && isset( $data['data']['entry_data']['ProfilePage'][0]['graphql']['user']['profile_pic_url_hd'] ) ) {
$result['avatar_2x'] = $data['data']['entry_data']['ProfilePage'][0]['graphql']['user']['profile_pic_url_hd'];
}
/* Manual Override */
if ( get_option( 'powerkit_connect_instagram_custom_followers' ) ) {
$result['followers'] = (int) get_option( 'powerkit_connect_instagram_custom_followers' );
}
if ( get_option( 'powerkit_connect_instagram_custom_avatar' ) ) {
$result['avatar_1x'] = get_option( 'powerkit_connect_instagram_custom_avatar' );
}
if ( get_option( 'powerkit_connect_instagram_custom_avatar' ) ) {
$result['avatar_2x'] = get_option( 'powerkit_connect_instagram_custom_avatar' );
}
// Link.
$result['link'] = sprintf( 'https://www.instagram.com/%s/', $username );
// Username.
$result['text'] = $username;
return $result;
}
}
/**
* Get social follow
*
* @param string $name Name of social network.
* @param string $username Username of social network.
* @param string $type Type of social network.
*/
function powerkit_get_social_follow( $name, $username, $type = null ) {
$object = new Powerkit_Social_Follow();
return $object->get_data( $name, $username, $type );
}
new Powerkit_Social_Follow();
}
@@ -0,0 +1,228 @@
<?php
/**
* Twitter API
*
* @package Powerkit
* @subpackage Extensions
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Twitter_API extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = 'Twitter API';
$this->slug = 'twitter-api';
$this->type = 'extension';
$this->category = 'basic';
$this->public = false;
$this->enabled = false;
}
/**
* The base_url.
*
* @var string $base_url The base_url.
*/
protected $base_url;
/**
* The get_fields.
*
* @var string $get_fields The get_fields.
*/
private $get_fields;
/**
* The oauth.
*
* @var string $oauth The oauth.
*/
private $oauth;
/**
* The header.
*
* @var string $header The header.
*/
private $header;
/**
* The json.
*
* @var string $json The json.
*/
public $json;
/**
* Init API
*
* @param array $request_settings All necessary tokens for OAuth connection.
* @param string $feed_type Type of Twitter feed.
*/
public function init( $request_settings, $feed_type ) {
$this->consumer_key = $request_settings['consumer_key'];
$this->consumer_secret = $request_settings['consumer_secret'];
$this->access_token = $request_settings['access_token'];
$this->access_token_secret = $request_settings['access_token_secret'];
$this->feed_type = $feed_type;
}
/**
* Sets the complete url for our API endpoint. GET fields will be added later
*/
public function set_url_base() {
switch ( $this->feed_type ) {
case 'hometimeline':
$this->base_url = 'https://api.twitter.com/1.1/statuses/home_timeline.json';
break;
case 'search':
$this->base_url = 'https://api.twitter.com/1.1/search/tweets.json';
break;
default:
$this->base_url = 'https://api.twitter.com/1.1/statuses/user_timeline.json';
}
}
/**
* Encodes an array of GET field data into html characters for including in a URL
*
* @param array $get_fields Array of GET fields that are compatible with the Twitter API.
*/
public function set_get_fields( array $get_fields ) {
$url_string = '?';
$length = count( $get_fields );
$j = 1;
foreach ( $get_fields as $key => $value ) {
$url_string .= rawurlencode( $key ) . '=' . rawurlencode( $value );
if ( $j != $length ) {
$url_string .= '&';
}
$j++;
}
$this->get_fields = $url_string;
}
/**
* Uses the OAuth data to build the base string needed to create the
* OAuth signature to be used in the header of the request
*
* @param array $oauth Oauth data without the signature.
*/
private function build_base_string( $oauth ) {
$base_string = array();
ksort( $oauth );
// Start forming the header string by creating a numeric index array with each part of the header string it's own element in the array.
foreach ( $oauth as $key => $value ) {
$base_string[] = rawurlencode( $key ) . '=' . rawurlencode( $value );
}
// Convert the array of values into a single encoded string and return.
return 'GET&' . rawurlencode( $this->base_url ) . '&' . rawurlencode( implode( '&', $base_string ) );
}
/**
* Builds the OAuth data array that is used to authenticate the connection
* to the Twitter API
*/
public function build_oauth() {
$oauth = array(
'oauth_consumer_key' => $this->consumer_key,
'oauth_nonce' => time(),
'oauth_signature_method' => 'HMAC-SHA1',
'oauth_token' => $this->access_token,
'oauth_timestamp' => time(),
'oauth_version' => '1.0',
);
$getfields = str_replace( '?', '', explode( '&', $this->get_fields ) );
// Add the get fields to the oauth associative array to be formed into the header string eventually.
foreach ( $getfields as $getfield ) {
$split = explode( '=', $getfield );
if ( isset( $split[1] ) ) {
$oauth[ $split[0] ] = urldecode( $split[1] );
}
}
// The OAuth signature for Twitter is a hashed, encoded version of the base url, 4 different keys.
$base_string = $this->build_base_string( $oauth );
$composite_key = rawurlencode( $this->consumer_secret ) . '&' . rawurlencode( $this->access_token_secret );
$oauth_signature = base64_encode( hash_hmac( 'sha1', $base_string, $composite_key, true ) );
$oauth['oauth_signature'] = $oauth_signature;
$this->oauth = $oauth;
}
/**
* Since the OAuth data is passed in a url, special characters need to be encoded
*/
private function encode_header() {
$header = 'Authorization: OAuth ';
$values = array();
// Each element of the header needs to have it's special characters encoded for passing through a url.
foreach ( $this->oauth as $key => $value ) {
if ( in_array(
$key,
array(
'oauth_consumer_key',
'oauth_nonce',
'oauth_signature',
'oauth_signature_method',
'oauth_timestamp',
'oauth_token',
'oauth_version',
)
) ) {
$values[] = "$key=\"" . rawurlencode( $value ) . '"';
}
}
$header .= implode( ', ', $values );
$this->header = $header;
}
/**
* Attempts to connect to the Twitter api using WP_HTTP class
*
* @param string $url The complete api endpoint url.
*/
private function wp_http_request( $url ) {
$args = array(
'headers' => $this->header,
'timeout' => 60,
'sslverify' => false,
);
return wp_remote_get( $url, $args );
}
/**
* Uses the data created and gathered up to this point to make the actual connection
* to the Twitter API. It first tests whether or not a curl connection is possible,
* followed by file_get_contents connection, then defaults to the WordPress WP_HTTP object
*
* @return mixed|string raw json data retrieved from the API request
*/
public function perform_request() {
$url = $this->base_url . $this->get_fields;
$this->build_oauth();
$this->encode_header();
$this->json = $this->wp_http_request( $url );
return $this;
}
}
}
@@ -0,0 +1,122 @@
<?php
/**
* Gallery
*
* @package Powerkit
* @subpackage Extensions
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_User extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = 'user';
$this->slug = 'user';
$this->type = 'extension';
$this->category = 'basic';
$this->public = false;
$this->enabled = true;
}
/**
* Initialize module
*/
public function initialize() {
// Helpers Functions for the module.
require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-user.php';
// Filters.
add_filter( 'init', array( $this, 'powerkit_guest_support_meta' ) );
add_filter( 'pre_get_avatar', array( $this, 'powerkit_guest_support_avatar' ), 10, 3 );
add_filter( 'author_link', array( $this, 'powerkit_guest_support_link' ), 9999, 3 );
}
/**
* Add support meta info for guest authors.
*/
public function powerkit_guest_support_meta() {
$fields = array(
'user_url',
'url',
'display_name',
'first_name',
'last_name',
'user_email',
'website',
'description',
);
foreach ( $fields as $field ) {
/**
* Filters the value of the requested user metadata.
*
* @param string $value The value of the metadata.
* @param int $user_id The user ID for the value.
* @param int|bool $original The original user ID, as passed to the function.
*/
add_filter( 'get_the_author_' . $field, function( $value, $user_id, $original = null ) use ( $field ) {
if ( powerkit_is_guest( $user_id ) && empty( $value ) ) {
$guest_value = powerkit_get_guest_meta( $field, $user_id );
if ( $guest_value ) {
$value = $guest_value;
}
}
return $value;
}, 10, 3 );
}
}
/**
* Add support avatar for guest authors.
*
* @param string $link The URL to the author's page.
* @param int $author_id The author's id.
* @param string $author_nicename The author's nice name.
*/
public function powerkit_guest_support_link( $link, $author_id, $author_nicename ) {
global $wp_rewrite;
if ( powerkit_is_guest( $author_id ) ) {
$guest = powerkit_get_guest_meta( 'user_login', $author_id );
if ( $guest ) {
$link = $wp_rewrite->get_author_permastruct();
$link = str_replace( '%author%', $guest, $link );
$link = home_url( user_trailingslashit( $link ) );
}
}
return $link;
}
/**
* Add support avatar for guest authors.
*
* @param string $avatar HTML for the user's avatar. Default null.
* @param mixed $id_or_email The Gravatar to retrieve.
* @param array $args Arguments passed to get_avatar_url(), after processing.
*/
public function powerkit_guest_support_avatar( $avatar, $id_or_email, $args ) {
if ( powerkit_is_guest( $id_or_email ) && empty( $avatar ) ) {
$guest_avatar = coauthors_get_avatar( (object) array(
'ID' => $id_or_email,
'type' => 'guest-author',
), $args['size'] );
if ( $guest_avatar ) {
$avatar = $guest_avatar;
}
}
return $avatar;
}
}
new Powerkit_User();
}
@@ -0,0 +1,163 @@
<?php
/**
* Helpers to empower authors and users
*
* @package Powerkit
* @subpackage Modules/Helper
*/
/**
* Check enabled CoAuthors.
*/
function powerkit_coauthors_enabled() {
return class_exists( 'CoAuthors_Plus' );
}
/**
* Retrieve list of guests.
*/
function powerkit_get_guests() {
$list = wp_cache_get( 'powerkit_get_guests' );
if ( ! $list ) {
$list = array();
$query = new WP_Query();
$guests = $query->query( array(
'post_type' => 'guest-author',
'post_status' => 'publish',
'posts_per_page' => -1,
) );
foreach ( $guests as $guest ) {
array_push( $list, $guest );
}
wp_cache_set( 'powerkit_get_guests', $list, 'powerkit', 1 );
}
return $list;
}
/**
* Determines whether a user is a guest.
*
* @param int $id The id of guest.
*/
function powerkit_is_guest( $id ) {
if ( ! powerkit_coauthors_enabled() ) {
return false;
}
if ( ! is_numeric( $id ) ) {
return false;
}
$guests = powerkit_get_guests();
foreach ( $guests as $guest ) {
if ( (int) $id === (int) $guest->ID ) {
return true;
}
}
}
/**
* Retrieve guest info by a given field.
*
* @param string $field The field of guest.
* @param int $id The id of guest.
*/
function powerkit_get_guest_meta( $field, $id ) {
$field = str_replace( array( 'user_url', 'url' ), 'website', $field );
return get_post_meta( $id, 'cap-' . $field, true );
}
/**
* Retrieve list of users and guests.
*/
function powerkit_get_users() {
$users = wp_cache_get( 'powerkit_get_users' );
if ( ! $users ) {
$args = array(
'orderby' => 'display_name',
'capability' => array( 'edit_posts' ),
);
// Capability queries were only introduced in WP 5.9.
if ( version_compare( $GLOBALS['wp_version'], '5.9', '<' ) ) {
$args['who'] = 'authors';
unset( $args['capability'] );
}
$users = get_users( apply_filters( 'powerkit_get_users_args', $args ) );
if ( powerkit_coauthors_enabled() ) {
$guests = powerkit_get_guests();
foreach ( $guests as $guest ) {
$guest->first_name = powerkit_get_guest_meta( 'first_name', $guest->ID );
$guest->last_name = powerkit_get_guest_meta( 'last_name', $guest->ID );
$guest->user_email = powerkit_get_guest_meta( 'user_email', $guest->ID );
$guest->website = powerkit_get_guest_meta( 'website', $guest->ID );
$user = (object) array(
'ID' => $guest->ID,
'display_name' => $guest->post_title,
'user_registered' => $guest->post_date,
'user_login' => $guest->first_name,
'user_nicename' => $guest->last_name,
'user_email' => $guest->user_email,
'user_url' => $guest->website,
'user_pass' => '',
'user_activation_key' => '',
'user_status' => 0,
);
array_push( $users, $user );
}
}
wp_cache_set( 'powerkit_get_users', $users, 'powerkit', 1 );
}
usort( $users, function( $a, $b ) {
if ( function_exists( 'mb_strtolower' ) ) {
return strcmp( mb_strtolower( $a->display_name ), mb_strtolower( $b->display_name ) );
} else {
return strcmp( strtolower( $a->display_name ), strtolower( $b->display_name ) );
}
} );
return $users;
}
/**
* Check the user's belonging to the post.
*
* @param int $author_id The ID of author.
* @param int $post_id The ID of post.
*/
function powerkit_check_post_author( $author_id, $post_id ) {
if ( (string) get_post_field( 'post_author', $post_id ) === (string) $author_id ) {
return true;
}
if ( powerkit_coauthors_enabled() ) {
$coauthors = (array) get_coauthors();
foreach ( $coauthors as $coauthor ) {
if ( isset( $coauthor->ID ) && (string) $coauthor->ID === (string) $author_id ) {
return true;
}
}
}
}
+1
View File
@@ -0,0 +1 @@
<?php // Silence is golden
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,58 @@
<?php
/**
* Author Box
*
* @package Powerkit
* @subpackage Modules
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Author_Box extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = esc_html__( 'Author Box', 'powerkit' );
$this->desc = esc_html__( 'Display a post author box in your sidebar, including author name, bio and avatar in multiple available layouts.', 'powerkit' );
$this->slug = 'author_box';
$this->type = 'default';
$this->category = 'widget';
$this->priority = 160;
$this->public = true;
$this->enabled = true;
$this->links = array(
array(
'name' => esc_html__( 'View documentation', 'powerkit' ),
'url' => powerkit_get_setting( 'documentation' ) . '/author-box/',
'target' => '_blank',
),
);
}
/**
* Initialize module
*/
public function initialize() {
// Helpers Functions for the module.
require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-author-box.php';
// The classes responsible for defining all actions.
require_once dirname( __FILE__ ) . '/public/class-powerkit-author-box-widget.php';
if ( function_exists( 'register_block_type' ) ) {
require_once dirname( __FILE__ ) . '/public/class-powerkit-author-box-block.php';
}
// Admin and public area.
require_once dirname( __FILE__ ) . '/public/class-powerkit-author-box-public.php';
new Powerkit_Author_Box_Public( $this->slug );
}
}
new Powerkit_Author_Box();
}
@@ -0,0 +1,26 @@
<?php
/**
* Helpers Featured Posts
*
* @package Powerkit
* @subpackage Modules/Helper
*/
/**
* Template handler
*
* @param string $name Specific template.
* @param int $author The author.
* @param array $args Array of args.
* @param array $params Array of params.
* @param array $instance Widget instance.
*/
function powerkit_widget_author_template_handler( $name, $author, $args, $params, $instance ) {
$templates = apply_filters( 'powerkit_widget_author_templates', array() );
if ( isset( $templates[ $name ] ) && function_exists( $templates[ $name ]['func'] ) ) {
call_user_func( $templates[ $name ]['func'], $author, $args, $params, $instance );
} else {
call_user_func( 'powerkit_widget_author_default_template', $author, $args, $params, $instance );
}
}
@@ -0,0 +1,87 @@
<?php
/**
* Author block template
*
* @var $attributes - block attributes
* @var $options - layout options
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package PowerKit
* @subpackage PowerKit/templates
*/
$params = array(
'title' => '',
'author' => $attributes['author'],
'bg_image_id' => isset( $attributes['bgImage']['id'] ) ? $attributes['bgImage']['id'] : 0,
'avatar' => $attributes['showAvatar'],
'description' => $attributes['showDescription'],
'description_override' => $attributes['overrideDescription'],
'description_length' => isset( $attributes['descriptionLength'] ) ? $attributes['descriptionLength'] : 100,
'social_accounts' => $attributes['showSocialAccounts'],
'archive_btn' => $attributes['showArchiveBtn'],
'template' => 'default',
'is_block' => true,
'block_attrs' => $attributes,
);
echo '<div class="' . esc_attr( $attributes['className'] ) . '" ' . ( isset( $attributes['anchor'] ) ? ' id="' . esc_attr( $attributes['anchor'] ) . '"' : '' ) . '>';
// Title.
if ( $params['title'] ) {
$params['title'] = '<h5 class="pk-author-title">' . $params['title'] . '<h5>';
}
$authors = array();
// Get authors.
if ( 'current' === $params['author'] ) {
$params['posts_only'] = true;
$coauthors = array();
if ( function_exists( 'get_coauthors' ) ) {
$coauthors = get_coauthors();
}
if ( $coauthors ) {
// Get co authors.
foreach ( $coauthors as $author ) {
$authors[] = $author->ID;
}
} else {
// Get the default WP author.
$authors[] = get_the_author_meta( 'ID' );
}
} else {
if ( get_the_author_meta( 'display_name', $params['author'] ) ) {
$authors[] = $params['author'];
} elseif ( current_user_can( 'editor' ) || current_user_can( 'administrator' ) ) {
?>
<p class="pk-alert pk-alert-warning" role="alert">
<?php esc_html_e( 'Author not found.', 'powerkit' ); ?>
</p>
<?php
}
}
if ( ! empty( $authors ) ) {
foreach ( $authors as $author ) {
if ( ! @ is_author( $author ) ) {
$args = array(
'before_title' => '',
'after_title' => '',
'before_widget' => '',
'after_widget' => '',
);
powerkit_widget_author_template_handler( $params['template'], $author, $args, $params, array() );
}
}
}
echo '</div>';
@@ -0,0 +1,199 @@
<?php
/**
* The Gutenberg Block.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/public
*/
/**
* The initialize block.
*/
class Powerkit_Author_Block {
/**
* Initialize
*/
public function __construct() {
add_filter( 'powerkit_pinit_exclude_selectors', array( $this, 'pinit_disable' ) );
add_action( 'init', array( $this, 'block' ) );
add_filter( 'canvas_register_block_type', array( $this, 'register_block_type' ) );
}
/**
* PinIt disable
*
* @param string $selectors List selectors.
*/
public function pinit_disable( $selectors ) {
$selectors[] = '.pk-block-author';
return $selectors;
}
/**
* Enqueue the block's assets for the editor.
*/
public function block() {
// Styles.
wp_register_style(
'powerkit-author-block-editor-style',
plugins_url( 'css/public-powerkit-author-box.css', __FILE__ ),
array( 'wp-edit-blocks' ),
filemtime( plugin_dir_path( __FILE__ ) . 'css/public-powerkit-author-box.css' )
);
wp_style_add_data( 'powerkit-author-block-editor-style', 'rtl', 'replace' );
}
/**
* Register block
*
* @param array $blocks all registered blocks.
* @return array
*/
public function register_block_type( $blocks ) {
$users = powerkit_get_users();
$users_choices = array(
'current' => esc_html__( 'Current Posts Author' ),
);
foreach ( $users as $user ) {
$users_choices[ $user->ID ] = $user->display_name;
}
$blocks[] = array(
'name' => 'canvas/author',
'title' => esc_html__( 'Author', 'powerkit' ),
'description' => '',
'category' => 'canvas',
'keywords' => array(),
'icon' => '
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM7.07 18.28C7.5 17.38 10.12 16.5 12 16.5C13.88 16.5 16.51 17.38 16.93 18.28C15.57 19.36 13.86 20 12 20C10.14 20 8.43 19.36 7.07 18.28ZM18.36 16.83C16.93 15.09 13.46 14.5 12 14.5C10.54 14.5 7.07 15.09 5.64 16.83C4.62 15.49 4 13.82 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 13.82 19.38 15.49 18.36 16.83V16.83ZM12 6C10.06 6 8.5 7.56 8.5 9.5C8.5 11.44 10.06 13 12 13C13.94 13 15.5 11.44 15.5 9.5C15.5 7.56 13.94 6 12 6ZM12 11C11.17 11 10.5 10.33 10.5 9.5C10.5 8.67 11.17 8 12 8C12.83 8 13.5 8.67 13.5 9.5C13.5 10.33 12.83 11 12 11Z" />
</svg>
',
'supports' => array(
'className' => true,
'anchor' => true,
'html' => false,
'canvasSpacings' => true,
'canvasBorder' => true,
'canvasResponsive' => true,
),
'styles' => array(),
'location' => array(),
'sections' => array(
'general' => array(
'title' => esc_html__( 'Block Settings', 'powerkit' ),
'priority' => 5,
'open' => true,
),
'buttonSettings' => array(
'title' => esc_html__( 'Button Settings', 'powerkit' ),
'priority' => 50,
),
),
'layouts' => array(),
'fields' => array_merge(
array(
array(
'key' => 'author',
'label' => esc_html__( 'Author', 'powerkit' ),
'section' => 'general',
'type' => 'select',
'choices' => $users_choices,
'default' => 'current',
),
array(
'key' => 'bgImage',
'label' => esc_html__( 'Background Image', 'powerkit' ),
'section' => 'general',
'type' => 'image',
'default' => '',
),
array(
'key' => 'showAvatar',
'label' => esc_html__( 'Display Avatar', 'powerkit' ),
'section' => 'general',
'type' => 'toggle',
'default' => true,
),
array(
'key' => 'showDescription',
'label' => esc_html__( 'Display Description', 'powerkit' ),
'section' => 'general',
'type' => 'toggle',
'default' => true,
),
array(
'key' => 'overrideDescription',
'label' => esc_html__( 'Override Description', 'powerkit' ),
'section' => 'general',
'type' => 'textarea',
'default' => '',
'active_callback' => array(
array(
'field' => 'showDescription',
'operator' => '==',
'value' => true,
),
),
),
array(
'key' => 'descriptionLength',
'label' => esc_html__( 'Description Length', 'powerkit' ),
'section' => 'general',
'type' => 'number',
'step' => 1,
'min' => 0,
'max' => 5000,
'default' => 100,
'active_callback' => array(
array(
'field' => 'showDescription',
'operator' => '==',
'value' => true,
),
),
),
array(
'key' => 'showSocialAccounts',
'label' => esc_html__( 'Display Social Accounts', 'powerkit' ),
'section' => 'general',
'type' => 'toggle',
'default' => true,
),
array(
'key' => 'showArchiveBtn',
'label' => esc_html__( 'Display Archive Button', 'powerkit' ),
'section' => 'general',
'type' => 'toggle',
'default' => false,
),
), powerkit_get_gutenberg_button_fields(
'button',
'buttonSettings',
array(
array(
'field' => 'showArchiveBtn',
'operator' => '==',
'value' => true,
),
)
)
),
'template' => dirname( __FILE__ ) . '/block/render.php',
// enqueue registered scripts/styles.
'editor_style' => 'powerkit-author-block-editor-style',
);
return $blocks;
}
}
new Powerkit_Author_Block();
@@ -0,0 +1,64 @@
<?php
/**
* The public-facing functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/public
*/
/**
* The public-facing functionality of the module.
*/
class Powerkit_Author_Box_Public extends Powerkit_Module_Public {
/**
* Initialize
*/
public function initialize() {
add_action( 'init', array( $this, 'register_templates' ) );
add_filter( 'powerkit_widget_author_templates', array( $this, 'list_templates' ) );
}
/**
* Register Templates
*
* @since 1.0.0
* @access private
*
* @param array $templates List of Templates.
*/
public function register_templates( $templates = array() ) {
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/widget-author-template.php';
}
/**
* Filter Register Templates
*
* @since 1.0.0
* @access private
*
* @param array $templates List of Templates.
*/
public function list_templates( $templates = array() ) {
$templates = array(
'default' => array(
'name' => esc_html__( 'Default', 'powerkit' ),
'func' => 'powerkit_widget_author_default_template',
),
);
return $templates;
}
/**
* Register the stylesheets for the public-facing side of the site.
*/
public function wp_enqueue_scripts() {
wp_enqueue_style( 'powerkit-author-box', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-author-box.css' ), array(), powerkit_get_setting( 'version' ), 'all' );
// Add RTL support.
wp_style_add_data( 'powerkit-author-box', 'rtl', 'replace' );
}
}
@@ -0,0 +1,344 @@
<?php
/**
* Widget Author
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Powerkit/widgets
*/
/**
* Widget Author
*/
class Powerkit_Widget_Author_Init extends WP_Widget {
/**
* Sets up a new widget instance.
*/
public function __construct() {
$this->default_settings = apply_filters( 'powerkit_widget_author_settings', array(
'title' => esc_html__( 'Author', 'powerkit' ),
'author' => 'current',
'template' => 'default',
'bg_image_id' => false,
'avatar' => true,
'description' => true,
'description_override' => '',
'description_length' => 100,
'social_accounts' => true,
'posts_only' => false,
'archive_btn' => false,
) );
$widget_details = array(
'classname' => 'powerkit_widget_author',
'description' => '',
);
// Actions.
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
parent::__construct( 'powerkit_widget_author', esc_html__( 'Author', 'powerkit' ), $widget_details );
}
/**
* Outputs the content for the current widget instance.
*
* @param array $args Display arguments including 'before_title', 'after_title',
* 'before_widget', and 'after_widget'.
* @param array $instance Settings for the current widget instance.
*/
public function widget( $args, $instance ) {
$params = array_merge( $this->default_settings, $instance );
$authors = array();
// Get authors.
if ( 'current' === $params['author'] || 'сurrent' === $params['author'] ) {
if ( is_single() ) {
$params['posts_only'] = true;
$coauthors = array();
if ( function_exists( 'get_coauthors' ) ) {
$coauthors = get_coauthors();
}
if ( $coauthors ) {
// Get co authors.
foreach ( $coauthors as $author ) {
$authors[] = $author->ID;
}
} else {
// Get the default WP author.
$authors[] = get_the_author_meta( 'ID' );
}
}
} else {
if ( get_the_author_meta( 'display_name', $params['author'] ) ) {
$authors[] = $params['author'];
} elseif ( current_user_can( 'editor' ) || current_user_can( 'administrator' ) ) {
?>
<p class="pk-alert pk-alert-warning" role="alert">
<?php esc_html_e( 'Author not found.', 'powerkit' ); ?>
</p>
<?php
}
}
if ( empty( $authors ) ) {
return;
}
foreach ( $authors as $author ) {
// Display on posts only.
if ( $params['posts_only'] ) {
if ( is_single() ) {
$post_id = get_queried_object_id();
if ( ! powerkit_check_post_author( $author, $post_id ) ) {
continue;
}
} else {
continue;
}
}
// Display author.
if ( ! @ is_author( $author ) ) {
powerkit_widget_author_template_handler( $params['template'], $author, $args, $params, $instance );
}
}
}
/**
* Handles updating settings for the current widget instance.
*
* @param array $new_instance New settings for this instance as input by the user via
* WP_Widget::form().
* @param array $old_instance Old settings for this instance.
* @return array Settings to save or bool false to cancel saving.
*/
public function update( $new_instance, $old_instance ) {
$instance = $new_instance;
// Display avatar.
if ( ! isset( $instance['avatar'] ) ) {
$instance['avatar'] = false;
}
// Display description.
if ( ! isset( $instance['description'] ) ) {
$instance['description'] = false;
}
// Display social accounts.
if ( ! isset( $instance['social_accounts'] ) ) {
$instance['social_accounts'] = false;
}
// Display on posts only.
if ( ! isset( $instance['posts_only'] ) ) {
$instance['posts_only'] = false;
}
// Display post archive button.
if ( ! isset( $instance['archive_btn'] ) ) {
$instance['archive_btn'] = false;
}
return $instance;
}
/**
* Outputs the widget settings form.
*
* @param array $instance Current settings.
*/
public function form( $instance ) {
$params = array_merge( $this->default_settings, $instance );
$bg_image_url = $params['bg_image_id'] ? wp_get_attachment_image_url( intval( $params['bg_image_id'] ), 'large' ) : '';
$templates = apply_filters( 'powerkit_widget_author_templates', array() );
?>
<!-- Title -->
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'powerkit' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $params['title'] ); ?>" /></p>
<!-- Template -->
<?php if ( count( $templates ) > 1 ) { ?>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'template' ) ); ?>"><?php esc_html_e( 'Template:', 'powerkit' ); ?></label>
<select name="<?php echo esc_attr( $this->get_field_name( 'template' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'template' ) ); ?>" class="widefat">
<?php
foreach ( $templates as $slug => $template ) {
$name = isset( $template['name'] ) ? $template['name'] : $slug;
?>
<option value="<?php echo esc_attr( $slug ); ?>" <?php selected( $params['template'], $slug ); ?>><?php echo esc_html( $name ); ?></option>
<?php } ?>
</select>
</p>
<?php } ?>
<!-- Author -->
<p><label for="<?php echo esc_attr( $this->get_field_id( 'author' ) ); ?>"><?php esc_html_e( 'Author:', 'powerkit' ); ?></label>
<select name="<?php echo esc_attr( $this->get_field_name( 'author' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'author' ) ); ?>" class="widefat">
<option value="current" <?php selected( $params['author'], 'current' ); ?>><?php esc_html_e( 'Current Posts Author' ); ?></option>
<?php
$authors = powerkit_get_users();
if ( isset( $authors ) && ! empty( $authors ) ) {
foreach ( $authors as $author ) {
?>
<option value="<?php echo esc_attr( $author->ID ); ?>" <?php selected( $params['author'], $author->ID ); ?>><?php echo esc_html( $author->display_name ); ?></option>
<?php
}
}
?>
</select>
</p>
<!-- Background Image container -->
<div class="author-upload-image upload-img-container" data-frame-title="<?php esc_html_e( 'Select or upload background image', 'powerkit' ); ?>" data-frame-btn-text="<?php esc_html_e( 'Set background image', 'powerkit' ); ?>">
<p class="uploaded-img-box">
<label for="<?php echo esc_attr( $this->get_field_id( 'bg_image_id' ) ); ?>"><?php esc_html_e( 'Background image:', 'powerkit' ); ?></label>
<span class="uploaded-image">
<?php if ( $bg_image_url ) : ?>
<img src="<?php echo esc_url( $bg_image_url ); ?>" style="display: block; margin-top: 5px; max-width:100%;" />
<?php endif; ?>
</span>
<input id="<?php echo esc_attr( $this->get_field_id( 'bg_image_id' ) ); ?>" class="uploaded-img-id" name="<?php echo esc_attr( $this->get_field_name( 'bg_image_id' ) ); ?>" type="hidden" value="<?php echo esc_attr( $params['bg_image_id'] ); ?>" />
</p>
<!-- Add & remove image links -->
<p class="hide-if-no-js">
<a class="upload-img-link button button-primary <?php echo esc_attr( $bg_image_url ? 'hidden' : '' ); ?>" href="#"><?php esc_html_e( 'Add Image', 'powerkit' ); ?></a>
<a class="delete-img-link button button-secondary <?php echo esc_attr( ! $bg_image_url ? 'hidden' : '' ); ?>" href="#"><?php esc_html_e( 'Remove Image', 'powerkit' ); ?></a>
</p>
</div>
<!-- Display avatar -->
<p><input id="<?php echo esc_attr( $this->get_field_id( 'avatar' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'avatar' ) ); ?>" type="checkbox" <?php checked( (bool) $params['avatar'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'avatar' ) ); ?>"><?php esc_html_e( 'Display avatar', 'powerkit' ); ?></label></p>
<!-- Display description -->
<p><input id="<?php echo esc_attr( $this->get_field_id( 'description' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'description' ) ); ?>" type="checkbox" <?php checked( (bool) $params['description'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'description' ) ); ?>"><?php esc_html_e( 'Display description', 'powerkit' ); ?></label></p>
<!-- Override Description -->
<p><label for="<?php echo esc_attr( $this->get_field_id( 'description_override' ) ); ?>"><?php esc_html_e( 'Override Description', 'powerkit' ); ?></label>
<textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'description_override' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'description_override' ) ); ?>" rows="10"><?php echo esc_textarea( $params['description_override'] ); ?></textarea></p>
<!-- Description Length -->
<p><label for="<?php echo esc_attr( $this->get_field_id( 'description_length' ) ); ?>"><?php esc_html_e( 'Description Length:', 'powerkit' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'description_length' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'description_length' ) ); ?>" type="text" value="<?php echo esc_attr( $params['description_length'] ); ?>" /></p>
<!-- Display social accounts -->
<?php if ( powerkit_module_enabled( 'social_links' ) ) : ?>
<p><input id="<?php echo esc_attr( $this->get_field_id( 'social_accounts' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'social_accounts' ) ); ?>" type="checkbox" <?php checked( (bool) $params['social_accounts'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'social_accounts' ) ); ?>"><?php esc_html_e( 'Display social accounts', 'powerkit' ); ?></label></p>
<?php endif; ?>
<!-- Display post archive button -->
<p><input id="<?php echo esc_attr( $this->get_field_id( 'archive_btn' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'archive_btn' ) ); ?>" type="checkbox" <?php checked( (bool) $params['archive_btn'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'archive_btn' ) ); ?>"><?php esc_html_e( 'Display post archive button', 'powerkit' ); ?></label></p>
<!-- Display on posts only -->
<p><input id="<?php echo esc_attr( $this->get_field_id( 'posts_only' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'posts_only' ) ); ?>" type="checkbox" <?php checked( (bool) $params['posts_only'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'posts_only' ) ); ?>"><?php esc_html_e( 'Display on posts of the author only', 'powerkit' ); ?></label></p>
<?php
}
/**
* Admin Enqunue Scripts
*
* @param string $page Current page.
*/
public function admin_enqueue_scripts( $page ) {
if ( 'widgets.php' === $page ) {
wp_enqueue_script( 'jquery' );
wp_enqueue_media();
ob_start();
?>
<script>
jQuery( document ).ready(function( $ ) {
var powerkitMediaFrame;
/* Set all variables to be used in scope */
var metaBox = '.author-upload-image';
/* Add Image Link */
$(document).on( 'click', metaBox + ' .upload-img-link', function( event ){
event.preventDefault();
var parentContainer = $( this ).parents( metaBox );
// Options.
var options = {
title: parentContainer.data( 'frame-title' ) ? parentContainer.data( 'frame-title' ) : 'Select or Upload Media',
button: {
text: parentContainer.data( 'frame-btn-text' ) ? parentContainer.data( 'frame-btn-text' ) : 'Use this media',
},
library : { type : 'image' },
multiple: false // Set to true to allow multiple files to be selected.
};
// Create a new media frame
powerkitMediaFrame = wp.media( options );
// When an image is selected in the media frame...
powerkitMediaFrame.on( 'select', function() {
// Get media attachment details from the frame state.
var attachment = powerkitMediaFrame.state().get('selection').first().toJSON();
// Send the attachment URL to our custom image input field.
parentContainer.find( '.uploaded-image' ).html( '<img src="' + attachment.url + '" style="display: block; margin-top: 5px; max-width:100%;"/>' );
parentContainer.find( '.uploaded-img-id' ).val( attachment.id ).change();
parentContainer.find( '.upload-img-link' ).addClass( 'hidden' );
parentContainer.find( '.delete-img-link' ).removeClass( 'hidden' );
powerkitMediaFrame.close();
});
// Finally, open the modal on click.
powerkitMediaFrame.open();
});
/* Delete Image Link */
$( document ).on( 'click', metaBox + ' .delete-img-link', function( event ){
event.preventDefault();
$( this ).parents( metaBox ).find( '.uploaded-image' ).html( '' );
$( this ).parents( metaBox ).find( '.upload-img-link' ).removeClass( 'hidden' );
$( this ).parents( metaBox ).find( '.delete-img-link' ).addClass( 'hidden' );
$( this ).parents( metaBox ).find( '.uploaded-img-id' ).val( '' ).change();
});
});
</script>
<?php
wp_add_inline_script( 'jquery', str_replace( array( '<script>', '</script>' ), '', ob_get_clean() ) );
}
}
}
/**
* Register Widget
*/
function powerkit_widget_author_init() {
register_widget( 'Powerkit_Widget_Author_Init' );
}
add_action( 'widgets_init', 'powerkit_widget_author_init' );
@@ -0,0 +1,107 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.pk-widget-author {
--pk-author-social-link-color: #000000;
--pk-author-with-bg-color: #FFFFFF;
--pk-author-with-bg-links-color: #FFFFFF;
--pk-author-with-bg-links-hover-color: rgba(255,255,255, 0.6);
--pk-author-with-bg-decsription-color: #FFFFFF;
--pk-author-avatar-border-radius: 100%;
--pk-author-description-font-size: 90%;
}
/*--------------------------------------------------------------*/
.pk-widget-author {
position: relative;
text-align: center;
}
.pk-widget-author .pk-widget-author-bg {
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.pk-widget-author .pk-widget-author-bg img {
display: block;
width: 100%;
height: 100%;
-o-object-fit: cover;
object-fit: cover;
font-family: 'object-fit: cover;';
}
.pk-widget-author .pk-widget-author-container {
position: relative;
padding: 0 2rem;
z-index: 2;
}
.pk-widget-author .pk-author-avatar img {
border-radius: var(--pk-author-avatar-border-radius);
}
.pk-widget-author .pk-author-data {
margin-top: 1rem;
}
.pk-widget-author .pk-author-data .author-description {
font-size: var(--pk-author-description-font-size);
}
.pk-widget-author .pk-author-footer {
margin-top: 1rem;
}
.pk-widget-author .pk-author-button {
margin-top: 1rem;
}
.pk-widget-author .pk-social-links-wrap {
margin-top: 1rem;
}
.pk-widget-author .pk-social-links-items {
justify-content: center;
}
.pk-widget-author .pk-social-links-link {
color: var(--pk-author-social-link-color);
}
.pk-author-social-links .pk-social-links-link {
padding: 0 0.25rem;
}
.pk-widget-author-with-bg {
color: var(--pk-author-with-bg-color);
}
.pk-widget-author-with-bg a,
.pk-widget-author-with-bg .section-heading,
.pk-widget-author-with-bg .pk-social-links-link {
color: var(--pk-author-with-bg-links-color) !important;
}
.pk-widget-author-with-bg a:hover,
.pk-widget-author-with-bg .pk-social-links-link:hover {
color: var(--pk-author-with-bg-links-hover-color) !important;
}
.pk-widget-author-with-bg .author-description {
color: var(--pk-author-with-bg-decsription-color) !important;
}
.pk-widget-author-with-bg .pk-widget-author-container {
padding: 2rem;
}
@@ -0,0 +1,107 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.pk-widget-author {
--pk-author-social-link-color: #000000;
--pk-author-with-bg-color: #FFFFFF;
--pk-author-with-bg-links-color: #FFFFFF;
--pk-author-with-bg-links-hover-color: rgba(255,255,255, 0.6);
--pk-author-with-bg-decsription-color: #FFFFFF;
--pk-author-avatar-border-radius: 100%;
--pk-author-description-font-size: 90%;
}
/*--------------------------------------------------------------*/
.pk-widget-author {
position: relative;
text-align: center;
}
.pk-widget-author .pk-widget-author-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.pk-widget-author .pk-widget-author-bg img {
display: block;
width: 100%;
height: 100%;
-o-object-fit: cover;
object-fit: cover;
font-family: 'object-fit: cover;';
}
.pk-widget-author .pk-widget-author-container {
position: relative;
padding: 0 2rem;
z-index: 2;
}
.pk-widget-author .pk-author-avatar img {
border-radius: var(--pk-author-avatar-border-radius);
}
.pk-widget-author .pk-author-data {
margin-top: 1rem;
}
.pk-widget-author .pk-author-data .author-description {
font-size: var(--pk-author-description-font-size);
}
.pk-widget-author .pk-author-footer {
margin-top: 1rem;
}
.pk-widget-author .pk-author-button {
margin-top: 1rem;
}
.pk-widget-author .pk-social-links-wrap {
margin-top: 1rem;
}
.pk-widget-author .pk-social-links-items {
justify-content: center;
}
.pk-widget-author .pk-social-links-link {
color: var(--pk-author-social-link-color);
}
.pk-author-social-links .pk-social-links-link {
padding: 0 0.25rem;
}
.pk-widget-author-with-bg {
color: var(--pk-author-with-bg-color);
}
.pk-widget-author-with-bg a,
.pk-widget-author-with-bg .section-heading,
.pk-widget-author-with-bg .pk-social-links-link {
color: var(--pk-author-with-bg-links-color) !important;
}
.pk-widget-author-with-bg a:hover,
.pk-widget-author-with-bg .pk-social-links-link:hover {
color: var(--pk-author-with-bg-links-hover-color) !important;
}
.pk-widget-author-with-bg .author-description {
color: var(--pk-author-with-bg-decsription-color) !important;
}
.pk-widget-author-with-bg .pk-widget-author-container {
padding: 2rem;
}
@@ -0,0 +1,103 @@
<?php
/**
* Widget Author Template
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package PowerKit
* @subpackage PowerKit/templates
*/
/**
* Default Template
*
* @param int $author The author.
* @param array $args Array of args.
* @param array $params Array of params.
* @param array $instance Widget instance.
*/
function powerkit_widget_author_default_template( $author, $args, $params, $instance ) {
// Before Widget.
echo $args['before_widget']; // XSS.
$avatar_size = apply_filters( 'powerkit_widget_author_avatar_size', 80 );
?>
<div class="widget-body">
<div class="pk-widget-author<?php echo esc_attr( $params['bg_image_id'] ? ' pk-widget-author-with-bg' : '' ); ?>">
<?php if ( $params['bg_image_id'] ) { ?>
<div class="pk-widget-author-bg">
<?php echo wp_get_attachment_image( $params['bg_image_id'], apply_filters( 'powerkit_widget_author_image_size', 'large' ) ); ?>
</div>
<?php } ?>
<div class="pk-widget-author-container<?php echo esc_attr( $params['bg_image_id'] ? ' pk-bg-overlay' : '' ); ?>">
<?php
// Title.
if ( $params['title'] ) {
$params['widget_title'] = $args['before_title'] . apply_filters( 'widget_title', $params['title'], $instance, 0 ) . $args['after_title']; // XSS.
echo wp_kses_post( apply_filters( 'powerkit_widget_author_title', $params['widget_title'], $params['title'] ) );
}
?>
<?php $tag = apply_filters( 'powerkit_widget_author_title_tag', 'h5' ); ?>
<<?php echo esc_html( $tag ); ?> class="pk-author-title">
<a href="<?php echo esc_url( get_author_posts_url( $author ) ); ?>" rel="author">
<?php echo esc_html( get_the_author_meta( 'display_name', $author ) ); ?>
</a>
</<?php echo esc_html( $tag ); ?>>
<?php if ( $params['avatar'] ) { ?>
<div class="pk-author-avatar">
<a href="<?php echo esc_url( get_author_posts_url( $author ) ); ?>" rel="author">
<?php echo get_avatar( $author, $avatar_size ); ?>
</a>
</div>
<?php } ?>
<div class="pk-author-data">
<?php
$description = $params['description_override'] ? $params['description_override'] : get_the_author_meta( 'description', $author );
if ( $params['description'] && $description ) {
?>
<div class="author-description pk-color-secondary">
<?php echo wp_kses_post( powerkit_str_truncate( $description, $params['description_length'] ) ); ?>
</div>
<?php
}
if ( $params['social_accounts'] && powerkit_module_enabled( 'social_links' ) ) {
powerkit_author_social_links( $author );
}
?>
<?php
if ( $params['archive_btn'] ) {
$href = get_author_posts_url( $author );
$text = apply_filters( 'powerkit_widget_author_button', esc_html__( 'View Posts', 'powerkit' ) );
if ( isset( $params['is_block'] ) && isset( $params['block_attrs'] ) && $params['is_block'] ) {
?>
<div class="pk-author-footer">
<?php powerkit_print_gutenberg_blocks_button( $text, $href, '', 'button', $params['block_attrs'] ); ?>
</div>
<?php
} else {
?>
<a href="<?php echo esc_url( $href ); ?>" class="pk-author-button button">
<?php echo wp_kses( $text, 'post' ); ?>
</a>
<?php
}
}
?>
</div>
</div>
</div>
</div>
<?php
// After Widget.
echo $args['after_widget']; // XSS.
}
@@ -0,0 +1,463 @@
<?php
/**
* The admin-specific functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/Admin
*/
/**
* The admin-specific functionality of the module.
*/
class Powerkit_Basic_Elements_Admin extends Powerkit_Module_Admin {
/**
* Initialize
*/
public function initialize() {
add_action( 'wp_ajax_powerkit_basic_shortcodes_sections', array( $this, 'powerkit_basic_shortcodes_ajax_panel' ) );
add_filter( 'mce_buttons', array( $this, 'powerkit_basic_shortcodes_register_buttons' ) );
add_filter( 'mce_external_plugins', array( $this, 'powerkit_basic_shortcodes_register_plugin' ) );
}
/**
* Register shorcodes button for TinyMCE buttons (Visual tab).
*
* @since 1.0.0
* @param array $buttons First-row list of buttons.
* @return array Buttons.
*/
public function powerkit_basic_shortcodes_register_buttons( $buttons ) {
if ( current_user_can( 'edit_posts' ) ) {
array_push( $buttons, 'powerkit_basic_shortcodes_button' );
}
return $buttons;
}
/**
* Register shortcodes plugin
*
* @since 1.0.0
* @param array $plugins An array of external TinyMCE plugins.
* @return array Plugins.
*/
public function powerkit_basic_shortcodes_register_plugin( $plugins ) {
if ( current_user_can( 'edit_posts' ) ) {
$plugins['powerkit_basic_shortcodes'] = trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/admin-powerkit-basic-elements.js';
}
return $plugins;
}
/**
* Generate Section Fileds
*
* @since 1.0.0
* @param array $section Sections Fields.
* @param array $counter Unique field identifier.
*/
public function generate_section_fields( $section, $counter = 0 ) {
if ( isset( $section['fields'] ) && is_array( $section['fields'] ) ) {
// Default Field Settings.
$default_field = array(
'type' => 'input',
'name' => '',
'label' => '',
'desc' => '',
'default' => '',
'attrs' => array(),
'style' => 'vertical', // For radio.
'suffix' => '', // For inputs.
'options' => array(), // For select, radio.
'fields' => array(), // For repeater.
);
foreach ( $section['fields'] as $field ) {
$counter++;
// Merge Settings.
$field = array_merge( $default_field, $field );
// Attrs.
$attrs = null;
if ( ! empty( $field['attrs'] ) ) {
foreach ( $field['attrs'] as $key => $value ) {
$attrs[] = sprintf( '%s="%s"', $key, $value );
}
$attrs = implode( ' ', $attrs );
}
// Output by type.
switch ( $field['type'] ) {
case 'section':
?>
<tr>
<th><h3><?php echo wp_kses_post( $field['label'] ); ?></h3></th><td>&nbsp;</td>
</tr>
<?php
break;
case 'input':
?>
<tr>
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
<td>
<input name="<?php echo esc_attr( $field['name'] ); ?>" type="text" value="<?php echo esc_attr( $field['default'] ); ?>" <?php echo wp_kses_data( $attrs ); ?>><?php echo esc_attr( $field['suffix'] ); ?>
</td>
</tr>
<?php
break;
case 'textarea':
?>
<tr>
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
<td>
<textarea name="<?php echo esc_attr( $field['name'] ); ?>" <?php echo wp_kses_data( $attrs ); ?>><?php echo wp_kses_post( $field['default'] ); ?></textarea>
</td>
</tr>
<?php
break;
case 'select':
?>
<tr>
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
<td>
<select name="<?php echo esc_attr( $field['name'] ); ?>" <?php echo wp_kses_data( $attrs ); ?>>
<?php if ( isset( $field['options'] ) && $field['options'] ) : ?>
<?php foreach ( $field['options'] as $key => $option ) : ?>
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $field['default'], esc_attr( $key ) ); ?>><?php echo esc_attr( $option ); ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</td>
</tr>
<?php
break;
case 'checkbox':
?>
<tr>
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
<td>
<input name="<?php echo esc_attr( $field['name'] ); ?>" type="checkbox" value="true" <?php checked( (bool) $field['default'], true ); ?> <?php echo wp_kses_data( $attrs ); ?>>
</td>
</tr>
<?php
break;
case 'radio':
?>
<tr>
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
<td>
<?php if ( isset( $field['options'] ) && $field['options'] ) : ?>
<?php foreach ( $field['options'] as $key => $option ) : $counter++; ?>
<?php $id = sprintf( 'field-%s-%s-%s', $section['name'], $field['name'], $counter ); ?>
<input id="<?php echo esc_attr( $id ); ?>" name="<?php echo esc_attr( $field['name'] ); ?>" type="radio" value="<?php echo esc_attr( $key ); ?>" <?php checked( $field['default'], $key ); ?> <?php echo wp_kses_data( $attrs ); ?>>
<label for="<?php echo esc_attr( $id ); ?>"><?php echo esc_attr( $option ); ?></label>
<?php if ( 'vertical' === $field['style'] ) : ?>
<br>
<?php else : ?>
&nbsp;
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
</td>
</tr>
<?php
break;
case 'content':
?>
<tr>
<th><?php echo wp_kses_post( $field['label'] ); ?>:<small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
<td>
<textarea name="<?php echo esc_attr( $field['name'] ); ?>" <?php echo wp_kses_data( $attrs ); ?>><?php echo wp_kses_post( $field['default'] ); ?></textarea>
</td>
</tr>
<?php
break;
case 'repeater':
?>
<tr>
<th><?php echo wp_kses_post( $field['label'] ); ?>:</label><small><?php echo wp_kses_post( $field['desc'] ); ?></small></th>
<td class="basic-shortcodes-repeater-field">
<div data-repeater-list="<?php echo esc_attr( $field['base'] ); ?>" >
<table class="form-table" data-repeater-item>
<tbody>
<?php $this->generate_section_fields( $field, $counter ); ?>
</tbody>
<tfoot>
<tr>
<th></th>
<td>
<span class="button-secondary" data-repeater-delete><?php esc_html_e( 'Delete Item', 'powerkit' ); ?></span>
</td>
</tr>
</tfoot>
</table>
</div>
<span data-repeater-create class="button-primary"><?php esc_html_e( 'Add Item', 'powerkit' ); ?></span>
</td>
</tr>
<?php
break;
}
}
}
}
/**
* Ajax Load Admin Shortcodes Panel
*
* @since 1.0.0
*/
public function powerkit_basic_shortcodes_ajax_panel() {
// Allow themes and plugins to enable/disable specific shortcodes UI panel.
$sections = apply_filters( 'powerkit_basic_shortcodes_ui_args', array() );
// Sort elements.
usort( $sections, function ( $a, $b ) {
return $a['priority'] - $b['priority'];
} );
?>
<div class="wrap powerkit_basic_shortcodes_wrap">
<div class="powerkit_basic_shortcodes_tabs">
<ul>
<?php foreach ( $sections as $section ) : ?>
<li><a data-nav="<?php echo esc_attr( $section['name'] ); ?>" href="#"><?php echo esc_html( $section['title'] ); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<div class="powerkit_basic_shortcodes_tabs_sections">
<?php foreach ( $sections as $section ) : ?>
<div class="hidable wrap tabs-<?php echo esc_attr( $section['name'] ); ?>" style="display: none;">
<form class="powerkit_basic_shortcodes_tab" enctype="multipart/form-data">
<table class="form-table">
<tbody>
<?php $this->generate_section_fields( $section ); ?>
<tr>
<th><input type="submit" class="button-primary" value="<?php esc_html_e( 'Insert', 'powerkit' ); ?>"></th>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</form>
</div>
<script type="text/javascript">
/* <![CDATA[ */
(function($) {
// Insert Shortcode.
$('.tabs-<?php echo esc_attr( $section['name'] ); ?> form').submit( function( e ) {
e.preventDefault();
// Hide Popup.
tb_remove();
// Get input values from form.
var fieldsObj = $( this ).serializeObject();
// Vars.
var shortcodeContent = '',
shortcodeAttrs = [];
<?php foreach ( (array) $section['fields'] as $field ) : ?>
var fieldName = '<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : '' ); ?>';
<?php
switch ( $field['type'] ) {
case 'section':
break;
case 'repeater':
?>
var subContentVars = [],
subCheckboxVars = [],
shortcodeBase = '<?php echo esc_attr( $field['base'] ); ?>';
<?php foreach ( (array) $field['fields'] as $sub_field ) : ?>
<?php if ( 'content' === $sub_field['type'] ) : ?>
subContentVars.push( '<?php echo esc_attr( $sub_field['name'] ); ?>' );
<?php endif; ?>
<?php if ( 'checkbox' === $sub_field['type'] ) : ?>
subCheckboxVars.push( '<?php echo esc_attr( $sub_field['name'] ); ?>' );
<?php endif; ?>
<?php endforeach; ?>
if( typeof fieldsObj[ shortcodeBase ] !== 'undefined' ) {
$.each( fieldsObj[ shortcodeBase ], function( key, obj ) {
var subShortcodeContent = '',
subShortcodeAttrs = [];
$.each( obj, function( s_key, s_obj ) {
if( typeof s_obj !== 'undefined' ) {
// Field "Content" fix.
if( ! $.inArray( s_key, subContentVars ) ) {
subShortcodeContent += s_obj;
} else {
// Other fields.
subShortcodeAttrs.push( s_key + '="' + s_obj + '"' );
}
}
} );
// Add Inner Shortcode.
if( subShortcodeContent ) {
shortcodeContent += '[' + shortcodeBase + ' ' + subShortcodeAttrs.join( ' ' ) + ']<br>' + subShortcodeContent + '<br>[/' + shortcodeBase + ']<br>';
} else {
shortcodeContent += '[' + shortcodeBase + ' ' + subShortcodeAttrs.join( ' ' ) + ']<br>';
}
} );
}
<?php
break;
case 'content':
?>
if( typeof fieldsObj[ fieldName ] !== 'undefined' ) {
shortcodeContent += fieldsObj[ fieldName ];
}
<?php
break;
case 'checkbox':
?>
if( typeof fieldsObj[ fieldName ] !== 'undefined' ) {
var fieldAttr = fieldName + '="' + fieldsObj[ fieldName ] + '"';
} else {
var fieldAttr = fieldName + '="false"';
}
shortcodeAttrs.push( fieldAttr );
<?php
break;
default:
?>
if( typeof fieldsObj[ fieldName ] !== 'undefined' ) {
var fieldAttr = fieldName + '="' + fieldsObj[ fieldName ] + '"';
} else {
var fieldAttr = fieldName + '=""';
}
shortcodeAttrs.push( fieldAttr );
<?php
break;
}
?>
<?php endforeach; ?>
// Add Shortcode.
var shortcodeName = '<?php echo esc_attr( $section['base'] ); ?>';
if( shortcodeContent ) {
// Trim Line Breaks.
shortcodeContent = shortcodeContent.replace( /^<br>|<br>$/gm, '' );
var content = '[' + shortcodeName + ' ' + shortcodeAttrs.join( ' ' ) + ']<br>' + shortcodeContent + '<br>[/' + shortcodeName + ']';
} else {
var content = '[' + shortcodeName + ' ' + shortcodeAttrs.join( ' ' ) + ']';
}
// Remove odd space.
content = content.replace(/\s\]/g, ']');
// Convert br.
content = content.replace(/([^>])\n/g, '$1<br/>');
powerkit_basic_shortcodes.setContent( content );
});
})(jQuery);
/* ]]> */
</script>
<?php endforeach; ?>
</div>
<script type="text/javascript">
/* <![CDATA[ */
( function( $ ) {
// Tabs Navigation.
$( '.powerkit_basic_shortcodes_tabs a' ).click( function( e ) {
e.preventDefault();
powerkit_basic_shortcodes_tabs_switch( $( this ) );
} );
powerkit_basic_shortcodes_tabs_switch( $( '.powerkit_basic_shortcodes_tabs a' ).first() );
function powerkit_basic_shortcodes_tabs_switch( obj ) {
$( '.powerkit_basic_shortcodes_tabs_sections .hidable' ).hide();
$( '.powerkit_basic_shortcodes_tabs_sections .tabs-' + obj.attr( 'data-nav' ) ).show();
$( '.powerkit_basic_shortcodes_tabs li' ).removeClass( 'current' );
obj.parent().addClass( 'current' );
}
// Init Repeater.
$( document ).ready( function() {
$( '.basic-shortcodes-repeater-field' ).each( function() {
$( this ).repeater( {
show: function() {
$( this ).slideDown();
},
hide: function( deleteElement ) {
$( this ).fadeOut( 400 );
},
isFirstItemUndeletable: true,
} );
} );
} );
} )( jQuery );
/* ]]> */
</script>
</div>
<?php
die();
}
/**
* Register the stylesheets and JavaScript for the admin area.
*
* @param string $page Current page.
*/
public function admin_enqueue_scripts( $page ) {
add_thickbox();
wp_enqueue_style( 'wp-color-picker' );
// Styles.
wp_enqueue_style( 'powerkit-basic-elements', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/admin-powerkit-basic-elements.css' ), array(), powerkit_get_setting( 'version' ), 'all' );
wp_enqueue_script( 'wp-color-picker' );
// Scripts.
wp_enqueue_script( 'powerkit-jquery-serialize', plugin_dir_url( __FILE__ ) . 'js/jquery.serialize-to-json.min.js', array( 'jquery' ), powerkit_get_setting( 'version' ), false );
wp_enqueue_script( 'powerkit-jquery-repeater', plugin_dir_url( __FILE__ ) . 'js/jquery.repeater.min.js', array( 'jquery' ), powerkit_get_setting( 'version' ), false );
}
}
@@ -0,0 +1,116 @@
.powerkit_basic_shortcodes_wrap {
position: relative;
margin: 0;
height: 97.5%;
}
.powerkit_basic_shortcodes_wrap .form-table td,
.powerkit_basic_shortcodes_wrap .form-table th {
padding-top: 10px;
padding-bottom: 10px;
}
.powerkit_basic_shortcodes_tabs {
width: 200px;
height: 100%;
min-height: 100%;
background: #f9f9f9;
border-left: 1px solid #EEE;
float: right;
overflow-y: auto;
overflow-x: hidden;
font-family: Helvetica, Arial;
color: #333;
font-size: 12px;
text-align: right;
}
.powerkit_basic_shortcodes_tabs ul {
list-style: none;
margin: 0px;
padding: 0px;
}
.powerkit_basic_shortcodes_tabs ul li {
width: 201px;
font-weight: bold;
margin: 0;
}
.powerkit_basic_shortcodes_tabs li.current {
display: block;
margin: 0px;
}
.powerkit_basic_shortcodes_tabs li.current a {
background: #FFF;
box-shadow: 0 -1px 0 #eee;
}
.powerkit_basic_shortcodes_tabs ul li a {
display: block;
padding: 14px 20px;
font-size: 12px;
color: #333;
text-decoration: none;
box-shadow: 0 -1px 0 #eee;
}
.powerkit_basic_shortcodes_tabs ul li:last-child a {
box-shadow: 0 -1px 0 #eee, 0 1px 0 #eee;
}
.powerkit_basic_shortcodes_tabs_sections {
overflow: auto;
height: 100%;
position: relative;
padding: 0 20px 0 0;
margin: 0;
background: #FFF;
}
.powerkit_basic_shortcodes_tabs_sections table tr th small {
display: block;
margin-top: 5px;
color: #777777;
}
/* Repeater */
.powerkit_basic_shortcodes_wrap .basic-shortcodes-repeater-field .form-table th,
.powerkit_basic_shortcodes_wrap .basic-shortcodes-repeater-field .form-table td {
padding: 0;
}
.basic-shortcodes-repeater-field th,
.basic-shortcodes-repeater-field td {
display: block;
padding: 0 0 10px;
width: 100%;
}
.basic-shortcodes-repeater-field tfoot {
text-align: left;
}
.basic-shortcodes-repeater-field tfoot th {
display: none;
}
/* TB_window */
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent {
padding: 0 0 30px 0;
width: 100% !important;
overflow: hidden;
}
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent ul {
margin: 0;
}
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent li {
margin: 0;
}
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent li:before {
display: none;
}
@@ -0,0 +1,116 @@
.powerkit_basic_shortcodes_wrap {
position: relative;
margin: 0;
height: 97.5%;
}
.powerkit_basic_shortcodes_wrap .form-table td,
.powerkit_basic_shortcodes_wrap .form-table th {
padding-top: 10px;
padding-bottom: 10px;
}
.powerkit_basic_shortcodes_tabs {
width: 200px;
height: 100%;
min-height: 100%;
background: #f9f9f9;
border-right: 1px solid #EEE;
float: left;
overflow-y: auto;
overflow-x: hidden;
font-family: Helvetica, Arial;
color: #333;
font-size: 12px;
text-align: left;
}
.powerkit_basic_shortcodes_tabs ul {
list-style: none;
margin: 0px;
padding: 0px;
}
.powerkit_basic_shortcodes_tabs ul li {
width: 201px;
font-weight: bold;
margin: 0;
}
.powerkit_basic_shortcodes_tabs li.current {
display: block;
margin: 0px;
}
.powerkit_basic_shortcodes_tabs li.current a {
background: #FFF;
box-shadow: 0 -1px 0 #eee;
}
.powerkit_basic_shortcodes_tabs ul li a {
display: block;
padding: 14px 20px;
font-size: 12px;
color: #333;
text-decoration: none;
box-shadow: 0 -1px 0 #eee;
}
.powerkit_basic_shortcodes_tabs ul li:last-child a {
box-shadow: 0 -1px 0 #eee, 0 1px 0 #eee;
}
.powerkit_basic_shortcodes_tabs_sections {
overflow: auto;
height: 100%;
position: relative;
padding: 0 0 0 20px;
margin: 0;
background: #FFF;
}
.powerkit_basic_shortcodes_tabs_sections table tr th small {
display: block;
margin-top: 5px;
color: #777777;
}
/* Repeater */
.powerkit_basic_shortcodes_wrap .basic-shortcodes-repeater-field .form-table th,
.powerkit_basic_shortcodes_wrap .basic-shortcodes-repeater-field .form-table td {
padding: 0;
}
.basic-shortcodes-repeater-field th,
.basic-shortcodes-repeater-field td {
display: block;
padding: 0 0 10px;
width: 100%;
}
.basic-shortcodes-repeater-field tfoot {
text-align: right;
}
.basic-shortcodes-repeater-field tfoot th {
display: none;
}
/* TB_window */
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent {
padding: 0 0 30px 0;
width: 100% !important;
overflow: hidden;
}
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent ul {
margin: 0;
}
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent li {
margin: 0;
}
#TB_window.powerkit_basic_shortcodes_window #TB_ajaxContent li:before {
display: none;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

@@ -0,0 +1,49 @@
"use strict";
var powerkit_basic_shortcodes;
var powerkit_basic_shortcodes_content;
( function() {
tinymce.create( 'tinymce.plugins.powerkit_basic_shortcodes', {
init: function( ed, url ) {
ed.addButton( 'powerkit_basic_shortcodes_button', {
title: 'Basic Shortcodes',
image: url.substring( 0, url.length - 3 ) + '/images/icon.png',
onclick: function() {
powerkit_basic_shortcodes = ed.selection;
powerkit_basic_shortcodes_content = ed.selection.getContent();
var width = jQuery( window ).width(),
H = jQuery( window ).height(),
W = ( 720 < width ) ? 720 : width;
W = W - 80;
H = H - 84;
var shortcodes_loaded = jQuery( '#powerkit_basic_shortcodes_holder' ).length;
if ( shortcodes_loaded ) {
tb_show( 'Basic Shortcodes', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=powerkit_basic_shortcodes' );
jQuery( '#TB_window' ).addClass( 'powerkit_basic_shortcodes_window' );
} else {
jQuery( "body" ).append( '<div id="powerkit_basic_shortcodes_holder" style="display: none;"><div id="powerkit_basic_shortcodes"></div></div>' );
jQuery.get( 'admin-ajax.php?action=powerkit_basic_shortcodes_sections', function( data ) {
jQuery( '#powerkit_basic_shortcodes' ).html( data );
tb_show( 'Basic Shortcodes', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=powerkit_basic_shortcodes' );
jQuery( '#TB_window' ).addClass( 'powerkit_basic_shortcodes_window' );
} );
}
}
} );
},
createControl: function( n, cm ) {
return null;
},
} );
tinymce.PluginManager.add( 'powerkit_basic_shortcodes', tinymce.plugins.powerkit_basic_shortcodes );
} )();
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
/**
* jQuery serializeObject
* @copyright 2014, macek <paulmacek@gmail.com>
* @link https://github.com/macek/jquery-serialize-object
* @license BSD
* @version 2.5.0
*/
!function(e,i){if("function"==typeof define&&define.amd)define(["exports","jquery"],function(e,r){return i(e,r)});else if("undefined"!=typeof exports){var r=require("jquery");i(exports,r)}else i(e,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,i){function r(e,r){function n(e,i,r){return e[i]=r,e}function a(e,i){for(var r,a=e.match(t.key);void 0!==(r=a.pop());)if(t.push.test(r)){var u=s(e.replace(/\[\]$/,""));i=n([],u,i)}else t.fixed.test(r)?i=n([],r,i):t.named.test(r)&&(i=n({},r,i));return i}function s(e){return void 0===h[e]&&(h[e]=0),h[e]++}function u(e){switch(i('[name="'+e.name+'"]',r).attr("type")){case"checkbox":return"on"===e.value?!0:e.value;default:return e.value}}function f(i){if(!t.validate.test(i.name))return this;var r=a(i.name,u(i));return l=e.extend(!0,l,r),this}function d(i){if(!e.isArray(i))throw new Error("formSerializer.addPairs expects an Array");for(var r=0,t=i.length;t>r;r++)this.addPair(i[r]);return this}function o(){return l}function c(){return JSON.stringify(o())}var l={},h={};this.addPair=f,this.addPairs=d,this.serialize=o,this.serializeJSON=c}var t={validate:/^[a-z_][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,key:/[a-z0-9_]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_]+$/i};return r.patterns=t,r.serializeObject=function(){return new r(i,this).addPairs(this.serializeArray()).serialize()},r.serializeJSON=function(){return new r(i,this).addPairs(this.serializeArray()).serializeJSON()},"undefined"!=typeof i.fn&&(i.fn.serializeObject=r.serializeObject,i.fn.serializeJSON=r.serializeJSON),e.FormSerializer=r,r});
@@ -0,0 +1,60 @@
<?php
/**
* Basic Elements
*
* @package Powerkit
* @subpackage Modules
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Basic_Elements extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = esc_html__( 'Basic Elements', 'powerkit' );
$this->desc = esc_html__( 'Basic shortcodes with a shortcode generator right in the WordPress editor.', 'powerkit' );
$this->slug = 'basic_elements';
$this->type = 'default';
$this->category = 'basic';
$this->priority = 80;
$this->public = true;
$this->enabled = true;
$this->links = array(
array(
'name' => esc_html__( 'View documentation', 'powerkit' ),
'url' => powerkit_get_setting( 'documentation' ) . '/content-presentation/basic-elements/',
'target' => '_blank',
),
);
}
/**
* Initialize module
*/
public function initialize() {
/* Load the required dependencies for this module */
// Helpers Functions for the module.
require_once dirname( __FILE__ ) . '/helpers/helper-basic-elements.php';
// Admin and public area.
require_once dirname( __FILE__ ) . '/admin/class-powerkit-basic-elements-admin.php';
require_once dirname( __FILE__ ) . '/public/class-powerkit-basic-elements-public.php';
// Include default templates.
powerkit_basic_shortcodes_autoload( dirname( __FILE__ ) . '/templates' );
new Powerkit_Basic_Elements_Admin( $this->slug );
new Powerkit_Basic_Elements_Public( $this->slug );
}
}
new Powerkit_Basic_Elements();
}
@@ -0,0 +1,69 @@
<?php
/**
* Helpers Social Links
*
* @package Powerkit
* @subpackage Modules/Helper
*/
/**
* Register Shortcodes
*
* @param array $map Shortcode parameters.
*/
function powerkit_basic_shortcodes_register( $map ) {
add_filter( 'powerkit_basic_shortcodes_ui_args', function( $sections ) use ( $map ) {
$sections[] = $map;
return $sections;
} );
}
/**
* Autoload files in the directory.
*
* @param string $path Directory path.
* @param string $pattern Regex pattern.
* @since 1.0.0
*/
function powerkit_basic_shortcodes_autoload( $path, $pattern = false ) {
if ( is_dir( $path ) ) {
$files = scandir( $path );
} else {
return false;
}
// loop folders.
foreach ( $files as $file ) {
$path_file = $path . '/' . basename( $file );
if ( $pattern && ! preg_match( "/$pattern/", basename( $file ) ) ) {
continue;
}
if ( file_exists( $path_file ) && 'index.php' !== $file ) {
if ( is_dir( $path_file ) && file_exists( $path_file . "/$file.php" ) ) {
require_once $path_file . "/$file.php";
} elseif ( is_file( $path_file ) && preg_match( '/\.php$/i', $path_file ) ) {
require_once $path_file;
}
}
}
}
/**
* Clean shortcodes
*
* @param string $content Post content.
* @return string Filtered Post content.
*/
function powerkit_basic_shortcodes_clean( $content ) {
$array = array(
'<p>[' => '[',
']</p>' => ']',
']<br />' => ']',
);
$content = strtr( $content, $array );
return $content;
}
add_filter( 'the_content', 'powerkit_basic_shortcodes_clean' );
@@ -0,0 +1,140 @@
<?php
/**
* The public-facing functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/public
*/
/**
* The public-facing functionality of the module.
*/
class Powerkit_Basic_Elements_Public extends Powerkit_Module_Public {
/**
* Initialize
*/
public function initialize() {
add_action( 'init', array( $this, 'register_custom_shortcodes' ) );
$this->register_shortcodes();
}
/**
* Shortcodes custom.
*
* @since 1.0.0
* @access public
*/
public function register_custom_shortcodes() {
$dir_path = apply_filters( 'powerkit_basic_shortcodes_autoload_path', 'shortcodes' );
$custom_path = wp_normalize_path( get_template_directory() . '/' . $dir_path );
if ( file_exists( $custom_path ) ) {
powerkit_basic_shortcodes_autoload( $custom_path );
}
}
/**
* Register Shortcodes
*
* @since 1.0.0
* @access private
*/
private function register_shortcodes() {
// Get all shortcodes.
$sections = apply_filters( 'powerkit_basic_shortcodes_ui_args', array() );
// Add shortcodes.
foreach ( $sections as $section ) {
if ( true === $section['autoregister'] ) {
add_shortcode( $section['base'], array( $this, 'shortcode_display' ) );
}
// Repeat Shortcodes.
if ( ! empty( $section['fields'] ) ) {
foreach ( $section['fields'] as $field ) {
if ( 'repeater' === $field['type'] && true === $field['autoregister'] ) {
add_shortcode( $field['base'], array( $this, 'shortcode_display' ) );
}
}
}
}
}
/**
* Shortcode Public Display
*
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode Content.
* @param string $shortcode The name of the shortcode.
* @return string Shortcode result HTML.
*/
public function shortcode_display( $atts, $content = false, $shortcode = '' ) {
// Get all shortcodes.
$sections = apply_filters( 'powerkit_basic_shortcodes_ui_args', array() );
// Get Default Attrs.
$default_attrs = array();
foreach ( $sections as $section ) {
if ( isset( $section['fields'] ) && is_array( $section['fields'] ) ) {
foreach ( $section['fields'] as $field ) {
switch ( $field['type'] ) {
case 'section':
break;
case 'repeater':
if ( $field['base'] === $shortcode ) {
foreach ( $field['fields'] as $repeater_field ) {
$default_attrs[ $repeater_field['name'] ] = $repeater_field['default'] ? $repeater_field['default'] : '';
}
}
break;
default:
if ( $section['base'] === $shortcode ) {
$default_attrs[ $field['name'] ] = $field['default'] ? $field['default'] : '';
}
break;
}
}
}
}
// Merge Attrs.
$atts = shortcode_atts( $default_attrs, $atts );
// Content.
$content = do_shortcode( $content );
/**
* Filters a shortcode's HTML.
*
* @param array $output Shortcode HTML.
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode tag content.
* @return string Shortcode result HTML.
*/
$output = apply_filters( $shortcode . '_shortcode', '', $atts, $content );
return $output;
}
/**
* Register the stylesheets for the public-facing side of the site.
*/
public function wp_enqueue_scripts() {
// Styles.
wp_enqueue_style( 'powerkit-basic-elements', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-basic-elements.css' ), false, powerkit_get_setting( 'version' ), 'screen' );
// Add RTL support.
wp_style_add_data( 'powerkit-basic-elements', 'rtl', 'replace' );
// Scripts.
wp_enqueue_script( 'powerkit-basic-elements', plugin_dir_url( __FILE__ ) . 'js/public-powerkit-basic-elements.js', array( 'jquery' ), '4.0.0', true );
}
}
@@ -0,0 +1,882 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.pk-tabs,
.pk-pills,
.pk-accordion,
.pk-progress,
.pk-button.pk-button-block {
margin-bottom: 2rem;
}
/* Buttons */
/*--------------------------------------------------------------*/
.pk-button {
display: inline-block;
font-weight: 400;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
padding: 0.375rem 0.75rem;
font-size: 1rem;
line-height: 1.5;
border-radius: 0.25rem;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
color: white;
border: none;
box-shadow: none !important;
text-decoration: none !important;
}
@media (prefers-reduced-motion: reduce) {
.pk-button {
transition: none;
}
}
.pk-button:hover, .pk-button:focus {
text-decoration: none;
}
.pk-button:focus, .pk-button.focus {
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.pk-button-primary {
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.pk-button-primary:hover {
color: #fff;
background-color: #0069d9;
border-color: #0062cc;
}
.pk-button-primary:focus, .pk-button-primary.focus {
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}
.pk-button-primary.disabled, .pk-button-primary:disabled {
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.pk-button-primary:not(:disabled):not(.disabled):active, .pk-button-primary:not(:disabled):not(.disabled).active,
.show > .pk-button-primary.dropdown-toggle {
color: #fff;
background-color: #0062cc;
border-color: #005cbf;
}
.pk-button-primary:not(:disabled):not(.disabled):active:focus, .pk-button-primary:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-primary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}
.pk-button-secondary {
color: #212529;
background-color: #A0A0A0;
border-color: #A0A0A0;
}
.pk-button-secondary:hover {
color: #fff;
background-color: #8d8d8d;
border-color: #878686;
}
.pk-button-secondary:focus, .pk-button-secondary.focus {
box-shadow: 0 0 0 0.2rem rgba(141, 142, 142, 0.5);
}
.pk-button-secondary.disabled, .pk-button-secondary:disabled {
color: #212529;
background-color: #A0A0A0;
border-color: #A0A0A0;
}
.pk-button-secondary:not(:disabled):not(.disabled):active, .pk-button-secondary:not(:disabled):not(.disabled).active,
.show > .pk-button-secondary.dropdown-toggle {
color: #fff;
background-color: #878686;
border-color: gray;
}
.pk-button-secondary:not(:disabled):not(.disabled):active:focus, .pk-button-secondary:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-secondary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(141, 142, 142, 0.5);
}
.pk-button-success {
color: #fff;
background-color: #28a745;
border-color: #28a745;
}
.pk-button-success:hover {
color: #fff;
background-color: #218838;
border-color: #1e7e34;
}
.pk-button-success:focus, .pk-button-success.focus {
box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);
}
.pk-button-success.disabled, .pk-button-success:disabled {
color: #fff;
background-color: #28a745;
border-color: #28a745;
}
.pk-button-success:not(:disabled):not(.disabled):active, .pk-button-success:not(:disabled):not(.disabled).active,
.show > .pk-button-success.dropdown-toggle {
color: #fff;
background-color: #1e7e34;
border-color: #1c7430;
}
.pk-button-success:not(:disabled):not(.disabled):active:focus, .pk-button-success:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-success.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);
}
.pk-button-info {
color: #fff;
background-color: #17a2b8;
border-color: #17a2b8;
}
.pk-button-info:hover {
color: #fff;
background-color: #138496;
border-color: #117a8b;
}
.pk-button-info:focus, .pk-button-info.focus {
box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
}
.pk-button-info.disabled, .pk-button-info:disabled {
color: #fff;
background-color: #17a2b8;
border-color: #17a2b8;
}
.pk-button-info:not(:disabled):not(.disabled):active, .pk-button-info:not(:disabled):not(.disabled).active,
.show > .pk-button-info.dropdown-toggle {
color: #fff;
background-color: #117a8b;
border-color: #10707f;
}
.pk-button-info:not(:disabled):not(.disabled):active:focus, .pk-button-info:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-info.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
}
.pk-button-warning {
color: #212529;
background-color: #ffc107;
border-color: #ffc107;
}
.pk-button-warning:hover {
color: #212529;
background-color: #e0a800;
border-color: #d39e00;
}
.pk-button-warning:focus, .pk-button-warning.focus {
box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);
}
.pk-button-warning.disabled, .pk-button-warning:disabled {
color: #212529;
background-color: #ffc107;
border-color: #ffc107;
}
.pk-button-warning:not(:disabled):not(.disabled):active, .pk-button-warning:not(:disabled):not(.disabled).active,
.show > .pk-button-warning.dropdown-toggle {
color: #212529;
background-color: #d39e00;
border-color: #c69500;
}
.pk-button-warning:not(:disabled):not(.disabled):active:focus, .pk-button-warning:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-warning.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);
}
.pk-button-danger {
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
}
.pk-button-danger:hover {
color: #fff;
background-color: #c82333;
border-color: #bd2130;
}
.pk-button-danger:focus, .pk-button-danger.focus {
box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);
}
.pk-button-danger.disabled, .pk-button-danger:disabled {
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
}
.pk-button-danger:not(:disabled):not(.disabled):active, .pk-button-danger:not(:disabled):not(.disabled).active,
.show > .pk-button-danger.dropdown-toggle {
color: #fff;
background-color: #bd2130;
border-color: #b21f2d;
}
.pk-button-danger:not(:disabled):not(.disabled):active:focus, .pk-button-danger:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-danger.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);
}
.pk-button-light {
color: #212529;
background-color: #f8f9fa;
border-color: #f8f9fa;
}
.pk-button-light:hover {
color: #212529;
background-color: #e2e6ea;
border-color: #dae0e5;
}
.pk-button-light:focus, .pk-button-light.focus {
box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5);
}
.pk-button-light.disabled, .pk-button-light:disabled {
color: #212529;
background-color: #f8f9fa;
border-color: #f8f9fa;
}
.pk-button-light:not(:disabled):not(.disabled):active, .pk-button-light:not(:disabled):not(.disabled).active,
.show > .pk-button-light.dropdown-toggle {
color: #212529;
background-color: #dae0e5;
border-color: #d3d9df;
}
.pk-button-light:not(:disabled):not(.disabled):active:focus, .pk-button-light:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-light.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5);
}
.pk-button-dark {
color: #fff;
background-color: #343a40;
border-color: #343a40;
}
.pk-button-dark:hover {
color: #fff;
background-color: #23272b;
border-color: #1d2124;
}
.pk-button-dark:focus, .pk-button-dark.focus {
box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);
}
.pk-button-dark.disabled, .pk-button-dark:disabled {
color: #fff;
background-color: #343a40;
border-color: #343a40;
}
.pk-button-dark:not(:disabled):not(.disabled):active, .pk-button-dark:not(:disabled):not(.disabled).active,
.show > .pk-button-dark.dropdown-toggle {
color: #fff;
background-color: #1d2124;
border-color: #171a1d;
}
.pk-button-dark:not(:disabled):not(.disabled):active:focus, .pk-button-dark:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-dark.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);
}
.pk-button-outline-primary {
color: #007bff;
border-color: #007bff;
}
.pk-button-outline-primary:hover {
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.pk-button-outline-primary:focus, .pk-button-outline-primary.focus {
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}
.pk-button-outline-primary.disabled, .pk-button-outline-primary:disabled {
color: #007bff;
background-color: transparent;
}
.pk-button-outline-primary:not(:disabled):not(.disabled):active, .pk-button-outline-primary:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-primary.dropdown-toggle {
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.pk-button-outline-primary:not(:disabled):not(.disabled):active:focus, .pk-button-outline-primary:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-primary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}
.pk-button-outline-secondary {
color: #A0A0A0;
border-color: #A0A0A0;
}
.pk-button-outline-secondary:hover {
color: #212529;
background-color: #A0A0A0;
border-color: #A0A0A0;
}
.pk-button-outline-secondary:focus, .pk-button-outline-secondary.focus {
box-shadow: 0 0 0 0.2rem rgba(160, 160, 160, 0.5);
}
.pk-button-outline-secondary.disabled, .pk-button-outline-secondary:disabled {
color: #A0A0A0;
background-color: transparent;
}
.pk-button-outline-secondary:not(:disabled):not(.disabled):active, .pk-button-outline-secondary:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-secondary.dropdown-toggle {
color: #212529;
background-color: #A0A0A0;
border-color: #A0A0A0;
}
.pk-button-outline-secondary:not(:disabled):not(.disabled):active:focus, .pk-button-outline-secondary:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-secondary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(160, 160, 160, 0.5);
}
.pk-button-outline-success {
color: #28a745;
border-color: #28a745;
}
.pk-button-outline-success:hover {
color: #fff;
background-color: #28a745;
border-color: #28a745;
}
.pk-button-outline-success:focus, .pk-button-outline-success.focus {
box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
}
.pk-button-outline-success.disabled, .pk-button-outline-success:disabled {
color: #28a745;
background-color: transparent;
}
.pk-button-outline-success:not(:disabled):not(.disabled):active, .pk-button-outline-success:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-success.dropdown-toggle {
color: #fff;
background-color: #28a745;
border-color: #28a745;
}
.pk-button-outline-success:not(:disabled):not(.disabled):active:focus, .pk-button-outline-success:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-success.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
}
.pk-button-outline-info {
color: #17a2b8;
border-color: #17a2b8;
}
.pk-button-outline-info:hover {
color: #fff;
background-color: #17a2b8;
border-color: #17a2b8;
}
.pk-button-outline-info:focus, .pk-button-outline-info.focus {
box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);
}
.pk-button-outline-info.disabled, .pk-button-outline-info:disabled {
color: #17a2b8;
background-color: transparent;
}
.pk-button-outline-info:not(:disabled):not(.disabled):active, .pk-button-outline-info:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-info.dropdown-toggle {
color: #fff;
background-color: #17a2b8;
border-color: #17a2b8;
}
.pk-button-outline-info:not(:disabled):not(.disabled):active:focus, .pk-button-outline-info:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-info.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);
}
.pk-button-outline-warning {
color: #ffc107;
border-color: #ffc107;
}
.pk-button-outline-warning:hover {
color: #212529;
background-color: #ffc107;
border-color: #ffc107;
}
.pk-button-outline-warning:focus, .pk-button-outline-warning.focus {
box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
}
.pk-button-outline-warning.disabled, .pk-button-outline-warning:disabled {
color: #ffc107;
background-color: transparent;
}
.pk-button-outline-warning:not(:disabled):not(.disabled):active, .pk-button-outline-warning:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-warning.dropdown-toggle {
color: #212529;
background-color: #ffc107;
border-color: #ffc107;
}
.pk-button-outline-warning:not(:disabled):not(.disabled):active:focus, .pk-button-outline-warning:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-warning.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
}
.pk-button-outline-danger {
color: #dc3545;
border-color: #dc3545;
}
.pk-button-outline-danger:hover {
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
}
.pk-button-outline-danger:focus, .pk-button-outline-danger.focus {
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
}
.pk-button-outline-danger.disabled, .pk-button-outline-danger:disabled {
color: #dc3545;
background-color: transparent;
}
.pk-button-outline-danger:not(:disabled):not(.disabled):active, .pk-button-outline-danger:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-danger.dropdown-toggle {
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
}
.pk-button-outline-danger:not(:disabled):not(.disabled):active:focus, .pk-button-outline-danger:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-danger.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
}
.pk-button-outline-light {
color: #f8f9fa;
border-color: #f8f9fa;
}
.pk-button-outline-light:hover {
color: #212529;
background-color: #f8f9fa;
border-color: #f8f9fa;
}
.pk-button-outline-light:focus, .pk-button-outline-light.focus {
box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);
}
.pk-button-outline-light.disabled, .pk-button-outline-light:disabled {
color: #f8f9fa;
background-color: transparent;
}
.pk-button-outline-light:not(:disabled):not(.disabled):active, .pk-button-outline-light:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-light.dropdown-toggle {
color: #212529;
background-color: #f8f9fa;
border-color: #f8f9fa;
}
.pk-button-outline-light:not(:disabled):not(.disabled):active:focus, .pk-button-outline-light:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-light.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);
}
.pk-button-outline-dark {
color: #343a40;
border-color: #343a40;
}
.pk-button-outline-dark:hover {
color: #fff;
background-color: #343a40;
border-color: #343a40;
}
.pk-button-outline-dark:focus, .pk-button-outline-dark.focus {
box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);
}
.pk-button-outline-dark.disabled, .pk-button-outline-dark:disabled {
color: #343a40;
background-color: transparent;
}
.pk-button-outline-dark:not(:disabled):not(.disabled):active, .pk-button-outline-dark:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-dark.dropdown-toggle {
color: #fff;
background-color: #343a40;
border-color: #343a40;
}
.pk-button-outline-dark:not(:disabled):not(.disabled):active:focus, .pk-button-outline-dark:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-dark.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);
}
.pk-button-lg {
padding: 0.5rem 1rem;
font-size: 1.25rem;
line-height: 1.5;
border-radius: 0.3rem;
}
.pk-button-sm {
padding: 0.25rem 0.5rem;
font-size: 0.875rem;
line-height: 1.5;
border-radius: 0.2rem;
}
.pk-button-block {
display: block;
width: 100%;
}
.pk-button-block + .pk-button-block {
margin-top: 0.5rem;
}
/* Tabs */
/*--------------------------------------------------------------*/
.pk-nav {
display: flex;
flex-direction: column;
flex-wrap: wrap;
padding-right: 0;
margin-bottom: 0;
list-style: none;
}
.pk-fade {
transition: opacity 0.15s linear;
}
@media (prefers-reduced-motion: reduce) {
.pk-fade {
transition: none;
}
}
.pk-nav-link {
display: block;
}
.pk-nav-link:hover, .pk-nav-link:focus {
text-decoration: none;
}
.pk-nav-tabs .pk-nav-item + .pk-nav-item .pk-nav-link {
margin-top: 0.5rem;
}
.pk-nav-tabs .pk-nav-link {
border: 1px solid transparent;
border-color: #dee2e6;
color: #adb5bd;
border-top-right-radius: 0.25rem;
border-top-left-radius: 0.25rem;
}
.pk-nav-tabs .pk-nav-link.pk-active {
color: #000;
background-color: #FFFFFF;
}
.pk-nav-tabs .pk-nav-link:hover, .pk-nav-tabs .pk-nav-link:focus {
color: #212529;
}
.pk-tab-content > .pk-tab-pane {
display: none;
}
.pk-tab-content > .pk-active {
display: block;
}
.pk-tabs .pk-nav {
margin-bottom: 1.5rem;
}
.pk-tabs .pk-nav-link {
padding: 1rem 1.5rem;
line-height: 1;
font-size: 1rem;
text-decoration: none !important;
box-shadow: none !important;
}
.pk-tabs .pk-tab-pane > *:last-child {
margin-bottom: 0;
}
.pk-tabs .pk-nav-tabs .pk-nav-link.pk-active {
background-color: #f8f9fa;
}
.pk-tabs .pk-nav-pills .pk-nav-link {
border-radius: 0.25rem;
padding: 0.75rem 1rem;
line-height: 1;
color: #adb5bd;
}
.pk-tabs .pk-nav-pills .pk-nav-link.pk-active {
color: #000;
background-color: #e9ecef;
}
@media (min-width: 768px) {
.pk-tabs .pk-nav-item + .pk-nav-item .pk-nav-link {
margin-top: 0;
}
.pk-tabs .pk-nav-link:not(.pk-active) {
border-color: transparent;
}
.pk-tabs .pk-nav-tabs .pk-nav-link.pk-active {
background-color: transparent;
}
.pk-tabs-horizontal .pk-nav {
flex-direction: row;
}
.pk-tabs-horizontal .pk-nav-tabs {
border-bottom: 1px solid #dee2e6;
}
.pk-tabs-horizontal .pk-nav-item {
transform: translateY(1px);
}
.pk-tabs-horizontal .pk-nav-link.pk-active {
border-bottom-color: #fff;
}
.pk-tabs-vertical .pk-tabs-container {
display: flex;
}
.pk-tabs-vertical .pk-tabs-navigation {
flex: 0 0 30%;
}
.pk-tabs-vertical .pk-tabs-navigation .pk-nav {
margin-bottom: 0;
}
.pk-tabs-vertical .pk-tabs-navigation .pk-nav-item {
width: 100%;
max-width: 100%;
transform: translateX(-1px);
}
.pk-tabs-vertical .pk-tabs-content {
margin-right: 5%;
flex: 0 0 65%;
}
.pk-tabs-vertical .pk-nav-tabs {
border-left: 1px solid #dee2e6;
flex-direction: column;
height: 100%;
}
.pk-tabs-vertical .pk-nav-tabs .pk-nav-link {
border-radius: 0 0.25rem 0.25rem 0;
}
.pk-tabs-vertical .pk-nav-tabs .pk-nav-link.pk-active {
border-left-color: #fff;
}
.pk-tabs-vertical .pk-nav-pills {
flex-direction: column;
}
}
/* Collapsibles */
/*--------------------------------------------------------------*/
.pk-card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
margin-bottom: 0;
background-clip: border-box;
}
.pk-card + .pk-card {
border-top: 1px solid #e9ecef;
}
.pk-collapsing {
position: relative;
height: 0;
overflow: hidden;
}
.pk-card-body {
flex: 1 1 auto;
padding: 0.75rem 0;
}
.pk-card-header {
margin-bottom: 0;
}
.pk-card-header .pk-card-title {
margin-top: 0;
margin-bottom: 0;
}
.pk-card-header a {
display: flex;
justify-content: space-between;
padding: 0.75rem 0;
border: none;
color: #212529;
transition: 0.3s;
text-decoration: none !important;
box-shadow: none !important;
}
.pk-card-header a:hover {
color: #adb5bd;
}
.pk-card-header a:after {
font-family: 'powerkit-icons';
content: "\e90d";
transition: 0.3s;
}
.pk-card.expanded .pk-card-header a {
color: inherit;
}
.pk-card.expanded .pk-card-header a:after {
transform: rotate(90deg);
}
/* Progress */
/*--------------------------------------------------------------*/
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 1rem 0;
}
to {
background-position: 0 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 1rem 0;
}
to {
background-position: 0 0;
}
}
.pk-progress {
display: flex;
height: 1rem;
overflow: hidden;
font-size: 0.75rem;
background-color: #e9ecef;
border-radius: 0.25rem;
}
.pk-progress-bar {
display: flex;
flex-direction: column;
justify-content: center;
color: #fff;
text-align: center;
white-space: nowrap;
transition: width 0.6s ease;
}
@media (prefers-reduced-motion: reduce) {
.pk-progress-bar {
transition: none;
}
}
.pk-progress-bar.pk-bg-primary {
background-color: #007bff;
}
.pk-progress-bar-striped {
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-size: 1rem 1rem;
}
.pk-progress-bar-animated {
-webkit-animation: progress-bar-stripes 1s linear infinite;
animation: progress-bar-stripes 1s linear infinite;
}
/* Separators */
/*--------------------------------------------------------------*/
.pk-separator {
border-bottom-color: #ddd;
margin-top: 2rem;
margin-bottom: 2rem;
}
@@ -0,0 +1,882 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.pk-tabs,
.pk-pills,
.pk-accordion,
.pk-progress,
.pk-button.pk-button-block {
margin-bottom: 2rem;
}
/* Buttons */
/*--------------------------------------------------------------*/
.pk-button {
display: inline-block;
font-weight: 400;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
padding: 0.375rem 0.75rem;
font-size: 1rem;
line-height: 1.5;
border-radius: 0.25rem;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
color: white;
border: none;
box-shadow: none !important;
text-decoration: none !important;
}
@media (prefers-reduced-motion: reduce) {
.pk-button {
transition: none;
}
}
.pk-button:hover, .pk-button:focus {
text-decoration: none;
}
.pk-button:focus, .pk-button.focus {
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.pk-button-primary {
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.pk-button-primary:hover {
color: #fff;
background-color: #0069d9;
border-color: #0062cc;
}
.pk-button-primary:focus, .pk-button-primary.focus {
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}
.pk-button-primary.disabled, .pk-button-primary:disabled {
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.pk-button-primary:not(:disabled):not(.disabled):active, .pk-button-primary:not(:disabled):not(.disabled).active,
.show > .pk-button-primary.dropdown-toggle {
color: #fff;
background-color: #0062cc;
border-color: #005cbf;
}
.pk-button-primary:not(:disabled):not(.disabled):active:focus, .pk-button-primary:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-primary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}
.pk-button-secondary {
color: #212529;
background-color: #A0A0A0;
border-color: #A0A0A0;
}
.pk-button-secondary:hover {
color: #fff;
background-color: #8d8d8d;
border-color: #878686;
}
.pk-button-secondary:focus, .pk-button-secondary.focus {
box-shadow: 0 0 0 0.2rem rgba(141, 142, 142, 0.5);
}
.pk-button-secondary.disabled, .pk-button-secondary:disabled {
color: #212529;
background-color: #A0A0A0;
border-color: #A0A0A0;
}
.pk-button-secondary:not(:disabled):not(.disabled):active, .pk-button-secondary:not(:disabled):not(.disabled).active,
.show > .pk-button-secondary.dropdown-toggle {
color: #fff;
background-color: #878686;
border-color: gray;
}
.pk-button-secondary:not(:disabled):not(.disabled):active:focus, .pk-button-secondary:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-secondary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(141, 142, 142, 0.5);
}
.pk-button-success {
color: #fff;
background-color: #28a745;
border-color: #28a745;
}
.pk-button-success:hover {
color: #fff;
background-color: #218838;
border-color: #1e7e34;
}
.pk-button-success:focus, .pk-button-success.focus {
box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);
}
.pk-button-success.disabled, .pk-button-success:disabled {
color: #fff;
background-color: #28a745;
border-color: #28a745;
}
.pk-button-success:not(:disabled):not(.disabled):active, .pk-button-success:not(:disabled):not(.disabled).active,
.show > .pk-button-success.dropdown-toggle {
color: #fff;
background-color: #1e7e34;
border-color: #1c7430;
}
.pk-button-success:not(:disabled):not(.disabled):active:focus, .pk-button-success:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-success.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);
}
.pk-button-info {
color: #fff;
background-color: #17a2b8;
border-color: #17a2b8;
}
.pk-button-info:hover {
color: #fff;
background-color: #138496;
border-color: #117a8b;
}
.pk-button-info:focus, .pk-button-info.focus {
box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
}
.pk-button-info.disabled, .pk-button-info:disabled {
color: #fff;
background-color: #17a2b8;
border-color: #17a2b8;
}
.pk-button-info:not(:disabled):not(.disabled):active, .pk-button-info:not(:disabled):not(.disabled).active,
.show > .pk-button-info.dropdown-toggle {
color: #fff;
background-color: #117a8b;
border-color: #10707f;
}
.pk-button-info:not(:disabled):not(.disabled):active:focus, .pk-button-info:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-info.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
}
.pk-button-warning {
color: #212529;
background-color: #ffc107;
border-color: #ffc107;
}
.pk-button-warning:hover {
color: #212529;
background-color: #e0a800;
border-color: #d39e00;
}
.pk-button-warning:focus, .pk-button-warning.focus {
box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);
}
.pk-button-warning.disabled, .pk-button-warning:disabled {
color: #212529;
background-color: #ffc107;
border-color: #ffc107;
}
.pk-button-warning:not(:disabled):not(.disabled):active, .pk-button-warning:not(:disabled):not(.disabled).active,
.show > .pk-button-warning.dropdown-toggle {
color: #212529;
background-color: #d39e00;
border-color: #c69500;
}
.pk-button-warning:not(:disabled):not(.disabled):active:focus, .pk-button-warning:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-warning.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);
}
.pk-button-danger {
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
}
.pk-button-danger:hover {
color: #fff;
background-color: #c82333;
border-color: #bd2130;
}
.pk-button-danger:focus, .pk-button-danger.focus {
box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);
}
.pk-button-danger.disabled, .pk-button-danger:disabled {
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
}
.pk-button-danger:not(:disabled):not(.disabled):active, .pk-button-danger:not(:disabled):not(.disabled).active,
.show > .pk-button-danger.dropdown-toggle {
color: #fff;
background-color: #bd2130;
border-color: #b21f2d;
}
.pk-button-danger:not(:disabled):not(.disabled):active:focus, .pk-button-danger:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-danger.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);
}
.pk-button-light {
color: #212529;
background-color: #f8f9fa;
border-color: #f8f9fa;
}
.pk-button-light:hover {
color: #212529;
background-color: #e2e6ea;
border-color: #dae0e5;
}
.pk-button-light:focus, .pk-button-light.focus {
box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5);
}
.pk-button-light.disabled, .pk-button-light:disabled {
color: #212529;
background-color: #f8f9fa;
border-color: #f8f9fa;
}
.pk-button-light:not(:disabled):not(.disabled):active, .pk-button-light:not(:disabled):not(.disabled).active,
.show > .pk-button-light.dropdown-toggle {
color: #212529;
background-color: #dae0e5;
border-color: #d3d9df;
}
.pk-button-light:not(:disabled):not(.disabled):active:focus, .pk-button-light:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-light.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5);
}
.pk-button-dark {
color: #fff;
background-color: #343a40;
border-color: #343a40;
}
.pk-button-dark:hover {
color: #fff;
background-color: #23272b;
border-color: #1d2124;
}
.pk-button-dark:focus, .pk-button-dark.focus {
box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);
}
.pk-button-dark.disabled, .pk-button-dark:disabled {
color: #fff;
background-color: #343a40;
border-color: #343a40;
}
.pk-button-dark:not(:disabled):not(.disabled):active, .pk-button-dark:not(:disabled):not(.disabled).active,
.show > .pk-button-dark.dropdown-toggle {
color: #fff;
background-color: #1d2124;
border-color: #171a1d;
}
.pk-button-dark:not(:disabled):not(.disabled):active:focus, .pk-button-dark:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-dark.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);
}
.pk-button-outline-primary {
color: #007bff;
border-color: #007bff;
}
.pk-button-outline-primary:hover {
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.pk-button-outline-primary:focus, .pk-button-outline-primary.focus {
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}
.pk-button-outline-primary.disabled, .pk-button-outline-primary:disabled {
color: #007bff;
background-color: transparent;
}
.pk-button-outline-primary:not(:disabled):not(.disabled):active, .pk-button-outline-primary:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-primary.dropdown-toggle {
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.pk-button-outline-primary:not(:disabled):not(.disabled):active:focus, .pk-button-outline-primary:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-primary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}
.pk-button-outline-secondary {
color: #A0A0A0;
border-color: #A0A0A0;
}
.pk-button-outline-secondary:hover {
color: #212529;
background-color: #A0A0A0;
border-color: #A0A0A0;
}
.pk-button-outline-secondary:focus, .pk-button-outline-secondary.focus {
box-shadow: 0 0 0 0.2rem rgba(160, 160, 160, 0.5);
}
.pk-button-outline-secondary.disabled, .pk-button-outline-secondary:disabled {
color: #A0A0A0;
background-color: transparent;
}
.pk-button-outline-secondary:not(:disabled):not(.disabled):active, .pk-button-outline-secondary:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-secondary.dropdown-toggle {
color: #212529;
background-color: #A0A0A0;
border-color: #A0A0A0;
}
.pk-button-outline-secondary:not(:disabled):not(.disabled):active:focus, .pk-button-outline-secondary:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-secondary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(160, 160, 160, 0.5);
}
.pk-button-outline-success {
color: #28a745;
border-color: #28a745;
}
.pk-button-outline-success:hover {
color: #fff;
background-color: #28a745;
border-color: #28a745;
}
.pk-button-outline-success:focus, .pk-button-outline-success.focus {
box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
}
.pk-button-outline-success.disabled, .pk-button-outline-success:disabled {
color: #28a745;
background-color: transparent;
}
.pk-button-outline-success:not(:disabled):not(.disabled):active, .pk-button-outline-success:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-success.dropdown-toggle {
color: #fff;
background-color: #28a745;
border-color: #28a745;
}
.pk-button-outline-success:not(:disabled):not(.disabled):active:focus, .pk-button-outline-success:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-success.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
}
.pk-button-outline-info {
color: #17a2b8;
border-color: #17a2b8;
}
.pk-button-outline-info:hover {
color: #fff;
background-color: #17a2b8;
border-color: #17a2b8;
}
.pk-button-outline-info:focus, .pk-button-outline-info.focus {
box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);
}
.pk-button-outline-info.disabled, .pk-button-outline-info:disabled {
color: #17a2b8;
background-color: transparent;
}
.pk-button-outline-info:not(:disabled):not(.disabled):active, .pk-button-outline-info:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-info.dropdown-toggle {
color: #fff;
background-color: #17a2b8;
border-color: #17a2b8;
}
.pk-button-outline-info:not(:disabled):not(.disabled):active:focus, .pk-button-outline-info:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-info.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);
}
.pk-button-outline-warning {
color: #ffc107;
border-color: #ffc107;
}
.pk-button-outline-warning:hover {
color: #212529;
background-color: #ffc107;
border-color: #ffc107;
}
.pk-button-outline-warning:focus, .pk-button-outline-warning.focus {
box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
}
.pk-button-outline-warning.disabled, .pk-button-outline-warning:disabled {
color: #ffc107;
background-color: transparent;
}
.pk-button-outline-warning:not(:disabled):not(.disabled):active, .pk-button-outline-warning:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-warning.dropdown-toggle {
color: #212529;
background-color: #ffc107;
border-color: #ffc107;
}
.pk-button-outline-warning:not(:disabled):not(.disabled):active:focus, .pk-button-outline-warning:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-warning.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
}
.pk-button-outline-danger {
color: #dc3545;
border-color: #dc3545;
}
.pk-button-outline-danger:hover {
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
}
.pk-button-outline-danger:focus, .pk-button-outline-danger.focus {
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
}
.pk-button-outline-danger.disabled, .pk-button-outline-danger:disabled {
color: #dc3545;
background-color: transparent;
}
.pk-button-outline-danger:not(:disabled):not(.disabled):active, .pk-button-outline-danger:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-danger.dropdown-toggle {
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
}
.pk-button-outline-danger:not(:disabled):not(.disabled):active:focus, .pk-button-outline-danger:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-danger.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
}
.pk-button-outline-light {
color: #f8f9fa;
border-color: #f8f9fa;
}
.pk-button-outline-light:hover {
color: #212529;
background-color: #f8f9fa;
border-color: #f8f9fa;
}
.pk-button-outline-light:focus, .pk-button-outline-light.focus {
box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);
}
.pk-button-outline-light.disabled, .pk-button-outline-light:disabled {
color: #f8f9fa;
background-color: transparent;
}
.pk-button-outline-light:not(:disabled):not(.disabled):active, .pk-button-outline-light:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-light.dropdown-toggle {
color: #212529;
background-color: #f8f9fa;
border-color: #f8f9fa;
}
.pk-button-outline-light:not(:disabled):not(.disabled):active:focus, .pk-button-outline-light:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-light.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);
}
.pk-button-outline-dark {
color: #343a40;
border-color: #343a40;
}
.pk-button-outline-dark:hover {
color: #fff;
background-color: #343a40;
border-color: #343a40;
}
.pk-button-outline-dark:focus, .pk-button-outline-dark.focus {
box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);
}
.pk-button-outline-dark.disabled, .pk-button-outline-dark:disabled {
color: #343a40;
background-color: transparent;
}
.pk-button-outline-dark:not(:disabled):not(.disabled):active, .pk-button-outline-dark:not(:disabled):not(.disabled).active,
.show > .pk-button-outline-dark.dropdown-toggle {
color: #fff;
background-color: #343a40;
border-color: #343a40;
}
.pk-button-outline-dark:not(:disabled):not(.disabled):active:focus, .pk-button-outline-dark:not(:disabled):not(.disabled).active:focus,
.show > .pk-button-outline-dark.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);
}
.pk-button-lg {
padding: 0.5rem 1rem;
font-size: 1.25rem;
line-height: 1.5;
border-radius: 0.3rem;
}
.pk-button-sm {
padding: 0.25rem 0.5rem;
font-size: 0.875rem;
line-height: 1.5;
border-radius: 0.2rem;
}
.pk-button-block {
display: block;
width: 100%;
}
.pk-button-block + .pk-button-block {
margin-top: 0.5rem;
}
/* Tabs */
/*--------------------------------------------------------------*/
.pk-nav {
display: flex;
flex-direction: column;
flex-wrap: wrap;
padding-left: 0;
margin-bottom: 0;
list-style: none;
}
.pk-fade {
transition: opacity 0.15s linear;
}
@media (prefers-reduced-motion: reduce) {
.pk-fade {
transition: none;
}
}
.pk-nav-link {
display: block;
}
.pk-nav-link:hover, .pk-nav-link:focus {
text-decoration: none;
}
.pk-nav-tabs .pk-nav-item + .pk-nav-item .pk-nav-link {
margin-top: 0.5rem;
}
.pk-nav-tabs .pk-nav-link {
border: 1px solid transparent;
border-color: #dee2e6;
color: #adb5bd;
border-top-left-radius: 0.25rem;
border-top-right-radius: 0.25rem;
}
.pk-nav-tabs .pk-nav-link.pk-active {
color: #000;
background-color: #FFFFFF;
}
.pk-nav-tabs .pk-nav-link:hover, .pk-nav-tabs .pk-nav-link:focus {
color: #212529;
}
.pk-tab-content > .pk-tab-pane {
display: none;
}
.pk-tab-content > .pk-active {
display: block;
}
.pk-tabs .pk-nav {
margin-bottom: 1.5rem;
}
.pk-tabs .pk-nav-link {
padding: 1rem 1.5rem;
line-height: 1;
font-size: 1rem;
text-decoration: none !important;
box-shadow: none !important;
}
.pk-tabs .pk-tab-pane > *:last-child {
margin-bottom: 0;
}
.pk-tabs .pk-nav-tabs .pk-nav-link.pk-active {
background-color: #f8f9fa;
}
.pk-tabs .pk-nav-pills .pk-nav-link {
border-radius: 0.25rem;
padding: 0.75rem 1rem;
line-height: 1;
color: #adb5bd;
}
.pk-tabs .pk-nav-pills .pk-nav-link.pk-active {
color: #000;
background-color: #e9ecef;
}
@media (min-width: 768px) {
.pk-tabs .pk-nav-item + .pk-nav-item .pk-nav-link {
margin-top: 0;
}
.pk-tabs .pk-nav-link:not(.pk-active) {
border-color: transparent;
}
.pk-tabs .pk-nav-tabs .pk-nav-link.pk-active {
background-color: transparent;
}
.pk-tabs-horizontal .pk-nav {
flex-direction: row;
}
.pk-tabs-horizontal .pk-nav-tabs {
border-bottom: 1px solid #dee2e6;
}
.pk-tabs-horizontal .pk-nav-item {
transform: translateY(1px);
}
.pk-tabs-horizontal .pk-nav-link.pk-active {
border-bottom-color: #fff;
}
.pk-tabs-vertical .pk-tabs-container {
display: flex;
}
.pk-tabs-vertical .pk-tabs-navigation {
flex: 0 0 30%;
}
.pk-tabs-vertical .pk-tabs-navigation .pk-nav {
margin-bottom: 0;
}
.pk-tabs-vertical .pk-tabs-navigation .pk-nav-item {
width: 100%;
max-width: 100%;
transform: translateX(1px);
}
.pk-tabs-vertical .pk-tabs-content {
margin-left: 5%;
flex: 0 0 65%;
}
.pk-tabs-vertical .pk-nav-tabs {
border-right: 1px solid #dee2e6;
flex-direction: column;
height: 100%;
}
.pk-tabs-vertical .pk-nav-tabs .pk-nav-link {
border-radius: 0.25rem 0 0 0.25rem;
}
.pk-tabs-vertical .pk-nav-tabs .pk-nav-link.pk-active {
border-right-color: #fff;
}
.pk-tabs-vertical .pk-nav-pills {
flex-direction: column;
}
}
/* Collapsibles */
/*--------------------------------------------------------------*/
.pk-card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
margin-bottom: 0;
background-clip: border-box;
}
.pk-card + .pk-card {
border-top: 1px solid #e9ecef;
}
.pk-collapsing {
position: relative;
height: 0;
overflow: hidden;
}
.pk-card-body {
flex: 1 1 auto;
padding: 0.75rem 0;
}
.pk-card-header {
margin-bottom: 0;
}
.pk-card-header .pk-card-title {
margin-top: 0;
margin-bottom: 0;
}
.pk-card-header a {
display: flex;
justify-content: space-between;
padding: 0.75rem 0;
border: none;
color: #212529;
transition: 0.3s;
text-decoration: none !important;
box-shadow: none !important;
}
.pk-card-header a:hover {
color: #adb5bd;
}
.pk-card-header a:after {
font-family: 'powerkit-icons';
content: "\e914";
transition: 0.3s;
}
.pk-card.expanded .pk-card-header a {
color: inherit;
}
.pk-card.expanded .pk-card-header a:after {
transform: rotate(90deg);
}
/* Progress */
/*--------------------------------------------------------------*/
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 1rem 0;
}
to {
background-position: 0 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 1rem 0;
}
to {
background-position: 0 0;
}
}
.pk-progress {
display: flex;
height: 1rem;
overflow: hidden;
font-size: 0.75rem;
background-color: #e9ecef;
border-radius: 0.25rem;
}
.pk-progress-bar {
display: flex;
flex-direction: column;
justify-content: center;
color: #fff;
text-align: center;
white-space: nowrap;
transition: width 0.6s ease;
}
@media (prefers-reduced-motion: reduce) {
.pk-progress-bar {
transition: none;
}
}
.pk-progress-bar.pk-bg-primary {
background-color: #007bff;
}
.pk-progress-bar-striped {
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-size: 1rem 1rem;
}
.pk-progress-bar-animated {
-webkit-animation: progress-bar-stripes 1s linear infinite;
animation: progress-bar-stripes 1s linear infinite;
}
/* Separators */
/*--------------------------------------------------------------*/
.pk-separator {
border-bottom-color: #ddd;
margin-top: 2rem;
margin-bottom: 2rem;
}
@@ -0,0 +1,41 @@
/**
* Basic Shortcodes
*/
( function( $ ) {
$( document ).ready( function() {
/* Alerts */
$( document ).on( 'click', '.pk-alert .pk-close', function() {
$( this ).closest( '.pk-alert' ).remove();
} );
/* Tabs */
$( '.pk-tab-pane' ).removeClass( 'pk-fade' );
$( document ).on( 'click', '.pk-tabs .pk-nav-item .pk-nav-link', function() {
// Nav.
$( this ).parent().siblings().find( '.pk-active' ).removeClass( 'pk-active' );
$( this ).addClass( 'pk-active' );
// Pane.
$( this ).closest( '.pk-tabs' ).find( '.pk-tab-pane' ).removeClass( 'pk-show pk-active' );
$( this ).closest( '.pk-tabs' ).find( '.pk-tab-content' ).find( $( this ).attr( 'href' ) ).addClass( 'pk-show pk-active' );
return false;
} );
/* Collapsibles */
$( document ).on( 'click', '.pk-card a[data-toggle="collapse"]', function() {
if ( $( this ).closest( '.pk-collapsibles' ).length > 0 ) {
$( this ).closest( '.pk-card' ).siblings().removeClass( 'expanded' );
$( this ).closest( '.pk-card' ).siblings().find( '.pk-collapse' ).slideUp();
}
$( this ).closest( '.pk-card' ).toggleClass( 'expanded' ).find( $( this ).attr( 'href' ) ).slideToggle();
return false;
} );
} );
} )( jQuery );
@@ -0,0 +1,101 @@
<?php
/**
* Shortcode Alerts config
*
* @package Powerkit
* @subpackage Templates
*/
/**
* Alerts
*/
powerkit_basic_shortcodes_register( array(
'name' => 'alerts',
'title' => esc_html__( 'Alerts', 'powerkit' ),
'priority' => 30,
'base' => 'powerkit_alert',
'autoregister' => true,
'fields' => array(
array(
'type' => 'section',
'label' => esc_html__( 'Options', 'powerkit' ),
),
array(
'type' => 'radio',
'name' => 'type',
'label' => esc_html__( 'Type', 'powerkit' ),
'style' => 'vertical',
'default' => 'info',
'options' => array(
'danger' => esc_html__( 'Danger', 'powerkit' ),
'info' => esc_html__( 'Info', 'powerkit' ),
'link' => esc_html__( 'Link', 'powerkit' ),
'success' => esc_html__( 'Success', 'powerkit' ),
'warning' => esc_html__( 'Warning', 'powerkit' ),
),
),
array(
'type' => 'checkbox',
'name' => 'dismissible',
'label' => esc_html__( 'Display close button', 'powerkit' ),
'default' => false,
),
array(
'type' => 'checkbox',
'name' => 'multiline',
'label' => esc_html__( 'Multiline', 'powerkit' ),
'default' => false,
),
array(
'type' => 'section',
'label' => esc_html__( 'Content', 'powerkit' ),
),
array(
'type' => 'content',
'name' => 'content',
'label' => esc_html__( 'Content', 'powerkit' ),
'default' => '',
'attrs' => array(
'class' => 'widefat',
'rows' => 6,
),
),
),
) );
/**
* Alert Shortcode
*
* @param array $output Shortcode HTML.
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode tag content.
* @return string Shortcode result HTML.
*/
function powerkit_basic_shortcodes_alert( $output, $atts, $content ) {
$dm_class = null;
$dm_button = null;
if ( 'true' === $atts['dismissible'] ) {
$dm_class .= ' pk-alert-dismissible';
$dm_button .= '
<button type="button" class="pk-close" data-dismiss="alert" aria-label="' . esc_attr__( 'Close', 'powerkit' ) . '">
<i class="pk-icon-x"></i>
</button>';
}
if ( 'true' === $atts['multiline'] ) {
$dm_class .= ' pk-alert-multiline';
}
$output = sprintf(
'<div class="pk-alert pk-alert-%s%s" role="alert" >%s%s</div>',
$atts['type'],
$dm_class,
$dm_button,
$content
);
return $output;
}
add_filter( 'powerkit_alert_shortcode', 'powerkit_basic_shortcodes_alert', 10, 3 );
@@ -0,0 +1,133 @@
<?php
/**
* Shortcode Buttons config
*
* @package Powerkit
* @subpackage Templates
*/
/**
* Buttons
*/
powerkit_basic_shortcodes_register( array(
'name' => 'buttons',
'title' => esc_html__( 'Buttons', 'powerkit' ),
'priority' => 20,
'base' => 'powerkit_button',
'autoregister' => true,
'fields' => array(
array(
'type' => 'section',
'label' => esc_html__( 'Style Options', 'powerkit' ),
),
array(
'type' => 'radio',
'name' => 'size',
'label' => esc_html__( 'Size', 'powerkit' ),
'style' => 'horizontal',
'default' => 'md',
'options' => array(
'sm' => esc_html__( 'Small', 'powerkit' ),
'md' => esc_html__( 'Default', 'powerkit' ),
'lg' => esc_html__( 'Large', 'powerkit' ),
),
),
array(
'type' => 'radio',
'name' => 'style',
'label' => esc_html__( 'Style', 'powerkit' ),
'style' => 'vertical',
'default' => 'primary',
'options' => array(
'primary' => esc_html__( 'Primary', 'powerkit' ),
'secondary' => esc_html__( 'Secondary', 'powerkit' ),
'success' => esc_html__( 'Success', 'powerkit' ),
'info' => esc_html__( 'Info', 'powerkit' ),
'warning' => esc_html__( 'Warning', 'powerkit' ),
'danger' => esc_html__( 'Danger', 'powerkit' ),
'link' => esc_html__( 'Link', 'powerkit' ),
),
),
array(
'type' => 'checkbox',
'name' => 'block',
'label' => esc_html__( 'Block', 'powerkit' ),
'default' => false,
),
array(
'type' => 'section',
'label' => esc_html__( 'Link Options', 'powerkit' ),
),
array(
'type' => 'input',
'name' => 'url',
'label' => esc_html__( 'URL', 'powerkit' ),
'default' => 'http://',
),
array(
'type' => 'radio',
'name' => 'target',
'label' => esc_html__( 'Link target', 'powerkit' ),
'style' => 'vertical',
'default' => '_self',
'options' => array(
'_self' => esc_html__( 'Open in same window', 'powerkit' ),
'_blank' => esc_html__( 'Open in new window/tab', 'powerkit' ),
),
),
array(
'type' => 'content',
'name' => 'title',
'label' => esc_html__( 'Title', 'powerkit' ),
'default' => 'Button',
'attrs' => array(
'class' => 'widefat',
'rows' => 6,
),
),
array(
'type' => 'checkbox',
'name' => 'nofollow',
'label' => esc_html__( 'Apply "nofollow" attribute', 'powerkit' ),
'default' => false,
),
),
) );
/**
* Button Shortcode
*
* @param array $output Shortcode HTML.
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode tag content.
* @return string Shortcode result HTML.
*/
function powerkit_basic_shortcodes_button( $output, $atts, $content ) {
$nofollow = ( 'true' === $atts['nofollow'] ) ? 'rel="nofollow"' : '';
$block = ( 'true' === $atts['block'] ) ? ' pk-button-block' : '';
if ( isset( $atts['title'] ) && $atts['title'] ) {
$title = $atts['title'];
}
if ( $content ) {
$title = $content;
}
$output = sprintf(
'<a class="pk-button pk-button-%s pk-button-%s%s pk-font-primary" href="%s" target="%s" %s>
%s
</a>',
$atts['size'],
$atts['style'],
$block,
$atts['url'],
$atts['target'],
$nofollow,
$title
);
return $output;
}
add_filter( 'powerkit_button_shortcode', 'powerkit_basic_shortcodes_button', 10, 3 );
@@ -0,0 +1,121 @@
<?php
/**
* Shortcode Collapsibles config
*
* @package Powerkit
* @subpackage Templates
*/
/**
* Collapsibles
*/
powerkit_basic_shortcodes_register( array(
'name' => 'collapsibles',
'title' => esc_html__( 'Collapsibles', 'powerkit' ),
'priority' => 50,
'base' => 'powerkit_collapsibles',
'autoregister' => true,
'fields' => array(
array(
'type' => 'section',
'label' => esc_html__( 'Content', 'powerkit' ),
),
array(
'type' => 'repeater',
'base' => 'powerkit_collapsible',
'autoregister' => true,
'label' => esc_html__( 'Collapsibles', 'powerkit' ),
'fields' => array(
array(
'type' => 'input',
'name' => 'title',
'label' => esc_html__( 'Title', 'powerkit' ),
'default' => '',
'attrs' => array(
'class' => 'widefat',
),
),
array(
'type' => 'content',
'name' => 'content',
'label' => esc_html__( 'Content', 'powerkit' ),
'default' => '',
'attrs' => array(
'class' => 'widefat',
'rows' => 6,
),
),
array(
'type' => 'checkbox',
'name' => 'opened',
'label' => esc_html__( 'Opened', 'powerkit' ),
'default' => false,
),
),
),
),
) );
/**
* Collapsibles Shortcode
*
* @param array $output Shortcode HTML.
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode tag content.
* @return string Shortcode result HTML.
*/
function powerkit_basic_shortcodes_collapsibles( $output, $atts, $content ) {
$collapse_id = uniqid();
$output = sprintf(
'<div id="collapsibles-%1$s" class="pk-collapsibles" role="tablist" aria-multiselectable="true">%2$s</div>
',
$collapse_id,
str_replace( 'data-parent="#"', 'data-parent="#pk-collapsibles-' . $collapse_id . '"', $content )
);
return $output;
}
add_filter( 'powerkit_collapsibles_shortcode', 'powerkit_basic_shortcodes_collapsibles', 10, 3 );
/**
* Collapsible Shortcode
*
* @param array $output Shortcode HTML.
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode tag content.
* @return string Shortcode result HTML.
*/
function powerkit_basic_shortcodes_collapsible( $output, $atts, $content ) {
$item_id = uniqid();
$output = sprintf(
'<div class="pk-collapsible pk-card %4$s">
<div class="pk-card-header" role="tab" id="card-%1$s">
<h6 class="pk-card-title pk-title">
<a data-toggle="collapse" class="pk-font-heading" href="#pk-collapse-%1$s" data-parent="#" aria-controls="collapse-%1$s">
%2$s
</a>
</h6>
</div>
<div id="pk-collapse-%1$s" class="pk-collapse" style="%3$s" role="tabpanel" aria-labelledby="card-%1$s">
<div class="pk-card-body">
%5$s
</div>
</div>
</div>
',
$item_id,
$atts['title'],
( 'true' === $atts['opened'] ) ? 'display:block;' : 'display:none;',
( 'true' === $atts['opened'] ) ? 'expanded' : '',
do_shortcode( $content )
);
return $output;
}
add_filter( 'powerkit_collapsible_shortcode', 'powerkit_basic_shortcodes_collapsible', 10, 3 );
@@ -0,0 +1,201 @@
<?php
/**
* Shortcode Grid config
*
* @package Powerkit
* @subpackage Templates
*/
/**
* Init module
*/
class Powerkit_Basic_Grid {
/**
* Initialize.
*/
public function __construct() {
if ( class_exists( 'Gridable' ) ) {
add_filter( 'gridable_row_class', array( $this, 'gridable_row_class' ) );
add_filter( 'gridable_column_class', array( $this, 'gridable_column_class' ), 10, 4 );
add_filter( 'gridable_load_public_style', '__return_false' );
} else {
add_shortcode( 'powerkit_row', array( $this, 'add_row_shortcode' ) );
add_shortcode( 'powerkit_col', array( $this, 'add_column_shortcode' ) );
add_shortcode( 'row', array( $this, 'add_row_shortcode' ) );
add_shortcode( 'col', array( $this, 'add_column_shortcode' ) );
add_filter( 'the_content', array( $this, 'parse_content_for_nested_rows' ), 9 );
add_filter( 'powerkit_the_column_content', array( $this, 'fix_lost_p_tags' ), 10, 2 );
}
}
/**
* Render the [powerkit-row]
*
* @param array $atts The atts.
* @param string $content The content.
*/
public function add_row_shortcode( $atts, $content ) {
ob_start();
?>
<div class="pk-row">
<?php
$row_content = apply_filters( 'powerkit_the_row_content', $content, $atts );
if ( apply_filters( 'powerkit_render_shortcodes_in_row', true, $content, $atts ) ) {
echo do_shortcode( $row_content );
} else {
echo $row_content; // XSS.
}
?>
</div>
<?php
return ob_get_clean();
}
/**
* Render the [powerkit-col]
*
* @param array $atts The atts.
* @param string $content The content.
*/
public function add_column_shortcode( $atts, $content ) {
$size = 1;
if ( ! empty( $atts['size'] ) ) {
$size = (int) $atts['size'];
}
ob_start();
?>
<div class="pk-col-md-<?php echo esc_attr( $size ); ?>">
<?php
$column_content = apply_filters( 'powerkit_the_column_content', $content, $atts );
if ( apply_filters( 'powerkit_render_shortcodes_in_column', true, $content, $atts ) ) {
echo do_shortcode( $column_content );
} else {
echo $column_content; // XSS.
}
?>
</div>
<?php
return ob_get_clean();
}
/**
* This function strips unclosed p tags at a beggining and at the end of a row
*
* @param string $content The content.
* @param array $atts The atts.
*/
public function fix_lost_p_tags( $content, $atts ) {
if ( is_admin() ) {
return $content;
}
$first_4_chars = substr( $content, 0, 4 );
$last_3_chars = substr( $content, -3, 4 );
if ( '</p>' === $first_4_chars ) {
$content = substr( $content, 5 );
}
if ( '<p>' === $last_3_chars ) {
$content = substr( $content, 0, -4 );
}
return $content;
}
/**
* Try to allow one level of nested rows
*
* @param string $content The content.
* @param bool $rec The rec.
*/
public function parse_content_for_nested_rows( $content, $rec = false ) {
$rows_matches = array();
preg_match_all( '#' . get_shortcode_regex( array( 'powerkit-row' ) ) . '#ims', $content, $rows_matches );
/**
* Basically in the first group of matches are the plain row texts
* If a row contains another row, we should render it before.
*/
if ( ! empty( $rows_matches[0] ) ) {
// Iterate through each row and check if anyone has a nested row.
foreach ( $rows_matches[0] as $key => $match ) {
$row_pos = strpos( $rows_matches[0][ $key ], '[powerkit-row cols_nr="', 5 );
// If there is another row inside render it first.
if ( false !== $row_pos ) {
// Make a clone of the original row.
$temp_row = $match;
// If this row has an inner row, let's render it and replace it in the clone row.
preg_match( '#' . get_shortcode_regex( array( 'powerkit-row' ) ) . '#', $match, $smatch );
if ( substr_count( $smatch[0], '[powerkit-row ' ) > 1 ) {
$inner_rows = array();
// Right now the row form is [powerkit-row] content [powerkit-row]content[/powerkit-row]
// if we render the available rows we will have a nested-free row.
$remove_starting_row = '~\[' . $smatch[1] . $smatch[2] . $smatch[3] . '\]~';
$temp_content = preg_replace( $remove_starting_row, '', $smatch[0], 1 );
preg_match_all( '#' . get_shortcode_regex( array( 'powerkit-row' ) ) . '#ms', $temp_content, $inner_rows );
// There may be more than one inner row, catch'em all.
foreach ( $inner_rows[0] as $inner_row ) {
$temp_row = str_replace( $inner_row, do_shortcode( $inner_row ), $temp_row );
}
}
// Now we have a [powerkit-row] content <div class="pk-row"></div>
// the closing [/powerkit-row] is definetly somewhere after.
$content = str_replace( $match, $temp_row, $content );
} else {
if ( ! $rec ) {
$content = $this->parse_content_for_nested_rows( $content, true );
}
}
}
}
return $content;
}
/**
* -------------------------------------------------------------------------
* [ Support Gridable ]
* -------------------------------------------------------------------------
*/
/**
* Row Class
*/
public function gridable_row_class() {
return array( 'pk-row' );
}
/**
* Column Class
*
* @param array $classes Available classes.
* @param int $size Column size.
* @param array $atts Attributes.
* @param string $content Content.
*/
public function gridable_column_class( $classes, $size, $atts, $content ) {
$classes = array( 'pk-col-md-' . $size );
return $classes;
}
}
new Powerkit_Basic_Grid();
@@ -0,0 +1,115 @@
<?php
/**
* Shortcode Progress Bars config
*
* @package Powerkit
* @subpackage Templates
*/
/**
* Progress Bars
*/
powerkit_basic_shortcodes_register( array(
'name' => 'progressbars',
'title' => esc_html__( 'Progress Bars', 'powerkit' ),
'priority' => 60,
'base' => 'powerkit_progressbar',
'autoregister' => true,
'fields' => array(
array(
'type' => 'section',
'label' => esc_html__( 'Options', 'powerkit' ),
),
array(
'type' => 'input',
'name' => 'value',
'label' => esc_html__( 'Value', 'powerkit' ),
'default' => '25',
'suffix' => ' %',
'desc' => '(0-100)',
),
array(
'type' => 'section',
'label' => esc_html__( 'Style', 'powerkit' ),
),
array(
'type' => 'input',
'name' => 'height',
'label' => esc_html__( 'Height (thickness)', 'powerkit' ),
'default' => '20',
'suffix' => ' px',
),
array(
'type' => 'radio',
'name' => 'color',
'label' => esc_html__( 'Color', 'powerkit' ),
'style' => 'vertical',
'default' => 'primary',
'options' => array(
'primary' => esc_html__( 'Primary', 'powerkit' ),
'secondary' => esc_html__( 'Secondary', 'powerkit' ),
'success' => esc_html__( 'Success', 'powerkit' ),
'info' => esc_html__( 'Info', 'powerkit' ),
'warning' => esc_html__( 'Warning', 'powerkit' ),
'danger' => esc_html__( 'Danger', 'powerkit' ),
),
),
array(
'type' => 'checkbox',
'name' => 'display_value',
'label' => esc_html__( 'Display value', 'powerkit' ),
'default' => false,
),
array(
'type' => 'checkbox',
'name' => 'striped',
'label' => esc_html__( 'Striped', 'powerkit' ),
'default' => false,
),
array(
'type' => 'checkbox',
'name' => 'animated',
'label' => esc_html__( 'Animated', 'powerkit' ),
'default' => false,
),
),
) );
/**
* Progress Bar Shortcode
*
* @param array $output Shortcode HTML.
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode tag content.
* @return string Shortcode result HTML.
*/
function powerkit_basic_shortcodes_progressbar( $output, $atts, $content ) {
// Value.
$atts['value'] = $atts['value'] > 100 ? 100 : $atts['value'];
// Display value.
$display_value = ( 'true' === $atts['display_value'] ) ? $atts['value'] . '%' : '';
// Striped and animated.
$class = 'pk-progress-bar';
$class .= ( 'true' === $atts['striped'] ) ? ' pk-progress-bar-striped' : '';
$class .= ( 'true' === $atts['animated'] ) ? ' pk-progress-bar-animated' : '';
// Color.
$class .= sprintf( ' pk-bg-%s', $atts['color'] );
$output = sprintf(
'<div class="pk-progress" style="height: %2$spx;">
<div class="%s" role="progressbar" style="width: %3$s%%;" aria-valuenow="%3$s" aria-valuemin="0" aria-valuemax="100">%4$s</div>
</div>',
$class,
$atts['height'],
$atts['value'],
$display_value
);
return $output;
}
add_filter( 'powerkit_progressbar_shortcode', 'powerkit_basic_shortcodes_progressbar', 10, 3 );
@@ -0,0 +1,72 @@
<?php
/**
* Shortcode Separators config
*
* @package Powerkit
* @subpackage Templates
*/
/**
* Separators
*/
powerkit_basic_shortcodes_register( array(
'name' => 'separators',
'title' => esc_html__( 'Separators', 'powerkit' ),
'priority' => 10,
'base' => 'powerkit_separator',
'autoregister' => true,
'fields' => array(
array(
'type' => 'section',
'label' => esc_html__( 'Options', 'powerkit' ),
),
array(
'type' => 'radio',
'name' => 'style',
'label' => esc_html__( 'Style', 'powerkit' ),
'style' => 'vertical',
'default' => 'solid',
'options' => array(
'solid' => esc_html__( 'Solid', 'powerkit' ),
'double' => esc_html__( 'Double', 'powerkit' ),
'dotted' => esc_html__( 'Dotted', 'powerkit' ),
'dashed' => esc_html__( 'Dashed', 'powerkit' ),
'blank' => esc_html__( 'Blank (empty space)', 'powerkit' ),
),
),
array(
'type' => 'input',
'name' => 'height',
'label' => esc_html__( 'Height', 'powerkit' ),
'default' => '',
'suffix' => ' px',
),
),
) );
/**
* Separator Shortcode
*
* @param array $output Shortcode HTML.
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode tag content.
* @return string Shortcode result HTML.
*/
function powerkit_basic_shortcodes_separator( $output, $atts, $content ) {
if ( 'blank' === $atts['style'] ) {
$inl_css = sprintf( 'style="height: %dpx;"', absint( $atts['height'] ) );
} else {
$inl_css = sprintf( 'style="border-bottom-width: %dpx; border-bottom-style: %s;"', absint( $atts['height'] ), $atts['style'] );
}
$output = sprintf(
'<div class="pk-separator" %s>%s</div>',
$inl_css,
$content
);
return $output;
}
add_filter( 'powerkit_separator_shortcode', 'powerkit_basic_shortcodes_separator', 10, 3 );
@@ -0,0 +1,160 @@
<?php
/**
* Shortcode Tabs config
*
* @package Powerkit
* @subpackage Templates
*/
/**
* Tabs
*/
powerkit_basic_shortcodes_register( array(
'name' => 'tabs',
'title' => esc_html__( 'Tabs', 'powerkit' ),
'priority' => 40,
'base' => 'powerkit_tabs',
'autoregister' => true,
'fields' => array(
array(
'type' => 'section',
'label' => esc_html__( 'Options', 'powerkit' ),
),
array(
'type' => 'radio',
'name' => 'type',
'label' => esc_html__( 'Type', 'powerkit' ),
'style' => 'horizontal',
'default' => 'tabs',
'options' => array(
'tabs' => esc_html__( 'Tabs', 'powerkit' ),
'pills' => esc_html__( 'Pills', 'powerkit' ),
),
),
array(
'type' => 'radio',
'name' => 'nav',
'label' => esc_html__( 'Navigation type', 'powerkit' ),
'style' => 'horizontal',
'default' => 'horizontal',
'options' => array(
'horizontal' => esc_html__( 'Horizontal', 'powerkit' ),
'vertical' => esc_html__( 'Vertical', 'powerkit' ),
),
),
array(
'type' => 'section',
'label' => esc_html__( 'Content', 'powerkit' ),
),
array(
'type' => 'repeater',
'base' => 'powerkit_tab',
'autoregister' => true,
'label' => esc_html__( 'Tabs', 'powerkit' ),
'fields' => array(
array(
'type' => 'input',
'name' => 'title',
'label' => esc_html__( 'Title', 'powerkit' ),
'default' => '',
'attrs' => array(
'class' => 'widefat',
),
),
array(
'type' => 'content',
'name' => 'content',
'label' => esc_html__( 'Content', 'powerkit' ),
'default' => '',
'attrs' => array(
'class' => 'widefat',
'rows' => 6,
),
),
),
),
),
) );
/**
* Tabs Wrap Shortcode
*
* @param array $output Shortcode HTML.
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode tag content.
* @return string Shortcode result HTML.
*/
function powerkit_basic_shortcodes_tabs( $output, $atts, $content ) {
global $powerkit_basic_shortcodes_tabs;
if ( ! is_array( $powerkit_basic_shortcodes_tabs ) ) {
$powerkit_basic_shortcodes_tabs = array();
}
// Output.
$nav_items = '';
$pane_items = '';
$num = 1;
foreach ( $powerkit_basic_shortcodes_tabs as $tab ) {
$data_toggle = ( 'tabs' === $atts['type'] ) ? 'tab' : 'pill';
$item_id = uniqid();
$content_id = $data_toggle . '-' . $item_id;
$nav_items .= sprintf(
'<li class="pk-nav-item"><a class="pk-nav-link%s pk-font-heading" data-toggle="%s" href="#%s">%s</a></li>',
( 1 === $num ) ? ' pk-active' : '',
$data_toggle,
$content_id,
$tab['title']
);
$pane_items .= sprintf(
'<div id="%s" class="pk-tab-pane pk-fade%s" role="tabpanel">%s</div>',
$content_id,
( 1 === $num ) ? ' pk-show pk-active' : '',
$tab['content']
);
$num++;
}
// Reset Tabs.
$powerkit_basic_shortcodes_tabs = array();
// Tabs Output.
$output = '';
$output .= '<div class="pk-tabs pk-tabs-' . $atts['nav'] . '">';
$output .= '<div class="pk-tabs-container">';
$output .= '<div class="pk-tabs-navigation"><ul class="pk-nav pk-nav-' . $atts['type'] . '" role="tablist">' . $nav_items . '</ul></div>';
$output .= '<div class="pk-tabs-content"><div class="pk-tab-content">' . $pane_items . '</div></div>';
$output .= '</div>';
$output .= '</div>';
return $output;
}
add_filter( 'powerkit_tabs_shortcode', 'powerkit_basic_shortcodes_tabs', 10, 3 );
/**
* Tab Item Shortcode
*
* @param array $output Shortcode HTML.
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode tag content.
* @return string Shortcode result HTML.
*/
function powerkit_basic_shortcodes_tab( $output, $atts, $content ) {
global $powerkit_basic_shortcodes_tabs;
if ( ! is_array( $powerkit_basic_shortcodes_tabs ) ) {
$powerkit_basic_shortcodes_tabs = array();
}
$powerkit_basic_shortcodes_tabs[] = array(
'title' => $atts['title'],
'content' => $content,
);
return false;
}
add_filter( 'powerkit_tab_shortcode', 'powerkit_basic_shortcodes_tab', 10, 3 );
@@ -0,0 +1,712 @@
<?php
/**
* Custom Fonts
*
* @package Powerkit
* @subpackage Modules
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Custom_Fonts extends Powerkit_Module {
/**
* Webfonts method
*
* @var string $load_method Webfonts method.
*/
public $load_method = 'async';
/**
* Font base.
*
* This is used in case of Elementor's Font param
*
* @var string
*/
private static $font_base = 'pk-custom-fonts';
/**
* Register module
*/
public function register() {
$this->name = esc_html__( 'Custom Fonts', 'powerkit' );
$this->desc = esc_html__( 'Adds the ability to download custom fonts.', 'powerkit' );
$this->slug = 'custom_fonts';
$this->type = 'default';
$this->category = 'basic';
$this->priority = 1040;
$this->public = true;
$this->enabled = false;
$this->badge = esc_html__( 'Advanced', 'powerkit' );
$this->load_extensions = array(
'fonts',
);
$this->links = array(
array(
'name' => esc_html__( 'Go to settings', 'powerkit' ),
'url' => powerkit_get_page_url( 'fonts&tab=' . $this->slug, 'themes' ),
),
array(
'name' => esc_html__( 'View documentation', 'powerkit' ),
'url' => powerkit_get_setting( 'documentation' ) . '/content-presentation/custom-fonts/',
'target' => '_blank',
),
);
}
/**
* Initialize module
*/
public function initialize() {
add_filter( 'powerkit_fonts_list', array( $this, 'custom_fonts' ), 10 );
add_filter( 'csco_customizer_fonts_choices', array( $this, 'csco_custom_fonts' ), 20 );
add_filter( 'upload_mimes', array( $this, 'allow_mimes' ) );
add_filter( 'powerkit_fonts_register_settings', array( $this, 'register_settings' ), 10 );
add_action( 'customize_controls_print_styles', array( $this, 'frontend_enqueue' ), 100 );
add_action( 'wp_head', array( $this, 'frontend_enqueue' ), 100 );
add_action( 'admin_head', array( $this, 'editor_enqueue' ), 100 );
add_filter( 'init', array( $this, 'set_load_method' ) );
add_filter( 'elementor/fonts/groups', array( $this, 'elementor_group' ) );
add_filter( 'elementor/fonts/additional_fonts', array( $this, 'add_elementor_fonts' ) );
}
/**
* Set Webfonts method
*/
public function set_load_method() {
$this->load_method = apply_filters( 'powerkit_webfonts_load_method', 'async' );
}
/**
* Add custom fonts
*
* @since 1.0.0
* @param array $fonts List fonts.
* @return array
*/
public function custom_fonts( $fonts ) {
if ( is_customize_preview() ) {
$custom_fonts = get_option( 'powerkit_custom_fonts_list' );
if ( is_array( $custom_fonts ) && $custom_fonts ) {
$exclude = array();
$fonts['families']['custom_fonts'] = array(
'text' => esc_html__( 'Custom Fonts', 'powerkit' ),
'children' => array(),
);
foreach ( $custom_fonts as $key => $item ) {
if ( 'clone' === $key ) {
continue;
}
$id = sanitize_title( $item['name'] );
if ( $id ) {
if ( ! in_array( $id, $exclude, true ) ) {
$fonts['families']['custom_fonts']['children'][] = array(
'id' => $id,
'text' => $item['name'],
);
$exclude[] = $id;
}
$variant = str_replace( '400', 'regular', $item['weight'] );
if ( 'italic' === $item['style'] ) {
$variant .= 'italic';
}
if ( isset( $fonts['variants'][ $id ] ) && $fonts['variants'][ $id ] ) {
if ( ! in_array( $variant, $fonts['variants'][ $id ], true ) ) {
$fonts['variants'][ $id ][] = $variant;
}
} else {
$fonts['variants'][ $id ][] = $variant;
}
}
}
}
}
return $fonts;
}
/**
* Add custom fonts to csco theme
*
* @since 1.0.0
* @param array $fonts List fonts.
* @return array
*/
public function csco_custom_fonts( $fonts ) {
if ( is_customize_preview() ) {
$custom_fonts = get_option( 'powerkit_custom_fonts_list' );
if ( is_array( $custom_fonts ) && $custom_fonts ) {
$exclude = array();
$fonts['fonts']['families']['custom_fonts'] = array(
'text' => esc_html__( 'Custom Fonts', 'powerkit' ),
'children' => array(),
);
foreach ( $custom_fonts as $key => $item ) {
if ( 'clone' === $key ) {
continue;
}
$id = sanitize_title( $item['name'] );
if ( $id ) {
if ( ! in_array( $id, $exclude, true ) ) {
$fonts['fonts']['families']['custom_fonts']['children'][] = array(
'id' => $id,
'text' => $item['name'],
);
$exclude[] = $id;
}
$variant = str_replace( '400', 'regular', $item['weight'] );
if ( 'italic' === $item['style'] ) {
$variant .= 'italic';
}
if ( isset( $fonts['fonts']['variants'][ $id ] ) && $fonts['fonts']['variants'][ $id ] ) {
if ( ! in_array( $variant, $fonts['fonts']['variants'][ $id ], true ) ) {
$fonts['fonts']['variants'][ $id ][] = $variant;
}
} else {
$fonts['fonts']['variants'][ $id ][] = $variant;
}
}
}
}
}
return $fonts;
}
/**
* Add Custom Font group to elementor font list.
*
* Group name "Custom" is added as the first element in the array.
*
* @param Array $font_groups default font groups in elementor.
* @return Array Modified font groups with newly added font group.
*/
public function elementor_group( $font_groups ) {
$new_group[ self::$font_base ] = esc_html__( 'Custom Fonts', 'powerkit' );
$font_groups = $new_group + $font_groups;
return $font_groups;
}
/**
* Add Custom Fonts to the Elementor Page builder's font param.
*
* @param Array $fonts Custom Font's array.
*/
public function add_elementor_fonts( $fonts ) {
$fonts_list = get_option( 'powerkit_custom_fonts_list' );
if ( is_array( $fonts_list ) && $fonts_list ) {
foreach ( $fonts_list as $item ) {
$id = sanitize_title( $item['name'] );
if ( $id ) {
$fonts[ $id ] = self::$font_base;
}
}
}
return $fonts;
}
/**
* Register new mime types and file extensions.
*
* @since 1.0.0
* @param array $mimes Current array of mime types..
*/
public function allow_mimes( $mimes ) {
$mimes['woff'] = 'application/x-font-woff';
$mimes['woff2'] = 'application/x-font-woff2';
return $mimes;
}
/**
* Register settings
*
* @since 1.0.0
* @param array $settings List settings.
* @return array
*/
public function register_settings( $settings ) {
$settings[] = array(
'id' => $this->slug,
'name' => esc_html__( 'Custom Fonts', 'powerkit' ),
'function' => array( $this, 'build_setting_page' ),
);
return $settings;
}
/**
* Build admin page
*
* @since 1.0.0
*/
public function build_setting_page() {
powerkit_uuid_hash();
$this->save_options_page();
$powerkit_custom_fonts_id = get_option( 'powerkit_custom_fonts_counter', 1 );
$params = array(
'name' => '',
'weight' => '400',
'style' => 'normal',
'file_woff' => '',
'file_woff2' => '',
);
$action = 'new';
// Check wpnonce.
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'] ) ) { // Input var ok; sanitization ok.
return;
}
// Check custom action.
if ( isset( $_REQUEST['action'] ) ) { // Input var ok; sanitization ok.
$action = sanitize_title( $_REQUEST['action'] ); // Input var ok; sanitization ok.
if ( isset( $_REQUEST['powerkit_custom_fonts_id'] ) && 'edit' === $action ) { // Input var ok.
$powerkit_custom_fonts_id = sanitize_key( $_REQUEST['powerkit_custom_fonts_id'] ); // Input var ok.
}
}
// Edit font.
if ( 'edit' === $action ) {
$font_list = get_option( 'powerkit_custom_fonts_list' );
if ( isset( $font_list[ $powerkit_custom_fonts_id ] ) ) {
$params = array_merge( (array) $params, (array) $font_list[ $powerkit_custom_fonts_id ] );
}
}
// Delete font.
if ( 'delete' === $action ) {
$this->delete_font();
}
// Settings page link.
$powerkit_custom_fonts_link = powerkit_get_page_url( 'fonts&tab=' . $this->slug, 'themes' );
?>
<form method="post" action="<?php echo esc_url( $powerkit_custom_fonts_link ); ?>">
<div class="col-container">
<div id="col-left">
<div class="col-wrap">
<div class="form-wrap">
<div class="form-field">
<h2><?php esc_html_e( 'Instructions', 'powerkit' ); ?></h2>
<ol>
<li>
<?php
$link_webfont = sprintf( '<a href="%1$s" target="_blank">%2$s</a>', esc_url( 'https://www.fontsquirrel.com/tools/webfont-generator' ), esc_html__( 'Font Squirrel', 'powerkit' ) );
// translators: args - format woff, format woff, format woff2, link webfont-generator.
echo sprintf( esc_html__( 'Prepare your webfont files in %1$s and %2$s formats. You may convert your %3$s fonts at %4$s.', 'powerkit' ), '<code>woff</code>', '<code>woff2</code>', '<code>ttf</code>', wp_kses( $link_webfont, 'post' ) );
?>
</li>
<li><?php esc_html_e( 'Upload your font files.', 'powerkit' ); ?></li>
<li><?php esc_html_e( 'Navigate to Appearance &rarr; Customise &rarr; Typography and select your font in typography controls under Custom Fonts.', 'powerkit' ); ?></li>
</ol>
</div>
<?php if ( 'edit' === $action ) : ?>
<h3>
<?php esc_html_e( 'Edit Font', 'powerkit' ); ?>
<small><a href="<?php echo esc_url( $powerkit_custom_fonts_link ); ?>"><?php esc_html_e( ' cancel ', 'powerkit' ); ?></a></small>
</h3>
<?php else : ?>
<h3><?php esc_html_e( 'Add New Font', 'powerkit' ); ?></h3>
<?php endif; ?>
<!-- Name -->
<div class="form-field form-required">
<label for="powerkit_custom_fonts_name"><?php esc_html_e( 'Name', 'powerkit' ); ?></label>
<input id="powerkit_custom_fonts_name" name="powerkit_custom_fonts_name" type="text" aria-required="true" value="<?php echo esc_attr( stripslashes( $params['name'] ) ); ?>" />
</div>
<!-- Font File [WOFF] -->
<div class="form-field">
<label><?php esc_html_e( 'Font .woff', 'powerkit' ); ?></label>
<div class="upload-font-container" data-type="application/x-font-woff">
<?php $file_woff = $params['file_woff'] ? basename( get_attached_file( $params['file_woff'] ) ) : null; ?>
<p><input class="filename" type="text" placeholder="<?php esc_html_e( 'Choose file..', 'powerkit' ); ?>" readonly value="<?php echo esc_html( $file_woff ); ?>"></p>
<!-- Add & remove file links -->
<div class="submitbox">
<a class="upload-font-link button <?php echo esc_attr( $params['file_woff'] ? 'hidden' : '' ); ?>" href="#"><?php esc_html_e( 'Add File', 'powerkit' ); ?></a>
<a class="delete-font-link submitdelete <?php echo esc_attr( ! $params['file_woff'] ? 'hidden' : '' ); ?>" href="#"><?php esc_html_e( 'Remove', 'powerkit' ); ?></a>
</div>
<input class="uploaded-font-id" id="powerkit_custom_fonts_file_woff" name="powerkit_custom_fonts_file_woff" type="hidden" value="<?php echo esc_attr( stripslashes( $params['file_woff'] ) ); ?>" />
</div>
</div>
<!-- Font File [WOFF2] -->
<div class="form-field">
<label><?php esc_html_e( 'Font .woff2', 'powerkit' ); ?></label>
<div class="upload-font-container" data-type="application/x-font-woff2">
<?php $file_woff2 = $params['file_woff2'] ? basename( get_attached_file( $params['file_woff2'] ) ) : null; ?>
<p><input class="filename" type="text" placeholder="<?php esc_html_e( 'Choose file..', 'powerkit' ); ?>" readonly value="<?php echo esc_html( $file_woff2 ); ?>"></p>
<!-- Add & remove file links -->
<div class="submitbox">
<a class="upload-font-link button <?php echo esc_attr( $params['file_woff2'] ? 'hidden' : '' ); ?>" href="#"><?php esc_html_e( 'Add File', 'powerkit' ); ?></a>
<a class="delete-font-link submitdelete <?php echo esc_attr( ! $params['file_woff2'] ? 'hidden' : '' ); ?>" href="#"><?php esc_html_e( 'Remove', 'powerkit' ); ?></a>
</div>
<input class="uploaded-font-id" id="powerkit_custom_fonts_file_woff2" name="powerkit_custom_fonts_file_woff2" type="hidden" value="<?php echo esc_attr( stripslashes( $params['file_woff2'] ) ); ?>" />
</div>
</div>
<!-- Font Weight -->
<div class="form-field">
<label for="powerkit_custom_fonts_weight"><?php esc_html_e( 'Weight', 'powerkit' ); ?></label>
<select class="regular-text" id="powerkit_custom_fonts_weight" name="powerkit_custom_fonts_weight">
<option value="100" <?php selected( '100', $params['weight'] ); ?>><?php esc_html_e( '100', 'powerkit' ); ?></option>
<option value="200" <?php selected( '200', $params['weight'] ); ?>><?php esc_html_e( '200', 'powerkit' ); ?></option>
<option value="300" <?php selected( '300', $params['weight'] ); ?>><?php esc_html_e( '300', 'powerkit' ); ?></option>
<option value="400" <?php selected( '400', $params['weight'] ); ?>><?php esc_html_e( '400 (regular)', 'powerkit' ); ?></option>
<option value="500" <?php selected( '500', $params['weight'] ); ?>><?php esc_html_e( '500', 'powerkit' ); ?></option>
<option value="600" <?php selected( '600', $params['weight'] ); ?>><?php esc_html_e( '600', 'powerkit' ); ?></option>
<option value="700" <?php selected( '700', $params['weight'] ); ?>><?php esc_html_e( '700', 'powerkit' ); ?></option>
<option value="800" <?php selected( '800', $params['weight'] ); ?>><?php esc_html_e( '800', 'powerkit' ); ?></option>
<option value="900" <?php selected( '900', $params['weight'] ); ?>><?php esc_html_e( '900', 'powerkit' ); ?></option>
</select>
</div>
<!-- Font Style -->
<div class="form-field">
<label for="powerkit_custom_fonts_style"><?php esc_html_e( 'Style', 'powerkit' ); ?></label>
<select class="regular-text" id="powerkit_custom_fonts_style" name="powerkit_custom_fonts_style">
<option value="normal" <?php selected( 'normal', $params['style'] ); ?>><?php esc_html_e( 'normal', 'powerkit' ); ?></option>
<option value="italic" <?php selected( 'italic', $params['style'] ); ?>><?php esc_html_e( 'italic', 'powerkit' ); ?></option>
</select>
</div>
<input name="powerkit_custom_fonts_id" type="hidden" value="<?php echo esc_html( $powerkit_custom_fonts_id ); ?>" />
<?php wp_nonce_field(); ?>
<?php if ( 'edit' === $action ) : ?>
<p class="submit"><input class="button button-primary" name="edit_settings" type="submit" value="<?php esc_html_e( 'Save Change', 'powerkit' ); ?>" /></p>
<?php else : ?>
<p class="submit"><input class="button button-primary" name="save_settings" type="submit" value="<?php esc_html_e( 'Add Font', 'powerkit' ); ?>" /></p>
<?php endif; ?>
</div>
</div>
</div>
<div id="col-right">
<div class="col-wrap wrap">
<table class="wrap wp-list-table widefat fixed striped">
<thead>
<tr>
<td scope="col" class="manage-column"><?php esc_html_e( 'Name', 'powerkit' ); ?></td>
<td scope="col" class="manage-column"><?php esc_html_e( 'Font Family', 'powerkit' ); ?></td>
<td scope="col" class="manage-column"><?php esc_html_e( 'Font Weight', 'powerkit' ); ?></td>
<td scope="col" class="manage-column"><?php esc_html_e( 'Font Style', 'powerkit' ); ?></td>
</tr>
</thead>
<tbody id="the-list">
<?php
$families = get_option( 'powerkit_custom_fonts_list', array() );
// Sort families.
if ( is_array( $families ) && $families ) {
$families_keys = array_keys( $families );
foreach ( $families as $key => $row ) {
$families_value[ $key ] = $row['name'];
$families_name[ $key ] = $row['weight'];
$families_order[ $key ] = $row['style'];
}
array_multisort( $families_value, SORT_DESC, $families_order, SORT_DESC, $families_name, SORT_ASC, $families, $families_keys );
$families = array_combine( $families_keys, $families );
}
// Loop families.
if ( $families ) {
foreach ( $families as $key => $family ) {
$edit_link = add_query_arg(
array(
'_wpnonce' => wp_create_nonce(),
'powerkit_custom_fonts_id' => $key,
'action' => 'edit',
), $powerkit_custom_fonts_link
);
$delete_link = add_query_arg(
array(
'_wpnonce' => wp_create_nonce(),
'powerkit_custom_fonts_id' => $key,
'action' => 'delete',
), $powerkit_custom_fonts_link
);
?>
<tr>
<td scope="col" class="manage-column">
<a class="row-title" href="<?php echo esc_url( $edit_link ); ?>"><?php echo esc_html( $family['name'] ); ?></a>
<div class="row-actions">
<span class="edit">
<a href="<?php echo esc_url( $edit_link ); ?>" role="button"><?php esc_html_e( 'Edit', 'powerkit' ); ?></a> |
</span>
<span class="delete">
<a href="<?php echo esc_url( $delete_link ); ?>" class="powerkit-fonts-delete" role="button"><?php esc_html_e( 'Delete', 'powerkit' ); ?></a> |
</span>
<span class="view">
<a href="#" class="powerkit-fonts-view-code" role="button"><?php esc_html_e( 'View Code', 'powerkit' ); ?></a>
</span>
</div>
</td>
<td scope="col" class="manage-column"><?php echo esc_html( $family['slug'] ); ?></td>
<td scope="col" class="manage-column"><?php echo esc_html( $family['weight'] ); ?></td>
<td scope="col" class="manage-column"><?php echo esc_html( $family['style'] ); ?></td>
</tr>
<tr class="template-code hidden">
<td scope="col" class="manage-column" colspan="4">
<?php
// Example code.
$code = sprintf(
'h1 {
font-family: "%s";
font-weight: %s;
font-style: %s;
}',
$family['slug'],
$family['weight'],
$family['style']
);
$code = str_replace( "\t\t", '', $code );
?>
<div id="template" class="template-box hidden">
<textarea readonly="readonly"><?php echo wp_kses( $code, 'post' ); ?></textarea>
</div>
</td>
</tr>
<tr class="hidden"></tr>
<?php
}
} else {
?>
<tr>
<td scope="col" colspan="4"><?php esc_html_e( 'No fonts found. Add new fonts with the form to the left.', 'powerkit' ); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</form>
<?php
}
/**
* Delete font
*
* @since 1.0.0
*/
protected function delete_font() {
if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'] ) ) { // Input var ok; sanitization ok.
return;
}
if ( ! isset( $_GET['powerkit_custom_fonts_id'] ) ) { // Input var ok.
return;
}
// ID Font.
$id = sanitize_key( $_GET['powerkit_custom_fonts_id'] ); // Input var ok.
// Custom List.
$font_list = (array) get_option( 'powerkit_custom_fonts_list', array() );
// If exist font.
if ( isset( $font_list[ $id ] ) ) {
// Attachments delete.
if ( isset( $font_list[ $id ]['file_woff'] ) ) {
wp_delete_attachment( $font_list[ $id ]['file_woff'], true );
}
if ( isset( $font_list[ $id ]['file_woff2'] ) ) {
wp_delete_attachment( $font_list[ $id ]['file_woff2'], true );
}
// Delete font.
unset( $font_list[ $id ] );
// Save list.
update_option( 'powerkit_custom_fonts_list', $font_list );
// Output message.
printf( '<div id="message" class="updated fade"><p><strong>%s</strong></p></div>', esc_html__( 'Font successfully deleted.', 'powerkit' ) );
}
}
/**
* Settings save
*
* @since 1.0.0
*/
protected function save_options_page() {
if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'] ) ) { // Input var ok; sanitization ok.
return;
}
if ( ! isset( $_POST['powerkit_custom_fonts_id'] ) ) { // Input var ok.
return;
}
// Update id counter.
if ( isset( $_POST['save_settings'] ) ) { // Input var ok.
update_option( 'powerkit_custom_fonts_counter', intval( get_option( 'powerkit_custom_fonts_counter', 1 ) ) + 1 );
}
// ID Font.
$id = sanitize_key( $_POST['powerkit_custom_fonts_id'] ); // Input var ok.
// Custom List.
$font_list = (array) get_option( 'powerkit_custom_fonts_list', array() );
// Reset current settings.
$font_list[ $id ] = array();
// Set new settings.
if ( isset( $_POST['powerkit_custom_fonts_name'] ) ) { // Input var ok.
$font_list[ $id ]['slug'] = sanitize_title( $_POST['powerkit_custom_fonts_name'] ); // Input var ok; sanitization ok.
}
if ( isset( $_POST['powerkit_custom_fonts_name'] ) ) { // Input var ok.
$font_list[ $id ]['name'] = sanitize_text_field( $_POST['powerkit_custom_fonts_name'] ); // Input var ok; sanitization ok.
}
if ( isset( $_POST['powerkit_custom_fonts_file_woff'] ) ) { // Input var ok.
$font_list[ $id ]['file_woff'] = sanitize_text_field( $_POST['powerkit_custom_fonts_file_woff'] ); // Input var ok; sanitization ok.
}
if ( isset( $_POST['powerkit_custom_fonts_file_woff2'] ) ) { // Input var ok.
$font_list[ $id ]['file_woff2'] = sanitize_text_field( $_POST['powerkit_custom_fonts_file_woff2'] ); // Input var ok; sanitization ok.
}
if ( isset( $_POST['powerkit_custom_fonts_weight'] ) ) { // Input var ok.
$font_list[ $id ]['weight'] = sanitize_text_field( $_POST['powerkit_custom_fonts_weight'] ); // Input var ok; sanitization ok.
}
if ( isset( $_POST['powerkit_custom_fonts_style'] ) ) { // Input var ok.
$font_list[ $id ]['style'] = sanitize_text_field( $_POST['powerkit_custom_fonts_style'] ); // Input var ok; sanitization ok.
}
// Save list.
update_option( 'powerkit_custom_fonts_list', $font_list );
// Output message.
printf( '<div id="message" class="updated fade"><p><strong>%s</strong></p></div>', esc_html__( 'Settings saved.', 'powerkit' ) );
}
/**
* Register fonts in the editor.
*/
public function editor_enqueue() {
global $pagenow;
if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {
$this->frontend_enqueue();
}
}
/**
* Frontend enqueue
*
* @since 1.0.0
*/
public function frontend_enqueue() {
$custom_fonts = get_option( 'powerkit_custom_fonts_list' );
if ( is_array( $custom_fonts ) && $custom_fonts ) {
$exclude = array();
$font_face = null;
foreach ( $custom_fonts as $key => $item ) {
$id = sanitize_title( $item['name'] );
if ( $id ) {
$src = array();
$files = array();
$files['woff'] = wp_get_attachment_url( $item['file_woff'] );
$files['woff2'] = wp_get_attachment_url( $item['file_woff2'] );
foreach ( $files as $key_file => $file_url ) {
if ( $file_url ) {
$src[] = sprintf( 'url("%1$s") format("%2$s")', $file_url, $key_file );
}
}
if ( $src ) {
$src_line = implode( ',', $src );
$display = 'async' === $this->load_method ? 'swap' : 'auto';
$font_face .= sprintf( '@font-face { font-family: "%1$s"; src: %2$s; font-display: %3$s; font-weight: %4$s; font-style: %5$s;}', $id, $src_line, $display, $item['weight'], $item['style'] );
}
}
}
if ( $font_face ) {
?>
<style><?php print( $font_face ); // XSS. ?></style>
<?php
}
}
}
}
new Powerkit_Custom_Fonts();
}
@@ -0,0 +1,220 @@
<?php
/**
* The admin-specific functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/Admin
*/
/**
* The admin-specific functionality of the module.
*/
class Powerkit_Coming_Soon_Admin extends Powerkit_Module_Admin {
/**
* Initialize
*/
public function initialize() {
add_action( 'init', array( $this, 'activation' ) );
add_action( 'admin_menu', array( $this, 'register_options_page' ) );
add_action( 'admin_notices', array( $this, 'notices' ) );
add_action( 'display_post_states', array( $this, 'post_state' ), 10, 2 );
}
/**
* Activation.
*/
public function activation() {
$activate = get_option( 'powerkit_coming_soon_init', false );
if ( ! $activate ) {
$page_id = wp_insert_post( wp_slash( array(
'post_title' => esc_html__( 'Coming Soon', 'powerkit' ),
'post_content' => powerkit_coming_soon_default_content(),
'post_type' => 'page',
'post_status' => 'publish',
'post_author' => 1,
) ) );
update_option( 'powerkit_coming_soon_init', true );
update_option( 'powerkit_coming_soon_page', $page_id );
}
}
/**
* Prints admin screen notices.
*/
public function notices() {
$screen = get_current_screen();
if ( false !== strpos( $screen->base, $this->slug ) ) {
return;
}
// Check Status.
if ( ! powerkit_coming_soon_status() ) {
return;
}
// Check Notice.
if ( 'yes' === get_option( 'powerkit_coming_soon_notice', 'yes' ) ) {
?>
<div class="notice notice-error is-dismissible">
<p>
<?php
// translators: Link deactivate.
echo wp_kses( sprintf( __( 'The Coming Soon is active. Please don\'t forget to <a href="%1$s">deactivate</a> as soon as you are done.', 'powerkit' ), powerkit_get_page_url( $this->slug ) ), 'post' );
?>
</p>
</div>
<?php
}
}
/**
* Set display state for page of Coming Soon.
*
* @param string $states An array of post display states.
* @param object $post The current post object.
*/
public function post_state( $states, $post ) {
$page_id = get_option( 'powerkit_coming_soon_page' );
if ( (int) $post->ID === (int) $page_id ) {
$states[] = esc_html__( 'Coming Soon Page', 'powerkit' );
}
return $states;
}
/**
* Register admin page
*
* @since 1.0.0
*/
public function register_options_page() {
add_options_page( esc_html__( 'Coming Soon', 'powerkit' ), esc_html__( 'Coming Soon', 'powerkit' ), 'manage_options', powerkit_get_page_slug( $this->slug ), array( $this, 'build_options_page' ) );
}
/**
* Build admin page
*
* @since 1.0.0
*/
public function build_options_page() {
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'You do not have sufficient rights to view this page.', 'powerkit' ) );
}
$this->save_options_page();
?>
<div class="wrap pk-wrap">
<h1><?php esc_html_e( 'Coming Soon', 'powerkit' ); ?></h1>
<div class="pk-settings">
<form method="post">
<table class="form-table">
<tbody>
<!-- Status -->
<tr>
<th scope="row"><label for="powerkit_coming_soon_status"><?php esc_html_e( 'Status', 'powerkit' ); ?></label></th>
<td>
<label><input class="regular-text" id="powerkit_coming_soon_status" name="powerkit_coming_soon_status" type="radio" value="yes" <?php checked( true, (bool) get_option( 'powerkit_coming_soon_status', false ) ); ?>> <?php esc_html_e( 'Activated', 'powerkit' ); ?></label>
<br>
<label><input value="no" class="regular-text" id="powerkit_coming_soon_status" name="powerkit_coming_soon_status" type="radio" <?php checked( false, (bool) get_option( 'powerkit_coming_soon_status', false ) ); ?>> <?php esc_html_e( 'Deactivated', 'powerkit' ); ?></label>
</td>
</tr>
<!-- Content from Page -->
<tr>
<?php
$pages = new WP_Query();
$pages = $pages->query( array(
'posts_per_page' => -1,
'post_type' => 'page',
) );
if ( $pages ) {
?>
<th scope="row"><label for="powerkit_coming_soon_page"><?php esc_html_e( 'Content from Page', 'powerkit' ); ?></label></th>
<td>
<select class="regular-text" name="powerkit_coming_soon_page" id="powerkit_coming_soon_page">
<option value=""><?php esc_html_e( '- not selected -', 'powerkit' ); ?></option>
<?php foreach ( $pages as $page ) : ?>
<option <?php selected( $page->ID, get_option( 'powerkit_coming_soon_page' ) ); ?> value="<?php echo esc_attr( $page->ID ); ?>"><?php echo esc_html( $page->post_title ); ?></option>
<?php endforeach; ?>
</select>
</td>
<?php } else { ?>
<td colspan="2">
<code><?php esc_html_e( 'Pages no found.', 'powerkit' ); ?></code>
</td>
<?php } ?>
<!-- Notice -->
<tr>
<th scope="row"><label for="powerkit_coming_soon_notice"><?php esc_html_e( 'Notice', 'powerkit' ); ?></label></th>
<td>
<select class="regular-text" id="powerkit_coming_soon_notice" name="powerkit_coming_soon_notice">
<option value="yes" <?php selected( 'yes', get_option( 'powerkit_coming_soon_notice', 'yes' ) ); ?>><?php esc_html_e( 'Yes', 'powerkit' ); ?></option>
<option value="no" <?php selected( 'no', get_option( 'powerkit_coming_soon_notice', 'yes' ) ); ?>><?php esc_html_e( 'No', 'powerkit' ); ?></option>
</select>
<p class="description"><?php esc_html_e( 'Do you want to see notices when maintenance mode is activated?', 'powerkit' ); ?></p>
</td>
</tr>
<!-- HTTP status code -->
<tr>
<th scope="row"><label for="powerkit_coming_soon_httpcode"><?php esc_html_e( 'HTTP status code', 'powerkit' ); ?></label></th>
<td><input class="regular-text" id="powerkit_coming_soon_httpcode" name="powerkit_coming_soon_httpcode" type="text" value="<?php echo esc_attr( get_option( 'powerkit_coming_soon_httpcode', 404 ) ); ?>"></td>
</tr>
</tr>
</tbody>
</table>
<?php wp_nonce_field(); ?>
<p class="submit"><input class="button button-primary" name="save_settings" type="submit" value="<?php esc_html_e( 'Save changes', 'powerkit' ); ?>" /></p>
</form>
</div>
</div>
<?php
}
/**
* Settings save
*
* @since 1.0.0
*/
protected function save_options_page() {
if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'] ) ) { // Input var ok; sanitization ok.
return;
}
if ( isset( $_POST['save_settings'] ) ) { // Input var ok.
if ( isset( $_POST['powerkit_coming_soon_status'] ) && 'yes' === $_POST['powerkit_coming_soon_status'] ) { // Input var ok; sanitization ok.
update_option( 'powerkit_coming_soon_status', true );
} else {
update_option( 'powerkit_coming_soon_status', false );
}
if ( isset( $_POST['powerkit_coming_soon_page'] ) ) { // Input var ok.
update_option( 'powerkit_coming_soon_page', sanitize_text_field( wp_unslash( $_POST['powerkit_coming_soon_page'] ) ) ); // Input var ok.
}
if ( isset( $_POST['powerkit_coming_soon_notice'] ) ) { // Input var ok.
update_option( 'powerkit_coming_soon_notice', sanitize_text_field( wp_unslash( $_POST['powerkit_coming_soon_notice'] ) ) ); // Input var ok.
}
if ( isset( $_POST['powerkit_coming_soon_httpcode'] ) ) { // Input var ok.
update_option( 'powerkit_coming_soon_httpcode', sanitize_text_field( wp_unslash( $_POST['powerkit_coming_soon_httpcode'] ) ) ); // Input var ok.
}
printf( '<div id="message" class="updated fade"><p><strong>%s</strong></p></div>', esc_html__( 'Settings saved.', 'powerkit' ) );
}
}
}
@@ -0,0 +1,64 @@
<?php
/**
* Coming Soon
*
* @package Powerkit
* @subpackage Modules
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Coming_Soon extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = esc_html__( 'Coming Soon', 'powerkit' );
$this->desc = esc_html__( 'Coming soon module to perfectly manage your coming soon, under construction website, under maintenance mode website and offline website.', 'powerkit' );
$this->slug = 'coming_soon';
$this->type = 'default';
$this->category = 'tools';
$this->priority = 140;
$this->public = true;
$this->enabled = true;
$this->links = array(
array(
'name' => esc_html__( 'Go to settings', 'powerkit' ),
'url' => powerkit_get_page_url( $this->slug ),
),
array(
'name' => esc_html__( 'View documentation', 'powerkit' ),
'url' => powerkit_get_setting( 'documentation' ) . '/coming-soon/',
'target' => '_blank',
),
);
}
/**
* Initialize module
*/
public function initialize() {
define( 'POWERKIT_CS_TEMPLATES', dirname( __FILE__ ) . '/templates' );
// Set plugin dir url.
define( 'POWERKIT_CS_URL', plugin_dir_url( __FILE__ ) );
/* Load the required dependencies for this module */
// Helpers Functions for the module.
require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-coming-soon.php';
// Admin and public area.
require_once dirname( __FILE__ ) . '/admin/class-powerkit-coming-soon-admin.php';
require_once dirname( __FILE__ ) . '/public/class-powerkit-coming-soon-public.php';
new Powerkit_Coming_Soon_Admin( $this->slug );
new Powerkit_Coming_Soon_Public( $this->slug );
}
}
new Powerkit_Coming_Soon();
}
@@ -0,0 +1,55 @@
<?php
/**
* Helpers Coming Soon
*
* @package Powerkit
* @subpackage Modules/Helper
*/
/**
* The function returns the status
*/
function powerkit_coming_soon_status() {
return get_option( 'powerkit_coming_soon_status', false );
}
/**
* The function returns the status page
*/
function powerkit_coming_soon_page_visible() {
$option_coming_soon_page = get_option( 'powerkit_coming_soon_page' );
if ( ! empty( $option_coming_soon_page ) && is_page( $option_coming_soon_page ) ) {
return __return_true();
}
}
/**
* The function returns the status site
*/
function powerkit_coming_soon_site_visible() {
// Check Status.
if ( ! powerkit_coming_soon_status() ) {
return;
}
// Check Administrator.
if ( current_user_can( 'editor' ) || current_user_can( 'administrator' ) ) {
return;
}
return __return_true();
}
/**
* The function returns the default content
*/
function powerkit_coming_soon_default_content() {
ob_start();
?>
<!-- wp:heading {"align":"center","level":1,"canvasClassName":"cnvs-block-core-heading-1"} -->
<h1 class="has-text-align-center">I'm working on something amazing!<br>But don't worry, I'll back soon. </h1>
<!-- /wp:heading -->
<?php
return ob_get_clean();
}
@@ -0,0 +1,112 @@
<?php
/**
* The public-facing functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/public
*/
/**
* The public-facing functionality of the module.
*/
class Powerkit_Coming_Soon_Public extends Powerkit_Module_Public {
/**
* Initialize
*/
public function initialize() {
add_filter( 'wp', array( $this, 'init_page' ) );
add_action( 'wp', array( $this, 'change_httpcode' ) );
}
/**
* Set HTTP status header.
*/
public function change_httpcode() {
// Check location.
if ( is_admin() ) {
return;
}
if ( powerkit_coming_soon_page_visible() || powerkit_coming_soon_site_visible() ) {
$httpcode = get_option( 'powerkit_coming_soon_httpcode', 404 );
status_header( $httpcode );
}
}
/**
* Init Page
*/
public function init_page() {
// Check location.
if ( is_admin() ) {
return;
}
if ( powerkit_coming_soon_page_visible() || powerkit_coming_soon_site_visible() ) {
add_filter( 'pre_get_document_title', array( $this, 'title' ) );
add_action( 'template_redirect', array( $this, 'template' ) );
}
}
/**
* Title
*/
public function title() {
$page_id = get_option( 'powerkit_coming_soon_page' );
if ( $page_id ) {
$page = get_post( $page_id );
// Set title.
$title = $page ? $page->post_title : esc_html__( 'Coming Soon', 'powerkit' );
return $title;
}
}
/**
* Template
*/
public function template() {
$page_id = get_option( 'powerkit_coming_soon_page' );
if ( $page_id ) {
// Get page object.
$object = get_post( $page_id );
// Get title.
$title = $object ? $object->post_title : esc_html__( 'Coming Soon', 'powerkit' );
// Get content.
$content = $object ? $object->post_content : esc_html__( 'Get Ready... Something Really Cool Is Coming Soon', 'powerkit' );
// Set template path.
$template_path = apply_filters( 'powerkit_coming_soon_template', POWERKIT_CS_TEMPLATES . '/default.php' );
if ( ! file_exists( $template_path ) ) {
wp_die( 'Template file does not exist!' );
}
include_once $template_path;
}
die();
}
/**
* Register the stylesheets for the public-facing side of the site.
*/
public function wp_enqueue_scripts() {
// Styles.
wp_enqueue_style( 'powerkit-coming-soon', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-coming-soon.css' ), array(), powerkit_get_setting( 'version' ), 'all' );
// Add RTL support.
wp_style_add_data( 'powerkit-coming-soon', 'rtl', 'replace' );
}
}
@@ -0,0 +1,78 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.pk-coming-soon-container {
display: flex;
flex-direction: column;
flex-wrap: wrap;
height: 100%;
}
.pk-coming-soon-image {
position: relative;
width: 100%;
}
.pk-coming-soon-image img {
width: 100%;
height: auto;
}
.pk-coming-soon-content {
display: flex;
align-items: center;
padding: 40px;
width: 100%;
}
@media (min-width: 992px) {
.pk-coming-soon-page {
min-height: 100vh;
}
.pk-coming-soon-container {
flex-direction: row;
flex-wrap: nowrap;
min-height: 100vh;
}
.pk-coming-soon-image {
flex: 0 0 50%;
max-width: 50%;
min-height: 100vh;
height: 100%;
}
.pk-coming-soon-image img {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
width: 100%;
height: 100%;
-o-object-fit: cover;
object-fit: cover;
}
.pk-coming-soon-content {
flex: 0 0 50%;
max-width: 50%;
}
.pk-coming-soon-content:first-child:last-child {
flex: 0 0 100%;
max-width: 100%;
}
}
.pk-coming-soon-content .entry-content {
margin: 0 auto;
max-width: 640px;
width: 100%;
}
.pk-coming-soon-content .pk-social-links-items {
justify-content: center;
}
@@ -0,0 +1,78 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.pk-coming-soon-container {
display: flex;
flex-direction: column;
flex-wrap: wrap;
height: 100%;
}
.pk-coming-soon-image {
position: relative;
width: 100%;
}
.pk-coming-soon-image img {
width: 100%;
height: auto;
}
.pk-coming-soon-content {
display: flex;
align-items: center;
padding: 40px;
width: 100%;
}
@media (min-width: 992px) {
.pk-coming-soon-page {
min-height: 100vh;
}
.pk-coming-soon-container {
flex-direction: row;
flex-wrap: nowrap;
min-height: 100vh;
}
.pk-coming-soon-image {
flex: 0 0 50%;
max-width: 50%;
min-height: 100vh;
height: 100%;
}
.pk-coming-soon-image img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
-o-object-fit: cover;
object-fit: cover;
}
.pk-coming-soon-content {
flex: 0 0 50%;
max-width: 50%;
}
.pk-coming-soon-content:first-child:last-child {
flex: 0 0 100%;
max-width: 100%;
}
}
.pk-coming-soon-content .entry-content {
margin: 0 auto;
max-width: 640px;
width: 100%;
}
.pk-coming-soon-content .pk-social-links-items {
justify-content: center;
}
@@ -0,0 +1,55 @@
<?php
/**
* Coming Soon default template
*
* @var $object - Page object.
* @var $title - The title.
* @var $content - The content.
*
* @package Powerkit
*/
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<?php wp_head(); ?>
<?php
if ( function_exists( 'cnvs_gutenberg' ) ) {
$blocks = parse_blocks( $content );
$blocks_css = cnvs_gutenberg()->parse_blocks_css( $blocks );
if ( $blocks_css ) {
call_user_func( 'printf', '<style>%s</style>', $blocks_css );
}
}
?>
</head>
<body>
<div class="pk-coming-soon-page pk-coming-soon-default">
<div class="pk-coming-soon-container">
<?php if ( $object && has_post_thumbnail( $object ) ) { ?>
<div class="pk-coming-soon-image">
<?php echo get_the_post_thumbnail( $object, 'large', array( 'class' => 'pk-lazyload-disabled' ) ); ?>
</div>
<?php } ?>
<div class="pk-coming-soon-content">
<div class="entry-content">
<?php
$content = do_blocks( $content );
call_user_func( 'printf', '%s', do_shortcode( $content ) );
?>
</div>
</div>
</div>
</div>
<?php wp_footer(); ?>
</body>
</html>
@@ -0,0 +1,216 @@
<?php
/**
* The admin-specific functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/Admin
*/
/**
* The admin-specific functionality of the module.
*/
class Powerkit_Content_Formatting_Admin extends Powerkit_Module_Admin {
/**
* Initialize
*/
public function initialize() {
add_action( 'mce_buttons_2', array( $this, 'mce_buttons_2' ) );
add_filter( 'tiny_mce_before_init', array( $this, 'mce_before_init_insert_formats' ) );
}
/**
* Unshift Styleselect.
*
* @param array $buttons array of buttons.
*/
public function mce_buttons_2( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
/**
* Insert formats
*
* @param array $init_array array of style formats.
*/
public function mce_before_init_insert_formats( $init_array ) {
$style_formats = array(
array(
'title' => esc_html__( 'Drop Cap', 'powerkit' ),
'items' => array(
array(
'title' => esc_html__( 'Simple', 'powerkit' ),
'block' => 'p',
'classes' => 'pk-dropcap pk-dropcap-simple',
'wrapper' => false,
),
array(
'title' => esc_html__( 'Bordered', 'powerkit' ),
'block' => 'p',
'classes' => 'pk-dropcap pk-dropcap-borders',
'wrapper' => false,
),
array(
'title' => esc_html__( 'Border Right', 'powerkit' ),
'block' => 'p',
'classes' => 'pk-dropcap pk-dropcap-border-right',
'wrapper' => false,
),
array(
'title' => esc_html__( 'Background Light', 'powerkit' ),
'block' => 'p',
'classes' => 'pk-dropcap pk-block-bg pk-dropcap-bg-light',
'wrapper' => false,
),
array(
'title' => esc_html__( 'Background Inverse', 'powerkit' ),
'block' => 'p',
'classes' => 'pk-dropcap pk-block-bg pk-dropcap-bg-inverse',
'wrapper' => false,
),
),
),
array(
'title' => esc_html__( 'Callout', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-callout',
),
array(
'title' => esc_html__( 'Block', 'powerkit' ),
'items' => array(
array(
'title' => esc_html__( 'Borders', 'powerkit' ),
'items' => array(
array(
'title' => esc_html__( 'Top', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-content-block pk-block-border-top',
),
array(
'title' => esc_html__( 'Bottom', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-content-block pk-block-border-bottom',
),
array(
'title' => esc_html__( 'Left', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-content-block pk-block-border-left',
),
array(
'title' => esc_html__( 'Right', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-content-block pk-block-border-right',
),
array(
'title' => esc_html__( 'All', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-content-block pk-block-border-all',
),
),
),
array(
'title' => esc_html__( 'Background', 'powerkit' ),
'block' => 'div',
'items' => array(
array(
'title' => esc_html__( 'Light', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-content-block pk-block-bg pk-block-bg-light',
),
array(
'title' => esc_html__( 'Inverse', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-content-block pk-block-bg pk-block-bg-inverse',
),
),
),
array(
'title' => esc_html__( 'Shadows', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-content-block pk-block-shadows',
),
array(
'title' => esc_html__( 'Alignment', 'powerkit' ),
'items' => array(
array(
'title' => esc_html__( 'Left', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-content-block pk-block-alignment-left',
),
array(
'title' => esc_html__( 'Right', 'powerkit' ),
'block' => 'div',
'classes' => 'pk-content-block pk-block-alignment-right',
),
),
),
),
),
array(
'title' => esc_html__( 'Numbered Headings', 'powerkit' ),
'items' => array(
array(
'title' => esc_html__( 'Heading 2', 'powerkit' ),
'block' => 'h2',
'classes' => 'pk-heading-numbered',
),
array(
'title' => esc_html__( 'Heading 3', 'powerkit' ),
'block' => 'h3',
'classes' => 'pk-heading-numbered',
),
array(
'title' => esc_html__( 'Heading 4', 'powerkit' ),
'block' => 'h4',
'classes' => 'pk-heading-numbered',
),
array(
'title' => esc_html__( 'Heading 5', 'powerkit' ),
'block' => 'h5',
'classes' => 'pk-heading-numbered',
),
array(
'title' => esc_html__( 'Heading 6', 'powerkit' ),
'block' => 'h6',
'classes' => 'pk-heading-numbered',
),
),
),
array(
'title' => esc_html__( 'Lists', 'powerkit' ),
'items' => array(
array(
'title' => esc_html__( 'Style', 'powerkit' ),
'selector' => 'ol,ul',
'attributes' => array(
'class' => 'pk-list-styled',
),
),
array(
'title' => esc_html__( 'Positive', 'powerkit' ),
'selector' => 'ol,ul',
'attributes' => array(
'class' => 'pk-list-positive',
),
),
array(
'title' => esc_html__( 'Negative', 'powerkit' ),
'selector' => 'ol,ul',
'attributes' => array(
'class' => 'pk-list-negative',
),
),
),
),
);
$init_array['style_formats'] = wp_json_encode( $style_formats );
return $init_array;
}
}
@@ -0,0 +1,53 @@
<?php
/**
* Content Formatting
*
* @package Powerkit
* @subpackage Modules
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Content_Formatting extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = esc_html__( 'Content Formatting', 'powerkit' );
$this->desc = esc_html__( 'A few nice extra content formatting features: numbered headings, styled lists, badges, drop-caps, and content blocks.', 'powerkit' );
$this->slug = 'content_formatting';
$this->type = 'default';
$this->category = 'content';
$this->priority = 140;
$this->public = true;
$this->enabled = true;
$this->links = array(
array(
'name' => esc_html__( 'View documentation', 'powerkit' ),
'url' => powerkit_get_setting( 'documentation' ) . '/content-presentation/content-formatting/',
'target' => '_blank',
),
);
}
/**
* Initialize module
*/
public function initialize() {
/* Load the required dependencies for this module */
// Admin and public area.
require_once dirname( __FILE__ ) . '/admin/class-powerkit-content-formatting-admin.php';
require_once dirname( __FILE__ ) . '/public/class-powerkit-content-formatting-public.php';
new Powerkit_Content_Formatting_Admin( $this->slug );
new Powerkit_Content_Formatting_Public( $this->slug );
}
}
new Powerkit_Content_Formatting();
}
@@ -0,0 +1,49 @@
<?php
/**
* The public-facing functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/public
*/
/**
* The public-facing functionality of the module.
*/
class Powerkit_Content_Formatting_Public extends Powerkit_Module_Public {
/**
* Initialize
*/
public function initialize() {
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ), 6 );
add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ), 6 );
}
/**
* This function will register scripts and styles for admin dashboard.
*
* @param string $page Current page.
*/
public function admin_enqueue_scripts( $page ) {
wp_enqueue_style( 'powerkit-content-formatting', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-content-formatting.css' ), array(), powerkit_get_setting( 'version' ) );
}
/**
* Sets up theme defaults and registers support for various WordPress features.
*/
public function after_setup_theme() {
add_editor_style( powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-content-formatting.css' ) );
}
/**
* Register the stylesheets for the public-facing side of the site.
*/
public function wp_enqueue_scripts() {
wp_enqueue_style( 'powerkit-content-formatting', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-content-formatting.css' ), array(), powerkit_get_setting( 'version' ), 'all' );
// Add RTL support.
wp_style_add_data( 'powerkit-content-formatting', 'rtl', 'replace' );
}
}
@@ -0,0 +1,422 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.content,
.entry-content,
.mce-content-body {
counter-reset: h2;
}
.content h2,
.entry-content h2,
.mce-content-body h2 {
counter-reset: h3;
}
.content h3,
.entry-content h3,
.mce-content-body h3 {
counter-reset: h4;
}
.content h4,
.entry-content h4,
.mce-content-body h4 {
counter-reset: h5;
}
.content h5,
.entry-content h5,
.mce-content-body h5 {
counter-reset: h6;
}
.pk-list-styled,
.pk-list-positive,
.pk-list-negative {
line-height: 1.5;
list-style: none;
font-size: 1rem;
}
.pk-list-styled:not(:first-child),
.pk-list-positive:not(:first-child),
.pk-list-negative:not(:first-child) {
margin-top: 1.5rem;
}
.pk-list-styled:not(:last-child),
.pk-list-positive:not(:last-child),
.pk-list-negative:not(:last-child) {
margin-bottom: 1.5rem;
}
.pk-list-styled li:not(:first-child),
.pk-list-positive li:not(:first-child),
.pk-list-negative li:not(:first-child) {
margin-top: 0.5rem;
}
.pk-list-styled > li,
.pk-list-positive > li,
.pk-list-negative > li {
position: relative;
padding-right: 2.5rem;
}
.pk-list-styled > li:before,
.pk-list-positive > li:before,
.pk-list-negative > li:before {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
right: 0;
top: 0;
}
ol.pk-list-styled,
ol.pk-list-positive,
ol.pk-list-negative {
counter-reset: ol;
}
ol.pk-list-styled > li:before,
ol.pk-list-positive > li:before,
ol.pk-list-negative > li:before {
width: 1.5rem;
height: 1.5rem;
content: counter(ol);
counter-increment: ol;
color: #495057;
font-size: 0.875rem;
font-weight: 600;
background-color: #e9ecef;
border-radius: 50%;
line-height: 1;
}
ul.pk-list-styled > li:before {
content: '';
width: 0.25rem;
height: 0.25rem;
background: #ced4da;
margin-top: 0.75rem;
right: 1rem;
}
ol.pk-list-styled ul,
ol.pk-list-styled ol,
ul.pk-list-styled ol,
ul.pk-list-styled ul {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
padding-right: 0;
font-size: 0.875rem;
}
ol.pk-list-styled ul > li:not(:first-child),
ol.pk-list-styled ol > li:not(:first-child),
ul.pk-list-styled ol > li:not(:first-child),
ul.pk-list-styled ul > li:not(:first-child) {
margin-top: 0.25rem;
}
ol.pk-list-positive > li:before {
background-color: #28a745;
color: #fff;
}
ol.pk-list-negative > li:before {
background-color: #dc3545;
color: #fff;
}
ul.pk-list-positive > li:before,
ul.pk-list-negative > li:before {
width: 1.5rem;
font-family: 'powerkit-icons';
}
ul.pk-list-positive > li:before {
content: "\e912";
color: #28a745;
}
ul.pk-list-negative > li:before {
content: "\e913";
color: #dc3545;
}
.pk-heading-numbered {
display: flex;
}
.pk-heading-numbered:before {
margin-left: 1rem;
}
h2.pk-heading-numbered:before {
display: flex;
justify-content: center;
align-items: center;
height: 2.5rem;
flex: 0 0 2.5rem;
border-radius: 50%;
background: #ced4da;
color: white;
counter-increment: h2;
content: counter(h2);
}
h3.pk-heading-numbered:before {
counter-increment: h3;
content: counter(h3);
}
h2.pk-heading-numbered ~ h3.pk-heading-numbered:before {
content: counter(h2) "." counter(h3);
}
h4.pk-heading-numbered:before {
counter-increment: h4;
content: counter(h4);
}
h3.pk-heading-numbered ~ h4.pk-heading-numbered:before {
content: counter(h3) "." counter(h4);
}
h2.pk-heading-numbered ~ h3.pk-heading-numbered ~ h4.pk-heading-numbered:before {
content: counter(h2) "." counter(h3) "." counter(h4);
}
h5.pk-heading-numbered:before {
counter-increment: h5;
content: counter(h5);
}
h4.pk-heading-numbered ~ h5.pk-heading-numbered:before {
content: counter(h4) "." counter(h5);
}
h3.pk-heading-numbered ~ h4.pk-heading-numbered ~ h5.pk-heading-numbered:before {
content: counter(h3) "." counter(h4) "." counter(h5);
}
h2.pk-heading-numbered ~ h3.pk-heading-numbered ~ h4.pk-heading-numbered ~ h5.pk-heading-numbered:before {
content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5);
}
h6.pk-heading-numbered:before {
counter-increment: h6;
content: counter(h6);
}
h5.pk-heading-numbered ~ h6.pk-heading-numbered:before {
content: counter(h5) "." counter(h6);
}
h4.pk-heading-numbered ~ h5.pk-heading-numbered ~ h6.pk-heading-numbered:before {
content: counter(h4) "." counter(h5) "." counter(h6);
}
h3.pk-heading-numbered ~ h4.pk-heading-numbered ~ h5.pk-heading-numbered ~ h6.pk-heading-numbered:before {
content: counter(h3) "." counter(h4) "." counter(h5) "." counter(h6);
}
h2.pk-heading-numbered ~ h3.pk-heading-numbered ~ h4.pk-heading-numbered ~ h5.pk-heading-numbered ~ h6.pk-heading-numbered:before {
content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6);
}
.content .pk-dropcap,
.entry-content .pk-dropcap,
.mce-content-body .pk-dropcap {
text-align: right;
}
.content .pk-dropcap:after,
.entry-content .pk-dropcap:after,
.mce-content-body .pk-dropcap:after {
content: "";
display: table;
clear: both;
padding-top: 14px;
}
.content .pk-dropcap:first-letter,
.entry-content .pk-dropcap:first-letter,
.mce-content-body .pk-dropcap:first-letter {
display: block;
float: right;
margin-top: 0.5rem;
margin-left: 2rem;
margin-bottom: 1rem;
color: black;
font-size: 2.5rem;
line-height: 1;
text-align: center;
}
.content .pk-dropcap-bg-inverse:first-letter,
.entry-content .pk-dropcap-bg-inverse:first-letter,
.mce-content-body .pk-dropcap-bg-inverse:first-letter {
padding: 0.5rem 1rem;
background: black;
color: #fff;
}
.content .pk-dropcap-bg-light:first-letter,
.entry-content .pk-dropcap-bg-light:first-letter,
.mce-content-body .pk-dropcap-bg-light:first-letter {
padding: 0.5rem 1rem;
background: #f8f9fa;
}
.content .pk-dropcap-borders:first-letter,
.entry-content .pk-dropcap-borders:first-letter,
.mce-content-body .pk-dropcap-borders:first-letter {
margin-top: 0.25rem;
padding: 0.5rem 1rem;
border: 1px solid #dee2e6;
}
.content .pk-dropcap-border-right:first-letter,
.entry-content .pk-dropcap-border-right:first-letter,
.mce-content-body .pk-dropcap-border-right:first-letter {
padding-left: 2rem;
border-left: 1px solid #dee2e6;
border-radius: 0;
}
.content .pk-callout,
.entry-content .pk-callout,
.mce-content-body .pk-callout {
font-size: 1.25rem;
font-weight: 600;
}
.content .pk-content-block,
.entry-content .pk-content-block,
.mce-content-body .pk-content-block {
margin-bottom: 2rem;
}
.content .pk-content-block > *:last-child,
.entry-content .pk-content-block > *:last-child,
.mce-content-body .pk-content-block > *:last-child {
margin-bottom: 0;
}
.content .pk-block-alignment-left,
.entry-content .pk-block-alignment-left,
.mce-content-body .pk-block-alignment-left {
float: right;
max-width: 50%;
margin-left: 2rem;
}
.content .pk-block-alignment-right,
.entry-content .pk-block-alignment-right,
.mce-content-body .pk-block-alignment-right {
float: left;
max-width: 50%;
margin-right: 2rem;
}
.content .pk-block-border-left,
.entry-content .pk-block-border-left,
.mce-content-body .pk-block-border-left {
padding-right: 2rem;
border-right: 1px solid #dee2e6;
}
.content .pk-block-border-right,
.entry-content .pk-block-border-right,
.mce-content-body .pk-block-border-right {
padding-left: 2rem;
border-left: 1px solid #dee2e6;
}
.content .pk-block-border-top:before,
.entry-content .pk-block-border-top:before,
.mce-content-body .pk-block-border-top:before {
background-color: #dee2e6;
display: block;
width: 4rem;
height: 1px;
margin: 2rem auto;
content: "";
}
.content .pk-block-border-bottom:after,
.entry-content .pk-block-border-bottom:after,
.mce-content-body .pk-block-border-bottom:after {
background-color: #dee2e6;
display: block;
width: 4rem;
height: 1px;
margin: 2rem auto;
content: "";
}
.content .pk-block-border-all,
.entry-content .pk-block-border-all,
.mce-content-body .pk-block-border-all {
padding: 2rem;
border: 1px solid #dee2e6;
}
.content .pk-block-bg-light,
.entry-content .pk-block-bg-light,
.mce-content-body .pk-block-bg-light {
background: #f8f9fa;
padding: 2rem;
}
.content .pk-block-bg-inverse,
.entry-content .pk-block-bg-inverse,
.mce-content-body .pk-block-bg-inverse {
background: black;
padding: 2rem;
color: #fff;
}
.content .pk-block-bg .pk-alert,
.entry-content .pk-block-bg .pk-alert,
.mce-content-body .pk-block-bg .pk-alert {
background-color: white;
}
.content .pk-block-bg .pk-subscribe-form-wrap form,
.entry-content .pk-block-bg .pk-subscribe-form-wrap form,
.mce-content-body .pk-block-bg .pk-subscribe-form-wrap form {
box-shadow: none;
}
.content .pk-block-shadows,
.entry-content .pk-block-shadows,
.mce-content-body .pk-block-shadows {
padding: 2rem;
box-shadow: 0 0 1rem rgba(0, 0, 0, 0.075);
}
@media (max-width: 767.98px) {
.content .pk-content-block,
.entry-content .pk-content-block,
.mce-content-body .pk-content-block {
float: none;
width: 100%;
max-width: 100%;
border-right: none;
border-left: none;
margin-right: 0;
margin-left: 0;
}
}
@@ -0,0 +1,422 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.content,
.entry-content,
.mce-content-body {
counter-reset: h2;
}
.content h2,
.entry-content h2,
.mce-content-body h2 {
counter-reset: h3;
}
.content h3,
.entry-content h3,
.mce-content-body h3 {
counter-reset: h4;
}
.content h4,
.entry-content h4,
.mce-content-body h4 {
counter-reset: h5;
}
.content h5,
.entry-content h5,
.mce-content-body h5 {
counter-reset: h6;
}
.pk-list-styled,
.pk-list-positive,
.pk-list-negative {
line-height: 1.5;
list-style: none;
font-size: 1rem;
}
.pk-list-styled:not(:first-child),
.pk-list-positive:not(:first-child),
.pk-list-negative:not(:first-child) {
margin-top: 1.5rem;
}
.pk-list-styled:not(:last-child),
.pk-list-positive:not(:last-child),
.pk-list-negative:not(:last-child) {
margin-bottom: 1.5rem;
}
.pk-list-styled li:not(:first-child),
.pk-list-positive li:not(:first-child),
.pk-list-negative li:not(:first-child) {
margin-top: 0.5rem;
}
.pk-list-styled > li,
.pk-list-positive > li,
.pk-list-negative > li {
position: relative;
padding-left: 2.5rem;
}
.pk-list-styled > li:before,
.pk-list-positive > li:before,
.pk-list-negative > li:before {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 0;
top: 0;
}
ol.pk-list-styled,
ol.pk-list-positive,
ol.pk-list-negative {
counter-reset: ol;
}
ol.pk-list-styled > li:before,
ol.pk-list-positive > li:before,
ol.pk-list-negative > li:before {
width: 1.5rem;
height: 1.5rem;
content: counter(ol);
counter-increment: ol;
color: #495057;
font-size: 0.875rem;
font-weight: 600;
background-color: #e9ecef;
border-radius: 50%;
line-height: 1;
}
ul.pk-list-styled > li:before {
content: '';
width: 0.25rem;
height: 0.25rem;
background: #ced4da;
margin-top: 0.75rem;
left: 1rem;
}
ol.pk-list-styled ul,
ol.pk-list-styled ol,
ul.pk-list-styled ol,
ul.pk-list-styled ul {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
padding-left: 0;
font-size: 0.875rem;
}
ol.pk-list-styled ul > li:not(:first-child),
ol.pk-list-styled ol > li:not(:first-child),
ul.pk-list-styled ol > li:not(:first-child),
ul.pk-list-styled ul > li:not(:first-child) {
margin-top: 0.25rem;
}
ol.pk-list-positive > li:before {
background-color: #28a745;
color: #fff;
}
ol.pk-list-negative > li:before {
background-color: #dc3545;
color: #fff;
}
ul.pk-list-positive > li:before,
ul.pk-list-negative > li:before {
width: 1.5rem;
font-family: 'powerkit-icons';
}
ul.pk-list-positive > li:before {
content: "\e912";
color: #28a745;
}
ul.pk-list-negative > li:before {
content: "\e913";
color: #dc3545;
}
.pk-heading-numbered {
display: flex;
}
.pk-heading-numbered:before {
margin-right: 1rem;
}
h2.pk-heading-numbered:before {
display: flex;
justify-content: center;
align-items: center;
height: 2.5rem;
flex: 0 0 2.5rem;
border-radius: 50%;
background: #ced4da;
color: white;
counter-increment: h2;
content: counter(h2);
}
h3.pk-heading-numbered:before {
counter-increment: h3;
content: counter(h3);
}
h2.pk-heading-numbered ~ h3.pk-heading-numbered:before {
content: counter(h2) "." counter(h3);
}
h4.pk-heading-numbered:before {
counter-increment: h4;
content: counter(h4);
}
h3.pk-heading-numbered ~ h4.pk-heading-numbered:before {
content: counter(h3) "." counter(h4);
}
h2.pk-heading-numbered ~ h3.pk-heading-numbered ~ h4.pk-heading-numbered:before {
content: counter(h2) "." counter(h3) "." counter(h4);
}
h5.pk-heading-numbered:before {
counter-increment: h5;
content: counter(h5);
}
h4.pk-heading-numbered ~ h5.pk-heading-numbered:before {
content: counter(h4) "." counter(h5);
}
h3.pk-heading-numbered ~ h4.pk-heading-numbered ~ h5.pk-heading-numbered:before {
content: counter(h3) "." counter(h4) "." counter(h5);
}
h2.pk-heading-numbered ~ h3.pk-heading-numbered ~ h4.pk-heading-numbered ~ h5.pk-heading-numbered:before {
content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5);
}
h6.pk-heading-numbered:before {
counter-increment: h6;
content: counter(h6);
}
h5.pk-heading-numbered ~ h6.pk-heading-numbered:before {
content: counter(h5) "." counter(h6);
}
h4.pk-heading-numbered ~ h5.pk-heading-numbered ~ h6.pk-heading-numbered:before {
content: counter(h4) "." counter(h5) "." counter(h6);
}
h3.pk-heading-numbered ~ h4.pk-heading-numbered ~ h5.pk-heading-numbered ~ h6.pk-heading-numbered:before {
content: counter(h3) "." counter(h4) "." counter(h5) "." counter(h6);
}
h2.pk-heading-numbered ~ h3.pk-heading-numbered ~ h4.pk-heading-numbered ~ h5.pk-heading-numbered ~ h6.pk-heading-numbered:before {
content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6);
}
.content .pk-dropcap,
.entry-content .pk-dropcap,
.mce-content-body .pk-dropcap {
text-align: left;
}
.content .pk-dropcap:after,
.entry-content .pk-dropcap:after,
.mce-content-body .pk-dropcap:after {
content: "";
display: table;
clear: both;
padding-top: 14px;
}
.content .pk-dropcap:first-letter,
.entry-content .pk-dropcap:first-letter,
.mce-content-body .pk-dropcap:first-letter {
display: block;
float: left;
margin-top: 0.5rem;
margin-right: 2rem;
margin-bottom: 1rem;
color: black;
font-size: 2.5rem;
line-height: 1;
text-align: center;
}
.content .pk-dropcap-bg-inverse:first-letter,
.entry-content .pk-dropcap-bg-inverse:first-letter,
.mce-content-body .pk-dropcap-bg-inverse:first-letter {
padding: 0.5rem 1rem;
background: black;
color: #fff;
}
.content .pk-dropcap-bg-light:first-letter,
.entry-content .pk-dropcap-bg-light:first-letter,
.mce-content-body .pk-dropcap-bg-light:first-letter {
padding: 0.5rem 1rem;
background: #f8f9fa;
}
.content .pk-dropcap-borders:first-letter,
.entry-content .pk-dropcap-borders:first-letter,
.mce-content-body .pk-dropcap-borders:first-letter {
margin-top: 0.25rem;
padding: 0.5rem 1rem;
border: 1px solid #dee2e6;
}
.content .pk-dropcap-border-right:first-letter,
.entry-content .pk-dropcap-border-right:first-letter,
.mce-content-body .pk-dropcap-border-right:first-letter {
padding-right: 2rem;
border-right: 1px solid #dee2e6;
border-radius: 0;
}
.content .pk-callout,
.entry-content .pk-callout,
.mce-content-body .pk-callout {
font-size: 1.25rem;
font-weight: 600;
}
.content .pk-content-block,
.entry-content .pk-content-block,
.mce-content-body .pk-content-block {
margin-bottom: 2rem;
}
.content .pk-content-block > *:last-child,
.entry-content .pk-content-block > *:last-child,
.mce-content-body .pk-content-block > *:last-child {
margin-bottom: 0;
}
.content .pk-block-alignment-left,
.entry-content .pk-block-alignment-left,
.mce-content-body .pk-block-alignment-left {
float: left;
max-width: 50%;
margin-right: 2rem;
}
.content .pk-block-alignment-right,
.entry-content .pk-block-alignment-right,
.mce-content-body .pk-block-alignment-right {
float: right;
max-width: 50%;
margin-left: 2rem;
}
.content .pk-block-border-left,
.entry-content .pk-block-border-left,
.mce-content-body .pk-block-border-left {
padding-left: 2rem;
border-left: 1px solid #dee2e6;
}
.content .pk-block-border-right,
.entry-content .pk-block-border-right,
.mce-content-body .pk-block-border-right {
padding-right: 2rem;
border-right: 1px solid #dee2e6;
}
.content .pk-block-border-top:before,
.entry-content .pk-block-border-top:before,
.mce-content-body .pk-block-border-top:before {
background-color: #dee2e6;
display: block;
width: 4rem;
height: 1px;
margin: 2rem auto;
content: "";
}
.content .pk-block-border-bottom:after,
.entry-content .pk-block-border-bottom:after,
.mce-content-body .pk-block-border-bottom:after {
background-color: #dee2e6;
display: block;
width: 4rem;
height: 1px;
margin: 2rem auto;
content: "";
}
.content .pk-block-border-all,
.entry-content .pk-block-border-all,
.mce-content-body .pk-block-border-all {
padding: 2rem;
border: 1px solid #dee2e6;
}
.content .pk-block-bg-light,
.entry-content .pk-block-bg-light,
.mce-content-body .pk-block-bg-light {
background: #f8f9fa;
padding: 2rem;
}
.content .pk-block-bg-inverse,
.entry-content .pk-block-bg-inverse,
.mce-content-body .pk-block-bg-inverse {
background: black;
padding: 2rem;
color: #fff;
}
.content .pk-block-bg .pk-alert,
.entry-content .pk-block-bg .pk-alert,
.mce-content-body .pk-block-bg .pk-alert {
background-color: white;
}
.content .pk-block-bg .pk-subscribe-form-wrap form,
.entry-content .pk-block-bg .pk-subscribe-form-wrap form,
.mce-content-body .pk-block-bg .pk-subscribe-form-wrap form {
box-shadow: none;
}
.content .pk-block-shadows,
.entry-content .pk-block-shadows,
.mce-content-body .pk-block-shadows {
padding: 2rem;
box-shadow: 0 0 1rem rgba(0, 0, 0, 0.075);
}
@media (max-width: 767.98px) {
.content .pk-content-block,
.entry-content .pk-content-block,
.mce-content-body .pk-content-block {
float: none;
width: 100%;
max-width: 100%;
border-left: none;
border-right: none;
margin-left: 0;
margin-right: 0;
}
}
@@ -0,0 +1,58 @@
<?php
/**
* Contributors
*
* @package Powerkit
* @subpackage Modules
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Contributors extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = esc_html__( 'Contributors', 'powerkit' );
$this->desc = esc_html__( 'Display a list of your site authors (contributors) in your sidebar, including author name, bio, and avatar in multiple available layouts.', 'powerkit' );
$this->slug = 'contributors';
$this->type = 'default';
$this->category = 'content';
$this->priority = 150;
$this->public = true;
$this->enabled = true;
$this->links = array(
array(
'name' => esc_html__( 'View documentation', 'powerkit' ),
'url' => powerkit_get_setting( 'documentation' ) . '/contributors/',
'target' => '_blank',
),
);
}
/**
* Initialize module
*/
public function initialize() {
// Helpers Functions for the module.
require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-contributors.php';
// The classes responsible for defining all actions.
require_once dirname( __FILE__ ) . '/public/class-powerkit-contributors-widget.php';
if ( function_exists( 'register_block_type' ) ) {
require_once dirname( __FILE__ ) . '/public/class-powerkit-contributors-block.php';
}
// Admin and public area.
require_once dirname( __FILE__ ) . '/public/class-powerkit-contributors-public.php';
new Powerkit_Contributors_Public( $this->slug );
}
}
new Powerkit_Contributors();
}
@@ -0,0 +1,137 @@
<?php
/**
* Helpers Contributors
*
* @package Powerkit
* @subpackage Modules/Helper
*/
/**
* Get html of contributors block
*
* @param array $params Recent options.
* @param string $args Widget args.
*/
function powerkit_contributors_get_html( $params, $args ) {
$params = array_merge(
array(
'title' => '',
'filter_ids' => '',
'avatar' => true,
'social_accounts' => true,
'bio' => true,
'recent_posts' => false,
'recent_posts_count' => 3,
),
$params
);
// Before Widget.
echo $args['before_widget']; // XSS.
// Title.
if ( $params['title'] ) {
echo $args['before_title'] . wp_kses( $params['title'], 'pk-title' ) . $args['after_title']; // XSS.
}
// Content.
?>
<div class="widget-body">
<?php
$authors = powerkit_get_users();
$avatar_size = apply_filters( 'powerkit_widget_coauthors_avatar_size', 80 );
if ( isset( $authors ) && ! empty( $authors ) ) {
?>
<div class="pk-widget-contributors">
<?php
foreach ( $authors as $author ) {
// Filters ids.
if ( $params['filter_ids'] ) {
$filter_ids = explode( ',', str_replace( ' ', '', $params['filter_ids'] ) );
if ( ! in_array( (string) $author->ID, $filter_ids, true ) ) {
continue;
}
}
?>
<div class="pk-author-item">
<?php if ( $params['avatar'] ) { ?>
<div class="pk-author-avatar">
<a href="<?php echo esc_url( get_author_posts_url( $author->ID ) ); ?>" rel="author">
<?php echo get_avatar( $author->ID, $avatar_size ); ?>
</a>
</div>
<?php } ?>
<div class="pk-author-data">
<?php $tag = apply_filters( 'powerkit_widget_contributors_author_name', 'h6' ); ?>
<<?php echo esc_html( $tag ); ?> class="author-name">
<a href="<?php echo esc_url( get_author_posts_url( $author->ID ) ); ?>" rel="author">
<?php echo esc_html( get_the_author_meta( 'display_name', $author->ID ) ); ?>
</a>
</<?php echo esc_html( $tag ); ?>>
<?php
if ( $params['bio'] ) :
$author_description = get_the_author_meta( 'description', $author->ID );
?>
<div class="author-description pk-color-secondary">
<?php echo wp_kses_post( powerkit_str_truncate( $author_description, apply_filters( 'powerkit_widget_contributors_description_length', 100 ) ) ); ?>
</div>
<?php endif; ?>
<?php
if ( $params['social_accounts'] && powerkit_module_enabled( 'social_links' ) ) {
powerkit_author_social_links( $author->ID, 'template-nav' );
}
?>
<?php
if ( $params['recent_posts'] && $params['recent_posts_count'] ) {
$author_posts = get_posts(
array(
'author' => $author->ID,
'posts_per_page' => $params['recent_posts_count'],
)
);
if ( ! empty( $author_posts ) ) {
?>
<div class="pk-author-posts">
<h6><?php echo sprintf( esc_html__( 'Latest from %s:', 'powerkit' ), get_the_author_meta( 'display_name', $author->ID ) ); ?></h6>
<?php
foreach ( $author_posts as $post ) {
?>
<div class="pk-author-posts-single">
<a href="<?php echo esc_url( get_permalink( $post->ID ) ); ?>"><?php echo esc_html( get_the_title( $post->ID ) ); ?></a>
</div>
<?php
}
?>
</div>
<?php
}
}
?>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
<?php
// After Widget.
echo $args['after_widget']; // XSS.
}
@@ -0,0 +1,41 @@
<?php
/**
* Contributors block template
*
* @var $attributes - block attributes
* @var $options - layout options
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package PowerKit
* @subpackage PowerKit/templates
*/
$params = array(
'title' => '',
'filter_ids' => implode( ',', (array) $attributes['contributors'] ),
'avatar' => $attributes['showAvatar'],
'social_accounts' => $attributes['showSocialAccounts'],
'bio' => $attributes['showBio'],
'recent_posts' => $attributes['showRecentPosts'],
'recent_posts_count' => isset( $attributes['countRecentPosts'] ) ? $attributes['countRecentPosts'] : 0,
);
echo '<div class="' . esc_attr( $attributes['className'] ) . '" ' . ( isset( $attributes['anchor'] ) ? ' id="' . esc_attr( $attributes['anchor'] ) . '"' : '' ) . '>';
// Title.
if ( $params['title'] ) {
$params['title'] = '<h5 class="pk-contributors-title">' . $params['title'] . '<h5>';
}
$args = array(
'before_title' => '',
'after_title' => '',
'before_widget' => '',
'after_widget' => '',
);
powerkit_contributors_get_html( $params, $args );
echo '</div>';
@@ -0,0 +1,151 @@
<?php
/**
* The Gutenberg Block.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/public
*/
/**
* The initialize block.
*/
class Powerkit_Contributors_Block {
/**
* Initialize
*/
public function __construct() {
add_action( 'init', array( $this, 'block' ) );
add_filter( 'canvas_register_block_type', array( $this, 'register_block_type' ) );
}
/**
* Enqueue the block's assets for the editor.
*/
public function block() {
// Styles.
wp_register_style(
'powerkit-contributors-block-editor-style',
plugins_url( 'css/public-powerkit-contributors.css', __FILE__ ),
array( 'wp-edit-blocks' ),
filemtime( plugin_dir_path( __FILE__ ) . 'css/public-powerkit-contributors.css' )
);
wp_style_add_data( 'powerkit-contributors-block-editor-style', 'rtl', 'replace' );
}
/**
* Register block
*
* @param array $blocks all registered blocks.
* @return array
*/
public function register_block_type( $blocks ) {
$users = powerkit_get_users();
$users_choices = array();
foreach ( $users as $user ) {
$users_choices[ $user->ID ] = $user->display_name;
}
$blocks[] = array(
'name' => 'canvas/contributors',
'title' => esc_html__( 'Contributors', 'powerkit' ),
'description' => '',
'category' => 'canvas',
'keywords' => array(),
'icon' => '
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M12.51 9.99C12.51 8.34 11.16 6.99 9.51 6.99C7.86 6.99 6.51 8.34 6.51 9.99C6.51 11.64 7.86 12.99 9.51 12.99C11.16 12.99 12.51 11.64 12.51 9.99ZM9.51 10.99C8.96 10.99 8.51 10.54 8.51 9.99C8.51 9.44 8.96 8.99 9.51 8.99C10.06 8.99 10.51 9.44 10.51 9.99C10.51 10.54 10.06 10.99 9.51 10.99ZM16.01 12.99C17.12 12.99 18.01 12.1 18.01 10.99C18.01 9.88 17.12 8.99 16.01 8.99C14.9 8.99 14 9.88 14.01 10.99C14.01 12.1 14.9 12.99 16.01 12.99ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2V2ZM5.85 17.11C6.53 16.57 8.12 16 9.51 16C9.58 16 9.66 16.01 9.74 16.01C9.98 15.37 10.41 14.72 11.04 14.15C10.48 14.05 9.95 13.99 9.51 13.99C8.21 13.99 6.12 14.44 4.78 15.42C4.28 14.38 4 13.22 4 11.99C4 7.58 7.59 3.99 12 3.99C16.41 3.99 20 7.58 20 11.99C20 13.19 19.73 14.33 19.25 15.36C18.25 14.77 16.89 14.49 16.01 14.49C14.49 14.49 11.51 15.3 11.51 17.19V19.97C9.24 19.84 7.22 18.76 5.85 17.11V17.11Z" />
</svg>
',
'supports' => array(
'className' => true,
'anchor' => true,
'html' => false,
'canvasSpacings' => true,
'canvasBorder' => true,
'canvasResponsive' => true,
),
'styles' => array(),
'location' => array(),
'sections' => array(
'general' => array(
'title' => esc_html__( 'Block Settings', 'powerkit' ),
'priority' => 5,
'open' => true,
),
),
'layouts' => array(),
'fields' => array(
array(
'key' => 'contributors',
'label' => esc_html__( 'Contributors', 'powerkit' ),
'section' => 'general',
'type' => 'react-select',
'choices' => $users_choices,
'multiple' => true,
'default' => array(),
'items' => array(
'type' => 'integer',
),
),
array(
'key' => 'showAvatar',
'label' => esc_html__( 'Display Avatar', 'powerkit' ),
'section' => 'general',
'type' => 'toggle',
'default' => true,
),
array(
'key' => 'showSocialAccounts',
'label' => esc_html__( 'Display Social Links', 'powerkit' ),
'section' => 'general',
'type' => 'toggle',
'default' => true,
),
array(
'key' => 'showBio',
'label' => esc_html__( 'Display Bio', 'powerkit' ),
'section' => 'general',
'type' => 'toggle',
'default' => true,
),
array(
'key' => 'showRecentPosts',
'label' => esc_html__( 'Display Recent Posts', 'powerkit' ),
'section' => 'general',
'type' => 'toggle',
'default' => false,
),
array(
'key' => 'countRecentPosts',
'label' => esc_html__( 'Number of Recent Posts', 'powerkit' ),
'section' => 'general',
'type' => 'number',
'step' => 1,
'min' => 0,
'max' => 1000,
'default' => 3,
'active_callback' => array(
array(
'field' => 'showRecentPosts',
),
),
),
),
'template' => dirname( __FILE__ ) . '/block/render.php',
// enqueue registered scripts/styles.
'editor_style' => 'powerkit-contributors-block-editor-style',
);
return $blocks;
}
}
new Powerkit_Contributors_Block();
@@ -0,0 +1,26 @@
<?php
/**
* The public-facing functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/public
*/
/**
* The public-facing functionality of the module.
*/
class Powerkit_Contributors_Public extends Powerkit_Module_Public {
/**
* Register the stylesheets for the public-facing side of the site.
*/
public function wp_enqueue_scripts() {
wp_enqueue_style( 'powerkit-сontributors', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-contributors.css' ), array(), powerkit_get_setting( 'version' ), 'all' );
// Add RTL support.
wp_style_add_data( 'powerkit-сontributors', 'rtl', 'replace' );
}
}
@@ -0,0 +1,119 @@
<?php
/**
* Widget Contributors
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Powerkit/widgets
*/
/**
* Contributors
*/
class Powerkit_Contributors_Widget extends WP_Widget {
/**
* Sets up a new widget instance.
*/
public function __construct() {
$this->default_settings = apply_filters( 'powerkit_widget_contributors_settings', array(
'title' => esc_html__( 'Contributors', 'powerkit' ),
'filter_ids' => '',
'avatar' => true,
'social_accounts' => true,
) );
$widget_details = array(
'classname' => 'powerkit_widget_contributors',
'description' => '',
);
parent::__construct( 'powerkit_widget_contributors', esc_html__( 'Contributors', 'powerkit' ), $widget_details );
}
/**
* Outputs the content for the current widget instance.
*
* @param array $args Display arguments including 'before_title', 'after_title',
* 'before_widget', and 'after_widget'.
* @param array $instance Settings for the current widget instance.
*/
public function widget( $args, $instance ) {
$params = array_merge( $this->default_settings, $instance );
// Title.
if ( $params['title'] ) {
$params['title'] = apply_filters( 'widget_title', $params['title'], $instance, $this->id_base );
}
powerkit_contributors_get_html( $params, $args );
}
/**
* Handles updating settings for the current widget instance.
*
* @param array $new_instance New settings for this instance as input by the user via
* WP_Widget::form().
* @param array $old_instance Old settings for this instance.
* @return array Settings to save or bool false to cancel saving.
*/
public function update( $new_instance, $old_instance ) {
$instance = $new_instance;
// Display avatar.
if ( ! isset( $instance['avatar'] ) ) {
$instance['avatar'] = false;
}
// Display social accounts.
if ( ! isset( $instance['social_accounts'] ) ) {
$instance['social_accounts'] = false;
}
return $instance;
}
/**
* Outputs the widget settings form.
*
* @param array $instance Current settings.
*/
public function form( $instance ) {
$params = array_merge( $this->default_settings, $instance );
?>
<!-- Title -->
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'powerkit' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $params['title'] ); ?>" /></p>
<!-- Filter by Authors -->
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'filter_ids' ) ); ?>"><?php esc_html_e( 'Filter by authors:', 'powerkit' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'filter_ids' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'filter_ids' ) ); ?>" type="text" value="<?php echo esc_attr( $params['filter_ids'] ); ?>" />
</p>
<p class="help"><?php esc_html_e( 'Add comma-separated list of authors IDs. For example: 1, 2, 3. Leave empty for all authors.' ); ?></p>
<!-- Display avatar -->
<p><input id="<?php echo esc_attr( $this->get_field_id( 'avatar' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'avatar' ) ); ?>" type="checkbox" <?php checked( (bool) $params['avatar'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'avatar' ) ); ?>"><?php esc_html_e( 'Display avatar', 'powerkit' ); ?></label></p>
<?php if ( powerkit_module_enabled( 'social_links' ) ) : ?>
<!-- Display social accounts -->
<p><input id="<?php echo esc_attr( $this->get_field_id( 'social_accounts' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'social_accounts' ) ); ?>" type="checkbox" <?php checked( (bool) $params['social_accounts'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'social_accounts' ) ); ?>"><?php esc_html_e( 'Display social accounts', 'powerkit' ); ?></label></p>
<?php endif; ?>
<?php
}
}
/**
* Register Widget
*/
function powerkit_widget_init_contributors() {
register_widget( 'Powerkit_Contributors_Widget' );
}
add_action( 'widgets_init', 'powerkit_widget_init_contributors' );
@@ -0,0 +1,107 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.pk-widget-contributors {
--pk-contributors-item-border-color: #eeeeee;
--pk-contributors-post-arrow-color: #ced4da;
--pk-contributors-post-arrow-color-hover: #fff;
--pk-contributors-post-arrow-backgroynd-hover: #6c757d;
--pk-contributors-avatar-border-radius: 100%;
--pk-contributors-post-arrow-border-radius: 100%;
--pk-contributors-description-font-size: 80%;
--pk-contributors-post-link-font-size: 0.875rem;
--pk-contributors-post-link-line-height: 1.25rem;
--pk-contributors-post-arrow-font-size: 14px;
}
/*--------------------------------------------------------------*/
.pk-widget-contributors .pk-author-item {
display: flex;
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px var(--pk-contributors-item-border-color) solid;
}
.pk-widget-contributors .pk-author-item:first-child {
margin-top: 0;
padding-top: 0;
border-top: none;
}
.pk-widget-contributors .pk-author-avatar {
flex: 0 0 80px;
width: 80px;
height: 80px;
margin-left: 1rem;
-o-object-fit: cover;
object-fit: cover;
font-family: 'object-fit: cover;';
}
.pk-widget-contributors .pk-author-avatar img {
border-radius: var(--pk-contributors-avatar-border-radius);
}
.pk-widget-contributors .pk-author-data {
flex-grow: 1;
width: 100%;
}
.pk-widget-contributors .pk-author-data .author-name {
margin-top: 0;
margin-bottom: .5rem;
}
.pk-widget-contributors .pk-author-data .author-description {
font-size: var(--pk-contributors-description-font-size);
margin-bottom: .5rem;
}
.pk-widget-contributors .pk-social-links-wrap {
margin-top: .5rem;
}
.pk-widget-contributors .pk-author-posts {
margin-top: 2rem;
}
.pk-widget-contributors .pk-author-posts > .pk-author-posts-single > a {
display: flex;
padding-top: 0.25rem;
padding-bottom: 0.25rem;
position: relative;
padding-right: 2rem;
font-size: var(--pk-contributors-post-link-font-size);
line-height: var(--pk-contributors-post-link-line-height);
}
.pk-widget-contributors .pk-author-posts > .pk-author-posts-single > a:before {
position: absolute;
right: 0;
top: 4px;
font-family: 'powerkit-icons';
content: "\e940";
color: var(--pk-contributors-post-arrow-color);
font-size: var(--pk-contributors-post-arrow-font-size);
margin-left: 1rem;
display: inline-block;
transition: .2s ease all;
display: flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
border-radius: var(--pk-contributors-post-arrow-border-radius);
}
.pk-widget-contributors .pk-author-posts > .pk-author-posts-single > a:hover:before {
color: var(--pk-contributors-post-arrow-color-hover);
transition: .2s ease all;
background: var(--pk-contributors-post-arrow-backgroynd-hover);
}
@@ -0,0 +1,107 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.pk-widget-contributors {
--pk-contributors-item-border-color: #eeeeee;
--pk-contributors-post-arrow-color: #ced4da;
--pk-contributors-post-arrow-color-hover: #fff;
--pk-contributors-post-arrow-backgroynd-hover: #6c757d;
--pk-contributors-avatar-border-radius: 100%;
--pk-contributors-post-arrow-border-radius: 100%;
--pk-contributors-description-font-size: 80%;
--pk-contributors-post-link-font-size: 0.875rem;
--pk-contributors-post-link-line-height: 1.25rem;
--pk-contributors-post-arrow-font-size: 14px;
}
/*--------------------------------------------------------------*/
.pk-widget-contributors .pk-author-item {
display: flex;
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px var(--pk-contributors-item-border-color) solid;
}
.pk-widget-contributors .pk-author-item:first-child {
margin-top: 0;
padding-top: 0;
border-top: none;
}
.pk-widget-contributors .pk-author-avatar {
flex: 0 0 80px;
width: 80px;
height: 80px;
margin-right: 1rem;
-o-object-fit: cover;
object-fit: cover;
font-family: 'object-fit: cover;';
}
.pk-widget-contributors .pk-author-avatar img {
border-radius: var(--pk-contributors-avatar-border-radius);
}
.pk-widget-contributors .pk-author-data {
flex-grow: 1;
width: 100%;
}
.pk-widget-contributors .pk-author-data .author-name {
margin-top: 0;
margin-bottom: .5rem;
}
.pk-widget-contributors .pk-author-data .author-description {
font-size: var(--pk-contributors-description-font-size);
margin-bottom: .5rem;
}
.pk-widget-contributors .pk-social-links-wrap {
margin-top: .5rem;
}
.pk-widget-contributors .pk-author-posts {
margin-top: 2rem;
}
.pk-widget-contributors .pk-author-posts > .pk-author-posts-single > a {
display: flex;
padding-top: 0.25rem;
padding-bottom: 0.25rem;
position: relative;
padding-left: 2rem;
font-size: var(--pk-contributors-post-link-font-size);
line-height: var(--pk-contributors-post-link-line-height);
}
.pk-widget-contributors .pk-author-posts > .pk-author-posts-single > a:before {
position: absolute;
left: 0;
top: 4px;
font-family: 'powerkit-icons';
content: "\e940";
color: var(--pk-contributors-post-arrow-color);
font-size: var(--pk-contributors-post-arrow-font-size);
margin-right: 1rem;
display: inline-block;
transition: .2s ease all;
display: flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
border-radius: var(--pk-contributors-post-arrow-border-radius);
}
.pk-widget-contributors .pk-author-posts > .pk-author-posts-single > a:hover:before {
color: var(--pk-contributors-post-arrow-color-hover);
transition: .2s ease all;
background: var(--pk-contributors-post-arrow-backgroynd-hover);
}
@@ -0,0 +1,101 @@
<?php
/**
* The admin-specific functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/Admin
*/
/**
* The admin-specific functionality of the module.
*/
class Powerkit_Facebook_Admin extends Powerkit_Module_Admin {
/**
* Initialize
*/
public function initialize() {
add_action( 'admin_init', array( $this, 'register_settings_section' ) );
}
/**
* Register admin page
*
* @since 1.0.0
*/
public function register_settings_section() {
add_settings_section( 'powerkit_facebook_settings', sprintf( '<span id="%s">%s</span>', powerkit_get_page_slug( $this->slug ), esc_html__( 'Facebook Comments', 'powerkit' ) ), array( $this, 'powerkit_facebook_settings_callback' ), 'discussion' );
add_settings_field( 'powerkit_facebook_enable_comments', esc_html__( 'Enable Facebook Comments', 'powerkit' ), array( $this, 'powerkit_facebook_enable_comments_callback' ), 'discussion', 'powerkit_facebook_settings' );
add_settings_field( 'powerkit_facebook_number_comments', esc_html__( 'Number of Comments', 'powerkit' ), array( $this, 'powerkit_facebook_number_comments_callback' ), 'discussion', 'powerkit_facebook_settings' );
register_setting( 'discussion', 'powerkit_facebook_enable_comments' );
register_setting( 'discussion', 'powerkit_facebook_number_comments_callback' );
$locations = apply_filters( 'powerkit_facebook_comments_location', array() );
// If locations > 1.
if ( count( (array) $locations ) > 1 ) {
add_settings_field( 'powerkit_facebook_location', esc_html__( 'Location', 'powerkit' ), array( $this, 'powerkit_facebook_location_callback' ), 'discussion', 'powerkit_facebook_settings' );
register_setting( 'discussion', 'powerkit_facebook_location' );
}
}
/**
* Section Description.
*
* @since 1.0.0
*/
public function powerkit_facebook_settings_callback() {
return null;
}
/**
* Field | Enable Facebook Comments.
*
* @since 1.0.0
*/
public function powerkit_facebook_enable_comments_callback() {
?>
<input class="regular-text" id="powerkit_facebook_enable_comments" name="powerkit_facebook_enable_comments" type="checkbox" value="true" <?php checked( (bool) get_option( 'powerkit_facebook_enable_comments', false ) ); ?>>
<?php
}
/**
* Field | Number of Comments.
*
* @since 1.0.0
*/
public function powerkit_facebook_number_comments_callback() {
?>
<input class="small-text" id="powerkit_facebook_number_comments" name="powerkit_facebook_number_comments" type="number" value="<?php echo esc_attr( get_option( 'powerkit_facebook_number_comments', 10 ) ); ?>" /> <?php esc_html_e( 'items', 'powerkit' ); ?>
<?php
}
/**
* Field | Location.
*
* @since 1.0.0
*/
public function powerkit_facebook_location_callback() {
$locations = apply_filters( 'powerkit_facebook_comments_location', array() );
?>
<select class="regular-text" name="powerkit_facebook_location" id="powerkit_facebook_location">
<?php
if ( $locations ) {
foreach ( $locations as $key => $item ) {
?>
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( get_option( 'powerkit_facebook_location' ), $key ); ?>><?php echo esc_attr( $item['name'] ); ?></option>
<?php
}
}
?>
</select>
<?php
}
}
@@ -0,0 +1,73 @@
<?php
/**
* Facebook Integration
*
* @package Powerkit
* @subpackage Modules
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Facebook extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = esc_html__( 'Facebook Integration', 'powerkit' );
$this->desc = esc_html__( 'Display your Facebook Fanpage widget in your sidebar or post content via a shortcode. Enable Facebook comments next to or instead of WordPress comments.', 'powerkit' );
$this->slug = 'facebook_integration';
$this->type = 'default';
$this->category = 'social';
$this->priority = 30;
$this->public = true;
$this->enabled = true;
$this->load_extensions = array(
'connect',
);
$this->links = array(
array(
'name' => esc_html__( 'Go to settings', 'powerkit' ),
'url' => admin_url( sprintf( 'options-discussion.php#%s', powerkit_get_page_slug( $this->slug ) ) ),
),
array(
'name' => esc_html__( 'View documentation', 'powerkit' ),
'url' => powerkit_get_setting( 'documentation' ) . '/social-integrations/facebook-integration/',
'target' => '_blank',
),
);
}
/**
* Initialize module
*/
public function initialize() {
/* Load the required dependencies for this module */
// Helpers Functions for the module.
require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-facebook.php';
// The classes responsible for defining all actions.
require_once dirname( __FILE__ ) . '/public/class-powerkit-facebook-public.php';
require_once dirname( __FILE__ ) . '/public/class-powerkit-facebook-fanpage-widget.php';
require_once dirname( __FILE__ ) . '/public/class-powerkit-facebook-fanpage-shortcode.php';
// Gutenberg blocks.
if ( function_exists( 'register_block_type' ) ) {
require_once dirname( __FILE__ ) . '/public/class-powerkit-facebook-fanpage-block.php';
}
// Admin and public area.
require_once dirname( __FILE__ ) . '/admin/class-powerkit-facebook-admin.php';
require_once dirname( __FILE__ ) . '/public/class-powerkit-facebook-public.php';
new Powerkit_Facebook_Admin( $this->slug );
new Powerkit_Facebook_Public( $this->slug );
}
}
new Powerkit_Facebook();
}
@@ -0,0 +1,23 @@
<?php
/**
* Helpers Facebook
*
* @package Powerkit
* @subpackage Modules/Helper
*/
/**
* Facebook load sdk.
*/
function powerkit_facebook_load_sdk() {
?>
<div id="fb-root"></div>
<script>( function( d, s, id ) {
var js, fjs = d.getElementsByTagName( s )[0];
if ( d.getElementById( id ) ) return;
js = d.createElement( s ); js.id = id;
js.src = "//connect.facebook.net/<?php echo esc_html( powerkit_get_locale() ); ?>/sdk.js#xfbml=1&version=v2.5&appId=<?php echo esc_html( powerkit_connect( 'facebook_app_id' ) ); ?>";
fjs.parentNode.insertBefore( js, fjs );
}( document, 'script', 'facebook-jssdk' ) );</script>
<?php
}
@@ -0,0 +1,6 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){var r;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===a)if(r.toString===Object.prototype.toString)for(var u in r)n.call(r,u)&&r[u]&&e.push(u);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){!function(e){"use strict";function t(e,t,n,r){var o,a=!1,i=0;function u(){o&&clearTimeout(o)}function f(){for(var f=arguments.length,c=new Array(f),l=0;l<f;l++)c[l]=arguments[l];var s=this,p=Date.now()-i;function b(){i=Date.now(),n.apply(s,c)}function d(){o=void 0}a||(r&&!o&&b(),u(),void 0===r&&p>e?b():!0!==t&&(o=setTimeout(r?d:b,void 0===r?e-p:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),f.cancel=function(){u(),a=!0},f}e.debounce=function(e,n,r){return void 0===r?t(e,n,!1):t(e,r,!1!==n)},e.throttle=t,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){e.exports=n(6)},,,,function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(1);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var o=b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}function s(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?p(e):t}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=wp.i18n.__,y=wp.element,h=y.Component,m=y.Fragment,v=y.createRef,w=wp.components,g=w.Placeholder,O=w.Disabled,_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(s,e);var t,n,r,i=l(s);function s(){var e;return u(this,s),(e=i.apply(this,arguments)).fbRef=v(),e.maybeInit=Object(a.debounce)(300,e.maybeInit.bind(p(e))),e}return t=s,(n=[{key:"componentDidMount",value:function(){this.maybeInit()}},{key:"componentDidUpdate",value:function(){this.maybeInit()}},{key:"maybeInit",value:function(){var e=this.props.attributes.href;if(this.fbRef&&this.fbRef.current&&e&&window.FB&&window.FB.XFBML){var t=this.fbRef.current,n=this.props.attributes,r=n.showCover,o=n.showFacepile,a=n.showPosts,i=n.smallHeader,u=r?"false":"true";o=o?"true":"false",a=a?"true":"false",i=i?"true":"false";var f=t.getAttribute("fb-iframe-plugin-query");if(f){var c=!1;try{c=JSON.parse('{"'+decodeURIComponent(f).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}catch(e){c=!1}if(c&&c.href===e&&c.hide_cover===u&&c.show_facepile===o&&c.show_posts===a&&c.small_header===i)return}t.attributes["fb-xfbml-state"]&&(t.attributes["fb-xfbml-state"]="re-rendering"),FB.XFBML.parse(t.parentNode)}}},{key:"render",value:function(){this.props.setAttributes;var e=this.props.className,t=this.props.attributes,n=t.href,r=t.showCover,a=t.showFacepile,i=t.showPosts,u=t.smallHeader,f=t.canvasClassName;return e=o()("fb-page-wrapper",f,e),wp.element.createElement(m,null,n?wp.element.createElement(O,null,wp.element.createElement("div",{className:e},wp.element.createElement("div",{className:"fb-page",ref:this.fbRef,"data-href":n,"data-hide-cover":r?"false":"true","data-show-facepile":a?"true":"false","data-show-posts":i?"true":"false","data-small-header":u?"true":"false","data-adapt-container-width":"true"}))):wp.element.createElement(g,null,d("Please, enter Facebook Fanpage URL.")))}}])&&f(t.prototype,n),r&&f(t,r),s}(h);(0,wp.hooks.addFilter)("canvas.customBlock.editRender","canvas/facebook-fanpage/editRender",(function(e,t){return"canvas/facebook-fanpage"===t.name?wp.element.createElement(_,t):e}))}]);
@@ -0,0 +1,31 @@
/**
* WordPress dependencies
*/
const {
addFilter,
} = wp.hooks;
/**
* Internal dependencies
*/
import FacebookFanpageBlockEdit from './edit.jsx';
/**
* Custom block Edit output for FacebookFanpage block.
*
* @param {JSX} edit Original block edit.
* @param {Object} blockProps Block data.
*
* @return {JSX} Block edit.
*/
function editRender(edit, blockProps) {
if ('canvas/facebook-fanpage' === blockProps.name) {
return (
<FacebookFanpageBlockEdit {...blockProps} />
);
}
return edit;
}
addFilter('canvas.customBlock.editRender', 'canvas/facebook-fanpage/editRender', editRender);
@@ -0,0 +1,152 @@
/**
* External dependencies
*/
import classnames from 'classnames';
import { debounce } from 'throttle-debounce';
/**
* WordPress dependencies
*/
const { __ } = wp.i18n;
const {
Component,
Fragment,
createRef,
} = wp.element;
const {
Placeholder,
Disabled,
} = wp.components;
/**
* Component
*/
export default class FacebookFanpageBlockEdit extends Component {
constructor() {
super( ...arguments );
this.fbRef = createRef();
this.maybeInit = debounce( 300, this.maybeInit.bind( this ) );
}
componentDidMount() {
this.maybeInit();
}
componentDidUpdate() {
this.maybeInit();
}
maybeInit() {
const {
href,
} = this.props.attributes;
if ( ! this.fbRef || ! this.fbRef.current ) {
return;
}
if ( ! href || ! window.FB || ! window.FB.XFBML ) {
return;
}
const $ref = this.fbRef.current;
let {
showCover,
showFacepile,
showPosts,
smallHeader,
} = this.props.attributes;
const hideCover = showCover ? 'false' : 'true';
showFacepile = showFacepile ? 'true' : 'false';
showPosts = showPosts ? 'true' : 'false';
smallHeader = smallHeader ? 'true' : 'false';
// check if already rendered
const $query = $ref.getAttribute( 'fb-iframe-plugin-query' );
if ( $query ) {
let queryObj = false;
try {
// thanks https://stackoverflow.com/questions/8648892/convert-url-parameters-to-a-javascript-object
queryObj = JSON.parse('{"' + decodeURIComponent( $query ).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}');
} catch( e ) {
queryObj = false;
}
if (
queryObj &&
queryObj.href === href &&
queryObj.hide_cover === hideCover &&
queryObj.show_facepile === showFacepile &&
queryObj.show_posts === showPosts &&
queryObj.small_header === smallHeader
) {
return;
}
}
// try to re-render
if ( $ref.attributes['fb-xfbml-state'] ) {
$ref.attributes['fb-xfbml-state'] = 're-rendering';
}
FB.XFBML.parse( $ref.parentNode );
}
render() {
const {
setAttributes,
} = this.props;
let {
className,
} = this.props;
const {
href,
showCover,
showFacepile,
showPosts,
smallHeader,
canvasClassName,
} = this.props.attributes;
className = classnames(
'fb-page-wrapper',
canvasClassName,
className
);
return (
<Fragment>
{ href ? (
<Disabled>
<div
className={ className }
>
<div className="fb-page"
ref={ this.fbRef }
data-href={ href }
data-hide-cover={ showCover ? 'false' : 'true' }
data-show-facepile={ showFacepile ? 'true' : 'false' }
data-show-posts={ showPosts ? 'true' : 'false' }
data-small-header={ smallHeader ? 'true' : 'false' }
data-adapt-container-width="true"
/>
</div>
</Disabled>
) : (
<Placeholder>
{ __( 'Please, enter Facebook Fanpage URL.' ) }
</Placeholder>
) }
</Fragment>
);
}
}
@@ -0,0 +1,26 @@
<?php
/**
* Facebook Fanpage block template
*
* @var $attributes - block attributes
* @var $options - layout options
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package PowerKit
* @subpackage PowerKit/templates
*/
?>
<div class="<?php echo esc_attr( $attributes['className'] ); ?>" <?php echo ( isset( $attributes['anchor'] ) ? ' id="' . esc_attr( $attributes['anchor'] ) . '"' : '' ); ?>>
<div class="fb-page"
data-href="<?php echo esc_url( $attributes['href'] ); ?>"
data-hide-cover="<?php echo esc_attr( $attributes['showCover'] ? 'false' : 'true' ); ?>"
data-show-facepile="<?php echo esc_attr( $attributes['showFacepile'] ? 'true' : 'false' ); ?>"
data-show-posts="<?php echo esc_attr( $attributes['showPosts'] ? 'true' : 'false' ); ?>"
data-small-header="<?php echo esc_attr( $attributes['smallHeader'] ? 'true' : 'false' ); ?>"
data-adapt-container-width="true"
></div>
</div>
@@ -0,0 +1,125 @@
<?php
/**
* Facebook Fanpage Block.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/public
*/
/**
* Initialize Facebook Fanpage block.
*/
class Powerkit_Block_Facebook_Fanpage {
/**
* Initialize
*/
public function __construct() {
add_action( 'init', array( $this, 'init' ) );
add_filter( 'canvas_register_block_type', array( $this, 'register_block_type' ) );
}
/**
* Enqueue the block's assets for the editor.
*/
public function init() {
// Editor Scripts.
wp_register_script(
'powerkit-block-facebook-fanpage-editor-script',
plugins_url( 'block/block.js', __FILE__ ),
array( 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-editor', 'lodash', 'jquery' ),
filemtime( plugin_dir_path( __FILE__ ) . 'block/block.js' ),
true
);
}
/**
* Register block
*
* @param array $blocks all registered blocks.
* @return array
*/
public function register_block_type( $blocks ) {
$blocks[] = array(
'name' => 'canvas/facebook-fanpage',
'title' => esc_html__( 'Facebook Fanpage', 'powerkit' ),
'description' => '',
'category' => 'canvas',
'keywords' => array( 'facebook', 'fanpage' ),
'icon' => '
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M20 3H4C3.4 3 3 3.4 3 4V20C3 20.5 3.4 21 4 21H12.6V14H10.3V11.3H12.6V9.3C12.6 7 14 5.7 16.1 5.7C17.1 5.7 17.9 5.8 18.2 5.8V8.2H16.8C15.7 8.2 15.5 8.7 15.5 9.5V11.2H18.2L17.8 14H15.5V21H20C20.5 21 21 20.6 21 20V4C21 3.4 20.6 3 20 3Z" />
</svg>
',
'supports' => array(
'className' => true,
'anchor' => true,
'html' => false,
'canvasSpacings' => true,
'canvasBorder' => true,
'canvasResponsive' => true,
),
'styles' => array(),
'location' => array(),
'sections' => array(
'general' => array(
'title' => esc_html__( 'Block Settings', 'powerkit' ),
'priority' => 5,
'open' => true,
),
),
'layouts' => array(),
// Set fields just for add block attributes.
// Editor render for this block is custom JSX
// so we don't need to render fields automatically.
'fields' => array(
array(
'key' => 'href',
'label' => esc_html__( 'Facebook Fanpage URL', 'powerkit' ),
'type' => 'text',
'section' => 'general',
'default' => '',
),
array(
'key' => 'showCover',
'label' => esc_html__( 'Display Cover', 'powerkit' ),
'type' => 'toggle',
'section' => 'general',
'default' => true,
),
array(
'key' => 'showFacepile',
'label' => esc_html__( 'Display Facepile', 'powerkit' ),
'type' => 'toggle',
'section' => 'general',
'default' => false,
),
array(
'key' => 'showPosts',
'label' => esc_html__( 'Display Posts', 'powerkit' ),
'type' => 'toggle',
'section' => 'general',
'default' => false,
),
array(
'key' => 'smallHeader',
'label' => esc_html__( 'Small Header', 'powerkit' ),
'type' => 'toggle',
'section' => 'general',
'default' => false,
),
),
'template' => dirname( __FILE__ ) . '/block/render.php',
// enqueue registered scripts/styles.
'editor_script' => 'powerkit-block-facebook-fanpage-editor-script',
);
return $blocks;
}
}
new Powerkit_Block_Facebook_Fanpage();
@@ -0,0 +1,103 @@
<?php
/**
* Shortcode Facebook Fanpage
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package PowerKit
* @subpackage PowerKit/shortcodes
*/
/**
* Facebook Fanpage Shortcode
*
* @param array $atts User defined attributes in shortcode tag.
* @param string $content Shorcode tag content.
* @return string Shortcode result HTML.
*/
function powerkit_facebook_fanpage_shortcode( $atts, $content = '' ) {
$params = powerkit_shortcode_atts( shortcode_atts( array(
'href' => '',
'hide_cover' => false,
'show_facepile' => false,
'show_posts' => false,
'small_header' => false,
'adapt_container_width' => true,
), $atts ) );
$params['hide_cover'] = filter_var( $params['hide_cover'], FILTER_VALIDATE_BOOLEAN );
$params['show_facepile'] = filter_var( $params['show_facepile'], FILTER_VALIDATE_BOOLEAN );
$params['show_posts'] = filter_var( $params['show_posts'], FILTER_VALIDATE_BOOLEAN );
$params['small_header'] = filter_var( $params['small_header'], FILTER_VALIDATE_BOOLEAN );
$params['adapt_container_width'] = filter_var( $params['adapt_container_width'], FILTER_VALIDATE_BOOLEAN );
ob_start();
if ( $params['href'] ) {
?>
<div class="fb-page-wrapper">
<div class="fb-page"
data-href="<?php echo esc_attr( $params['href'] ); ?>"
data-hide-cover="<?php echo esc_attr( $params['hide_cover'] ? 'true' : 'false' ); ?>"
data-show-facepile="<?php echo esc_attr( $params['show_facepile'] ? 'true' : 'false' ); ?>"
data-show-posts="<?php echo esc_attr( $params['show_posts'] ? 'true' : 'false' ); ?>"
data-small-header="<?php echo esc_attr( $params['small_header'] ? 'true' : 'false' ); ?>"
data-adapt-container-width="<?php echo esc_attr( $params['adapt_container_width'] ? 'true' : 'false' ); ?>">
</div>
</div>
<?php
} else {
powerkit_alert_warning( esc_html__( 'The "Facebook Fanpage URL" field is required!', 'powerkit' ) );
}
return ob_get_clean();
}
add_shortcode( 'powerkit_facebook_fanpage', 'powerkit_facebook_fanpage_shortcode' );
/**
* Map Facebook Fanpage Shortcode into the Basic Shortcodes Plugin
*/
if ( function_exists( 'powerkit_basic_shortcodes_register' ) ) :
powerkit_basic_shortcodes_register( array(
'name' => 'facebook_fanpage',
'title' => esc_html__( 'Facebook Fanpage', 'powerkit' ),
'priority' => 150,
'base' => 'powerkit_facebook_fanpage',
'autoregister' => false,
'fields' => array(
array(
'type' => 'input',
'name' => 'href',
'label' => esc_html__( 'Facebook fanpage URL', 'powerkit' ),
),
array(
'type' => 'checkbox',
'name' => 'hide_cover',
'label' => esc_html__( 'Hide cover', 'powerkit' ),
'default' => false,
),
array(
'type' => 'checkbox',
'name' => 'show_facepile',
'label' => esc_html__( 'Show facepile', 'powerkit' ),
'default' => false,
),
array(
'type' => 'checkbox',
'name' => 'show_posts',
'label' => esc_html__( 'Show posts', 'powerkit' ),
'default' => false,
),
array(
'type' => 'checkbox',
'name' => 'small_header',
'label' => esc_html__( 'Small header', 'powerkit' ),
'default' => false,
),
),
) );
endif;
@@ -0,0 +1,162 @@
<?php
/**
* Widget Facebook Fanpage
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package PowerKit
* @subpackage PowerKit/widgets
*/
/**
* Widget Facebook Fanpage Class
*/
class Powerkit_Facebook_Fanpage_Widget extends WP_Widget {
/**
* Sets up a new widget instance.
*/
public function __construct() {
$this->default_settings = apply_filters( 'powerkit_facebook_fanpage_widget_settings', array(
'title' => esc_html__( 'Facebook Fanpage', 'powerkit' ),
'href' => '',
'hide_cover' => false,
'show_facepile' => false,
'show_posts' => false,
'small_header' => false,
'adapt_container_width' => true,
) );
$widget_details = array(
'classname' => 'powerkit_facebook_fanpage_widget',
'description' => esc_html__( 'A Facebook Fanpage widget.', 'powerkit' ),
);
parent::__construct( 'powerkit_facebook_fanpage_widget', esc_html__( 'Facebook Fanpage', 'powerkit' ), $widget_details );
}
/**
* Outputs the content for the current widget instance.
*
* @param array $args Display arguments including 'before_title', 'after_title',
* 'before_widget', and 'after_widget'.
* @param array $instance Settings for the current widget instance.
*/
public function widget( $args, $instance ) {
$params = array_merge( $this->default_settings, $instance );
// Before Widget.
echo $args['before_widget']; // XSS OK.
?>
<div class="widget-body">
<?php
// Title.
if ( $params['title'] ) {
echo $args['before_title'] . apply_filters( 'widget_title', wp_kses( $params['title'], 'pk-title' ), $instance, $this->id_base ) . $args['after_title']; // XSS.
}
if ( $params['href'] ) {
?>
<div class="fb-page-wrapper">
<div class="fb-page"
data-href="<?php echo esc_attr( $params['href'] ); ?>"
data-hide-cover="<?php echo esc_attr( $params['hide_cover'] ? 'true' : 'false' ); ?>"
data-show-facepile="<?php echo esc_attr( $params['show_facepile'] ? 'true' : 'false' ); ?>"
data-show-posts="<?php echo esc_attr( $params['show_posts'] ? 'true' : 'false' ); ?>"
data-small-header="<?php echo esc_attr( $params['small_header'] ? 'true' : 'false' ); ?>"
data-adapt-container-width="<?php echo esc_attr( $params['adapt_container_width'] ? 'true' : 'false' ); ?>"
data-width="500px">
</div>
</div>
<?php
} else {
powerkit_alert_warning( esc_html__( 'The "Facebook Fanpage URL" field is required!', 'powerkit' ) );
}
?>
</div>
<?php
// After Widget.
echo $args['after_widget']; // XSS OK.
}
/**
* Handles updating settings for the current widget instance.
*
* @param array $new_instance New settings for this instance as input by the user via
* WP_Widget::form().
* @param array $old_instance Old settings for this instance.
* @return array Settings to save or bool false to cancel saving.
*/
public function update( $new_instance, $old_instance ) {
$instance = $new_instance;
// Hide cover.
if ( ! isset( $instance['hide_cover'] ) ) {
$instance['hide_cover'] = false;
}
// Show facepile.
if ( ! isset( $instance['show_facepile'] ) ) {
$instance['show_facepile'] = false;
}
// Show posts.
if ( ! isset( $instance['show_posts'] ) ) {
$instance['show_posts'] = false;
}
// Small header.
if ( ! isset( $instance['small_header'] ) ) {
$instance['small_header'] = false;
}
return $instance;
}
/**
* Outputs the widget settings form.
*
* @param array $instance Current settings.
*/
public function form( $instance ) {
$params = array_merge( $this->default_settings, $instance );
?>
<!-- Title -->
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'powerkit' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $params['title'] ); ?>" /></p>
<!-- Facebook Fanpage URL -->
<p><label for="<?php echo esc_attr( $this->get_field_id( 'href' ) ); ?>"><?php esc_html_e( 'Facebook fanpage URL:', 'powerkit' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'href' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'href' ) ); ?>" type="text" value="<?php echo esc_attr( $params['href'] ); ?>" /></p>
<!-- Hide Cover -->
<p><input id="<?php echo esc_attr( $this->get_field_id( 'hide_cover' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'hide_cover' ) ); ?>" type="checkbox" <?php checked( (bool) $params['hide_cover'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'hide_cover' ) ); ?>"><?php esc_html_e( 'Hide cover', 'powerkit' ); ?></label></p>
<!-- Show Facepile -->
<p><input id="<?php echo esc_attr( $this->get_field_id( 'show_facepile' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'show_facepile' ) ); ?>" type="checkbox" <?php checked( (bool) $params['show_facepile'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'show_facepile' ) ); ?>"><?php esc_html_e( 'Show facepile', 'powerkit' ); ?></label></p>
<!-- Show Posts -->
<p><input id="<?php echo esc_attr( $this->get_field_id( 'show_posts' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'show_posts' ) ); ?>" type="checkbox" <?php checked( (bool) $params['show_posts'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'show_posts' ) ); ?>"><?php esc_html_e( 'Show posts', 'powerkit' ); ?></label></p>
<!-- Small Header -->
<p><input id="<?php echo esc_attr( $this->get_field_id( 'small_header' ) ); ?>" class="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'small_header' ) ); ?>" type="checkbox" <?php checked( (bool) $params['small_header'] ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'small_header' ) ); ?>"><?php esc_html_e( 'Small header', 'powerkit' ); ?></label></p>
<?php
}
}
/**
* Register Widget
*/
function powerkit_widget_init_facebook() {
register_widget( 'Powerkit_Facebook_Fanpage_Widget' );
}
add_action( 'widgets_init', 'powerkit_widget_init_facebook' );
@@ -0,0 +1,157 @@
<?php
/**
* The public-facing functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/public
*/
/**
* The public-facing functionality of the module.
*/
class Powerkit_Facebook_Public extends Powerkit_Module_Public {
/**
* Initialize
*/
public function initialize() {
add_action( 'init', array( $this, 'facebook_load_sdk' ) );
add_action( 'current_screen', array( $this, 'facebook_load_sdk_gutenberg' ) );
add_action( 'init', array( $this, 'register_locations' ) );
add_filter( 'powerkit_facebook_comments_location', array( $this, 'location_default' ) );
}
/**
* Init Facebook
*
* @since 1.0.0
* @access private
*/
public function facebook_load_sdk() {
add_action( 'wp_footer', 'powerkit_facebook_load_sdk' );
}
/**
* Init Facebook in Gutenberg editor
*
* @since 1.0.0
* @access private
*/
public function facebook_load_sdk_gutenberg() {
global $current_screen;
$current_screen = get_current_screen();
// add on the editor page.
if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) {
add_action( 'admin_footer', 'powerkit_facebook_load_sdk' );
}
}
/**
* Facebook Register Locations
*
* @since 1.0.0
* @access private
*/
public function register_locations() {
$locations = apply_filters( 'powerkit_facebook_comments_location', array() );
$powerkit_facebook_enable_comments = get_option( 'powerkit_facebook_enable_comments' );
$powerkit_facebook_location = get_option( 'powerkit_facebook_location' );
// Select location.
if ( isset( $locations[ $powerkit_facebook_location ] ) ) {
$location = $locations[ $powerkit_facebook_location ];
} elseif ( isset( $locations['default'] ) ) {
$location = $locations['default'];
} else {
$location = false;
}
if ( $powerkit_facebook_enable_comments && $location ) {
$priority = (int) isset( $location['priority'] ) ? $location['priority'] : 99;
if ( 'comments_template' === $location['action'] ) {
add_filter( 'comments_template', function () {
return plugin_dir_path( dirname( __FILE__ ) ) . 'public/facebook-comments-template.php';
}, $priority );
} elseif ( 'before_comments' === $location['action'] ) {
add_action( 'comments_template', function () {
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/facebook-comments-template.php';
}, $priority );
} elseif ( 'after_comments' === $location['action'] ) {
/**
* Filter After WordPress Comments
*/
function powerkit_filter_comments_template() {
remove_filter( 'comments_template', 'powerkit_filter_comments_template', 99 );
comments_template();
return plugin_dir_path( dirname( __FILE__ ) ) . 'public/facebook-comments-template.php';
}
add_filter( 'comments_template', 'powerkit_filter_comments_template', 99 );
} else {
add_action( $location['action'], function () {
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/facebook-comments-template.php';
}, $priority );
}
}
}
/**
* Filter Register Locations
*
* @since 1.0.0
* @access private
*
* @param array $locations List of Locations.
*/
public function location_default( $locations = array() ) {
$locations = array(
'before_comments' => array(
'name' => 'Before WordPress Comments',
'action' => 'before_comments',
'priority' => 99,
),
'after_comments' => array(
'name' => 'After WordPress Comments',
'action' => 'after_comments',
'priority' => 99,
),
'default' => array(
'name' => 'In place of WordPress Comments',
'action' => 'comments_template',
'priority' => 99,
),
);
return $locations;
}
/**
* Register the stylesheets for the public-facing side of the site.
*/
public function wp_enqueue_scripts() {
wp_enqueue_style( 'powerkit-facebook', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-facebook.css' ), array(), powerkit_get_setting( 'version' ), 'all' );
// Add RTL support.
wp_style_add_data( 'powerkit-facebook', 'rtl', 'replace' );
}
}
@@ -0,0 +1,23 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.fb-page-wrapper {
overflow: hidden;
}
.fb-comments {
margin-top: 3rem;
}
.fb-comments,
.fb-comments iframe[style],
.fb-comments span {
width: 100% !important;
right: 0;
}
@@ -0,0 +1,23 @@
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
/**
* Environment for all styles (variables, additions, etc).
*/
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
.fb-page-wrapper {
overflow: hidden;
}
.fb-comments {
margin-top: 3rem;
}
.fb-comments,
.fb-comments iframe[style],
.fb-comments span {
width: 100% !important;
left: 0;
}
@@ -0,0 +1,22 @@
<?php
/**
* Facebook Comments Template
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package PowerKit
* @subpackage PowerKit/templates
*/
?>
<?php
if ( powerkit_connect( 'facebook_app_id' ) ) {
?>
<div class="fb-comments" data-width="100%" data-href="<?php the_permalink(); ?>" data-numposts="<?php get_option( 'powerkit_facebook_number_comments', 10 ); ?>"></div>
<?php
} else {
/* translators: Facebook API Link. */
powerkit_alert_warning( __( 'Warning: Facebook ID not specified!', 'powerkit' ) );
}
@@ -0,0 +1,211 @@
<?php
/**
* The admin-specific functionality of the module.
*
* @link https://codesupply.co
* @since 1.0.0
*
* @package Powerkit
* @subpackage Modules/Admin
*/
/**
* The admin-specific functionality of the module.
*/
class Powerkit_Featured_Categories_Admin extends Powerkit_Module_Admin {
/**
* Initialize
*/
public function initialize() {
add_action( 'category_add_form_fields', array( $this, 'category_add_form_fields' ), 10 );
add_action( 'category_edit_form_fields', array( $this, 'category_edit_form_fields' ), 10, 2 );
add_action( 'created_category', array( $this, 'save_category' ), 10, 2 );
add_action( 'edited_category', array( $this, 'save_category' ), 10, 2 );
}
/**
* Add fields to Category
*
* @param string $taxonomy The taxonomy slug.
*/
public function category_add_form_fields( $taxonomy ) {
wp_nonce_field( 'category_options', 'powerkit_category' );
?>
<div class="form-field">
<label><?php esc_html_e( 'Featured Image', 'powerkit' ); ?></label>
<div class="pk-featured-image" data-frame-title="<?php esc_html_e( 'Select or upload image', 'powerkit' ); ?>" data-frame-btn-text="<?php esc_html_e( 'Set image', 'powerkit' ); ?>">
<p class="uploaded-img-box">
<span class="uploaded-image"></span>
<input id="powerkit_featured_image" class="uploaded-img-id" name="powerkit_featured_image" type="hidden"/>
</p>
<p class="hide-if-no-js">
<a class="upload-img-link button button-primary" href="#"><?php esc_html_e( 'Upload image', 'powerkit' ); ?></a>
<a class="delete-img-link button button-secondary hidden" href="#"><?php esc_html_e( 'Remove image', 'powerkit' ); ?></a>
</p>
</div>
<p><?php esc_html_e( 'This image is used in the category blocks.', 'powerkit' ); ?></p>
</div>
<br>
<?php
}
/**
* Edit fields from Category
*
* @param object $tag Current taxonomy term object.
* @param string $taxonomy Current taxonomy slug.
*/
public function category_edit_form_fields( $tag, $taxonomy ) {
wp_nonce_field( 'category_options', 'powerkit_category' );
$powerkit_featured_image = get_term_meta( $tag->term_id, 'powerkit_featured_image', true );
?>
<tr class="form-field">
<th scope="row" valign="top">
<label for="powerkit_featured_image"><?php esc_html_e( 'Featured Image', 'powerkit' ); ?></label>
</th>
<td>
<div class="pk-featured-image" data-frame-title="<?php esc_html_e( 'Select or upload image', 'powerkit' ); ?>" data-frame-btn-text="<?php esc_html_e( 'Set image', 'powerkit' ); ?>">
<p class="uploaded-img-box">
<span class="uploaded-image">
<?php if ( $powerkit_featured_image ) : ?>
<?php
echo wp_get_attachment_image( $powerkit_featured_image, 'large', false, array(
'style' => 'max-width:100%; height: auto;',
) );
?>
<?php endif; ?>
</span>
<input id="powerkit_featured_image" class="uploaded-img-id" name="powerkit_featured_image" type="hidden" value="<?php echo esc_attr( $powerkit_featured_image ); ?>" />
</p>
<p class="hide-if-no-js">
<a class="upload-img-link button button-primary <?php echo esc_attr( $powerkit_featured_image ? 'hidden' : '' ); ?>" href="#"><?php esc_html_e( 'Upload image', 'powerkit' ); ?></a>
<a class="delete-img-link button button-secondary <?php echo esc_attr( ! $powerkit_featured_image ? 'hidden' : '' ); ?>" href="#"><?php esc_html_e( 'Remove image', 'powerkit' ); ?></a>
</p>
</div>
<p class="description"><?php esc_html_e( 'This image is used in the category blocks.', 'powerkit' ); ?></p>
</td>
</tr>
<?php
}
/**
* Save category fields
*
* @param int $term_id ID of the term about to be edited.
* @param string $taxonomy Taxonomy slug of the related term.
*/
public function save_category( $term_id, $taxonomy ) {
// Bail if we're doing an auto save.
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
// if our nonce isn't there, or we can't verify it, bail.
if ( ! isset( $_POST['powerkit_category'] ) || ! wp_verify_nonce( $_POST['powerkit_category'], 'category_options' ) ) { // Input var ok; sanitization ok.
return;
}
if ( isset( $_POST['powerkit_featured_image'] ) ) { // Input var ok; sanitization ok.
$powerkit_featured_image = sanitize_text_field( $_POST['powerkit_featured_image'] ); // Input var ok; sanitization ok.
update_term_meta( $term_id, 'powerkit_featured_image', $powerkit_featured_image );
}
}
/**
* Register the stylesheets and JavaScript for the admin area.
*
* @param string $page Current page.
*/
public function admin_enqueue_scripts( $page ) {
if ( 'edit-tags.php' === $page || 'term.php' === $page ) {
wp_enqueue_script( 'jquery' );
wp_enqueue_media();
ob_start();
?>
<script>
( function() {
var powerkitFeaturedContainer = '.pk-featured-image';
var powerkitFeaturedFrame;
jQuery( document ).ready( function( $ ) {
/* Add Image Link */
jQuery( powerkitFeaturedContainer ).find( '.upload-img-link' ).on( 'click', function( event ){
event.preventDefault();
var parentContainer = $( this ).parents( powerkitFeaturedContainer );
// Options.
var options = {
title: parentContainer.data( 'frame-title' ) ? parentContainer.data( 'frame-title' ) : 'Select or Upload Media',
button: {
text: parentContainer.data( 'frame-btn-text' ) ? parentContainer.data( 'frame-btn-text' ) : 'Use this media',
},
library : { type : 'image' },
multiple: false // Set to true to allow multiple files to be selected.
};
// Create a new media frame
powerkitFeaturedFrame = wp.media( options );
// When an image is selected in the media frame...
powerkitFeaturedFrame.on( 'select', function() {
// Get media attachment details from the frame state.
var attachment = powerkitFeaturedFrame.state().get('selection').first().toJSON();
// Send the attachment URL to our custom image input field.
parentContainer.find( '.uploaded-image' ).html( '<img src="' + attachment.url + '" style="max-width:100%;"/>' );
parentContainer.find( '.uploaded-img-id' ).val( attachment.id ).change();
parentContainer.find( '.upload-img-link' ).addClass( 'hidden' );
parentContainer.find( '.delete-img-link' ).removeClass( 'hidden' );
powerkitFeaturedFrame.close();
});
// Finally, open the modal on click.
powerkitFeaturedFrame.open();
});
/* Delete Image Link */
$( powerkitFeaturedContainer ).find( '.delete-img-link' ).on( 'click', function( event ){
event.preventDefault();
$( this ).parents( powerkitFeaturedContainer ).find( '.uploaded-image' ).html( '' );
$( this ).parents( powerkitFeaturedContainer ).find( '.upload-img-link' ).removeClass( 'hidden' );
$( this ).parents( powerkitFeaturedContainer ).find( '.delete-img-link' ).addClass( 'hidden' );
$( this ).parents( powerkitFeaturedContainer ).find( '.uploaded-img-id' ).val( '' ).change();
});
});
jQuery( document ).ajaxSuccess(function(e, request, settings){
let action = settings.data.indexOf( 'action=add-tag' );
let screen = settings.data.indexOf( 'screen=edit-category' );
let taxonomy = settings.data.indexOf( 'taxonomy=category' );
if( action > -1 && screen > -1 && taxonomy > -1 ){
$( powerkitFeaturedContainer ).find( '.delete-img-link' ).click();
}
});
} )();
</script>
<?php
wp_add_inline_script( 'jquery', str_replace( array( '<script>', '</script>' ), '', ob_get_clean() ) );
}
}
}
@@ -0,0 +1,60 @@
<?php
/**
* Featured Categories
*
* @package Powerkit
* @subpackage Modules
*/
if ( class_exists( 'Powerkit_Module' ) ) {
/**
* Init module
*/
class Powerkit_Featured_Categories extends Powerkit_Module {
/**
* Register module
*/
public function register() {
$this->name = esc_html__( 'Featured Categories', 'powerkit' );
$this->desc = esc_html__( 'Display Featured Categories.', 'powerkit' );
$this->slug = 'featured_categories';
$this->type = 'default';
$this->category = 'content';
$this->priority = 150;
$this->public = true;
$this->enabled = true;
$this->links = array(
array(
'name' => esc_html__( 'View documentation', 'powerkit' ),
'url' => powerkit_get_setting( 'documentation' ) . '/featured-categories/',
'target' => '_blank',
),
);
}
/**
* Initialize module
*/
public function initialize() {
// Helpers Functions for the module.
require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-featured-categories.php';
// The classes responsible for defining all actions.
require_once dirname( __FILE__ ) . '/public/class-powerkit-featured-categories-widget.php';
if ( function_exists( 'register_block_type' ) ) {
require_once dirname( __FILE__ ) . '/public/class-powerkit-featured-categories-block.php';
}
// Admin and public area.
require_once dirname( __FILE__ ) . '/admin/class-powerkit-featured-categories-admin.php';
require_once dirname( __FILE__ ) . '/public/class-powerkit-featured-categories-public.php';
new Powerkit_Featured_Categories_Admin( $this->slug );
new Powerkit_Featured_Categories_Public( $this->slug );
}
}
new Powerkit_Featured_Categories();
}

Some files were not shown because too many files have changed in this diff Show More