initial commit
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin Class
|
||||
*
|
||||
* Handles admin side functionality of plugin
|
||||
*
|
||||
* @package WP Trending Post Slider and Widget
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Wtpsw_Admin {
|
||||
|
||||
function __construct() {
|
||||
|
||||
// Action to register admin menu
|
||||
add_action( 'admin_menu', array( $this, 'wtpsw_register_menu' ));
|
||||
|
||||
// Action to register plugin settings
|
||||
add_action ( 'admin_init', array( $this,'wtpsw_admin_processes' ));
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to register admin menus
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function wtpsw_register_menu() {
|
||||
|
||||
// Register Setting Page
|
||||
add_menu_page ( __( 'Trending Post', 'wtpsw' ), __( 'Trending Post', 'wtpsw' ), 'manage_options', 'wtpsw-settings', array( $this, 'wtpsw_settings_page' ), 'dashicons-star-filled' );
|
||||
|
||||
// Register How It Work Page
|
||||
add_submenu_page( 'wtpsw-settings', __( 'Getting Started - WP Trending Post Slider and Widget', 'wtpsw' ), __( 'Getting Started', 'wtpsw' ), 'edit_posts', 'wtpsw-help', array( $this, 'wtpsw_designs_page' ) );
|
||||
|
||||
// Register plugin premium page
|
||||
add_submenu_page( 'wtpsw-settings', __( 'Upgrade To Premium - Trending/Popular Post Slider and Widget', 'wtpsw' ), '<span style="color:#ff2700">'.__( 'Upgrade To Premium', 'wtpsw' ).'</span>', 'manage_options', 'wtpsw-premium', array( $this, 'wtpsw_premium_page' ));
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to handle the setting page html
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function wtpsw_settings_page() {
|
||||
include_once( WTPSW_DIR . '/includes/admin/form/wtpsw-settings.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* How It Work Page
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function wtpsw_designs_page() {
|
||||
include_once( WTPSW_DIR . '/includes/admin/wtpsw-how-it-works.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade to PRO Vs Free
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function wtpsw_premium_page() {
|
||||
include_once( WTPSW_DIR . '/includes/admin/form/premium.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function register setings
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function wtpsw_admin_processes() {
|
||||
|
||||
// If plugin notice is dismissed
|
||||
if( isset( $_GET['message'] ) && $_GET['message'] == 'wtpsw-plugin-notice' ) {
|
||||
set_transient( 'wtpsw_install_notice', true, 604800 );
|
||||
}
|
||||
|
||||
register_setting( 'wtpsw_plugin_options', 'wtpsw_options', array( $this, 'wtpsw_validate_options' ));
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Settings Options
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function wtpsw_validate_options( $input ){
|
||||
|
||||
$input['post_types'] = isset( $input['post_types'] ) ? $input['post_types'] : array();
|
||||
|
||||
return $input;
|
||||
}
|
||||
}
|
||||
|
||||
$wtpsw_Admin = new Wtpsw_Admin();
|
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Premium Offer Page
|
||||
*
|
||||
* @package Trending/Popular Post Slider and Widget
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
} ?>
|
||||
<div class="wrap">
|
||||
|
||||
<h2><span class="wtpsw-sf-blue">WP Trending Post Slider and Widget </span>Including in <span class="wtpsw-sf-blue">Essential Plugin Bundle</span></h2>
|
||||
<style>
|
||||
/* Table CSS */
|
||||
table, th, td {border: 1px solid #d1d1d1;}
|
||||
table.wpos-plugin-list{width:100%; text-align: left; border-spacing: 0; border-collapse: collapse; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; margin-bottom: 50px;}
|
||||
.wpos-plugin-list th {width: 16%; background: #2271b1; color: #fff; }
|
||||
.wpos-plugin-list td {vertical-align: top;}
|
||||
.wpos-plugin-type { text-align: left; color: #fff; font-weight: 700; padding: 0 10px; margin: 15px 0; }
|
||||
.wpos-slider-list { font-size: 14px; font-weight: 500; padding: 0 10px 0 25px; }
|
||||
.wpos-slider-list li {text-align: left; font-size: 13px; list-style: disc;}
|
||||
|
||||
.wtpsw-sf-blue{color:#6c63ff; font-weight:bold;}
|
||||
.wtpsw-sf-btn{display: inline-block; font-size: 18px; padding: 10px 25px; border-radius: 100px; background-color: #46b450; border-color: #46b450; color: #fff !important; font-weight: 600; text-decoration: none;}
|
||||
.wtpsw-sf-btn-orange{ background-color: #FF1000; border-color: #FF1000 ;}
|
||||
.wtpsw-sf-btn:hover,
|
||||
.wtpsw-sf-btn:focus{background-color: #3fa548; border-color: #3fa548;}
|
||||
.wtpsw-sf-btn-orange:hover,
|
||||
.wtpsw-sf-btn-orange:focus {background-color: #D01003 ; border-color: #D01003 ;}
|
||||
</style>
|
||||
|
||||
<div id="poststuff">
|
||||
<div id="post-body" class="metabox-holder">
|
||||
<div id="post-body-content">
|
||||
|
||||
<div style="text-align: center; background: #DCDCDC; margin: 30px 0; padding: 10px 30px 30px 30px;">
|
||||
|
||||
<p style="font-weight: bold !important; font-size:20px !important;"><span style="color: #50c621;">Essential Plugin Bundle</span> + Any Leading Builders (Avada / Elementor / Divi / <br>VC-WPBakery / Site Origin / Beaver) = <span style="background: #50c621;color: #fff;padding: 2px 10px;">WordPress Magic</span></p>
|
||||
<h4 style="color: #333; font-size: 14px; font-weight: 700;">Over 15K+ Customers Using <span style="color: #50c621 !important;">Essential Plugin Bundle</span></h4>
|
||||
<a href="<?php echo esc_url( WTPSW_PLUGIN_LINK_UPGRADE ); ?>" target="_blank" class="wtpsw-sf-btn wtpsw-sf-btn-orange"><span class="dashicons dashicons-cart"></span> View Essential Plugin Bundle</a>
|
||||
</div>
|
||||
|
||||
<h2 style="font-size: 24px; text-align: center; color: #6c63ff;">Bundle Deal Details</h2>
|
||||
<table class="wpos-plugin-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><h3 class="wpos-plugin-type">Image Slider</h3></th>
|
||||
<th><h3 class="wpos-plugin-type">Marketing</h3></th>
|
||||
<th><h3 class="wpos-plugin-type">Photo Album</h3></th>
|
||||
<th><h3 class="wpos-plugin-type">Publication</h3></th>
|
||||
<th><h3 class="wpos-plugin-type">Showcase</h3></th>
|
||||
<th><h3 class="wpos-plugin-type">WooCommerce</h3></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<ul class="wpos-slider-list">
|
||||
<li>Accordion and Accordion Slider</li>
|
||||
<li>WP Slick Slider and Image Carousel</li>
|
||||
<li>WP Responsive Recent Post Slider/Carousel</li>
|
||||
<li>WP Logo Showcase Responsive Slider and Carousel</li>
|
||||
<li>WP Featured Content and Slider</li>
|
||||
<li><span style="color:#2271b1; font-weight: bold;">Trending/Popular Post Slider and Widget</span></li>
|
||||
<li>Timeline and History slider</li>
|
||||
<li>Meta slider and carousel with lightbox</li>
|
||||
<li>Post Category Image With Grid and Slider</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<ul class="wpos-slider-list">
|
||||
<li>Popup Anything - A Marketing Popup and Lead Generation Conversions</li>
|
||||
<li>Countdown Timer Ultimate</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<ul class="wpos-slider-list">
|
||||
<li>Album and Image Gallery plus Lightbox</li>
|
||||
<li>Portfolio and Projects</li>
|
||||
<li>Video gallery and Player</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<ul class="wpos-slider-list">
|
||||
<li>WP Responsive Recent Post Slider/Carousel</li>
|
||||
<li>WP News and Scrolling Widgets</li>
|
||||
<li>WP Blog and Widget</li>
|
||||
<li>Blog Designer - Post and Widget</li>
|
||||
<li><span style="color:#2271b1; font-weight: bold;">Trending/Popular Post Slider and Widget</span></li>
|
||||
<li>WP Featured Content and Slider</li>
|
||||
<li>Timeline and History slider</li>
|
||||
<li>Testimonial Grid and Testimonial Slider plus Carousel with Rotator Widget</li>
|
||||
<li>Post Ticker Ultimate</li>
|
||||
<li>Post grid and filter ultimate</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<ul class="wpos-slider-list">
|
||||
<li>Testimonial Grid and Testimonial Slider plus Carousel with Rotator Widget</li>
|
||||
<li>Team Slider and Team Grid Showcase plus Team Carousel</li>
|
||||
<li>Hero Banner Ultimate</li>
|
||||
<li>WP Logo Showcase Responsive Slider and Carousel</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<ul class="wpos-slider-list">
|
||||
<li>Product Slider and Carousel with Category for WooCommerce</li>
|
||||
<li>Product Categories Designs for WooCommerce</li>
|
||||
<li>Popup Anything - A Marketing Popup and Lead Generation Conversions</li>
|
||||
<li>Countdown Timer Ultimate</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center; margin-bottom:30px">
|
||||
<h3 class="wtpsw-sf-blue" style="margin:0; margin-bottom:10px; font-size:24px; font-weight:bold;">Use Essential Plugin Bundle</h3>
|
||||
<h1 style="font-size: 28px; font-weight: 700; letter-spacing: -1px; text-align: center; padding:0; margin-bottom: 5px;">With Your Favourite Page Builders</h1>
|
||||
<span style="font-size: 14px; color: #000;">and see how Essential Plugins can help you.</span>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center;">
|
||||
<img style="width: 100%; margin-bottom:30px;" src="<?php echo esc_url( WTPSW_URL ); ?>assets/images/image-upgrade.png" alt="image-upgrade" title="image-upgrade" />
|
||||
<div style="font-size: 14px; margin-bottom:10px;"><span class="wtpsw-sf-blue">Trending/Popular Post Slider </span>Including in <span class="wtpsw-sf-blue">Essential Plugin Bundle</span></div>
|
||||
<a href="<?php echo esc_url( WTPSW_PLUGIN_LINK_UPGRADE ); ?>" target="_blank" class="wtpsw-sf-btn wtpsw-sf-btn-orange"><span class="dashicons dashicons-cart"></span> View Essential Plugin Bundle</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* Settings Page
|
||||
*
|
||||
* @package WP Trending Post Slider and Widget
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
$reg_post_types = wtpsw_get_post_types();
|
||||
$tp_support_post_types = wtpsw_get_option( 'post_types', array() );
|
||||
?>
|
||||
|
||||
<div class="wrap wtpsw-settings">
|
||||
|
||||
<h2><?php esc_html_e( 'Trending Post - Settings', 'wtpsw' ); ?></h2>
|
||||
|
||||
<?php
|
||||
if( isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true' ) {
|
||||
echo '<div id="message" class="updated notice notice-success is-dismissible">
|
||||
<p>'.esc_html__( "Your changes saved successfully.", "wtpsw" ).'</p>
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form action="options.php" method="POST" id="wtpsw-settings-form" class="wtpsw-settings-form">
|
||||
|
||||
<?php settings_fields( 'wtpsw_plugin_options' );
|
||||
global $wtpsw_options; ?>
|
||||
|
||||
<div id="wtpsw-general-settings" class="post-box-container wtpsw-general-settings">
|
||||
<div class="metabox-holder">
|
||||
<div class="meta-box-sortables ui-sortable">
|
||||
<div id="general" class="postbox">
|
||||
<div class="postbox-header">
|
||||
<h2 class="hndle">
|
||||
<span><?php esc_html_e( 'General Settings', 'wtpsw' ); ?></span>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="inside">
|
||||
<table class="form-table wtpsw-general-settings-tbl">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="wtpsw-post-within"><?php esc_html_e( 'Post Within', 'wtpsw' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select id="wtpsw-post-within" class="wtpsw-post-within" name="wtpsw_options[post_range]">
|
||||
<option value=""><?php esc_attr_e( 'All Time', 'wtpsw' ); ?></option>
|
||||
<option value="daily" <?php selected( $wtpsw_options['post_range'], 'daily' ); ?>><?php esc_html_e( 'Today', 'wtpsw' ); ?></option>
|
||||
<option value="last_day" <?php selected( $wtpsw_options['post_range'], 'last_day' ); ?>><?php esc_html_e( 'Last Day', 'wtpsw' ); ?></option>
|
||||
<option value="last_week" <?php selected( $wtpsw_options['post_range'], 'last_week' ); ?>><?php esc_html_e( 'Last 7 Days', 'wtpsw' ); ?></option>
|
||||
<option value="last_month" <?php selected( $wtpsw_options['post_range'], 'last_month' ); ?>><?php esc_html_e( 'Last Month', 'wtpsw' ); ?></option>
|
||||
</select><br/>
|
||||
<span class="description"><?php esc_html_e( 'Select time range for post visibility. Note: The post published within this time range will be visible.', 'wtpsw' ); ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<label for="select-post-type"><?php esc_html_e( 'Select Post Types', 'wtpsw' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php if( ! empty( $reg_post_types )) {
|
||||
foreach ( $reg_post_types as $post_key => $post_label ) { ?>
|
||||
<div class="ftpp-post-type-wrap">
|
||||
<label>
|
||||
<input type="checkbox" id="ftpp-tp-post-<?php echo esc_attr($post_key); ?>" value="<?php echo esc_attr($post_key); ?>" name="wtpsw_options[post_types][]" <?php checked( in_array( $post_key, $tp_support_post_types ), true ); ?> />
|
||||
<?php echo esc_attr( $post_label ); ?>( <?php echo esc_attr__('Post Type','wtpsw').' : '.esc_attr( $post_key ); ?> )
|
||||
</label>
|
||||
</div>
|
||||
<?php } } ?>
|
||||
<span class="description"><?php esc_html_e( 'Select post type box for trending post. You can enter post type name in shortcode parameter.', 'wtpsw' ); ?></span> <br/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" valign="top" scope="row">
|
||||
<input type="submit" id="wtpsw-settings-submit" name="wtpsw-settings-submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Changes','wtpsw' ); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div><!-- .inside -->
|
||||
</div><!-- #general -->
|
||||
|
||||
</div><!-- .meta-box-sortables ui-sortable -->
|
||||
</div><!-- .metabox-holder -->
|
||||
</div><!-- #wtpsw-general-settings -->
|
||||
|
||||
</form><!-- end .wtpsw-settings-form -->
|
||||
|
||||
</div><!-- end .wtpsw-settings -->
|
@@ -0,0 +1,286 @@
|
||||
<?php
|
||||
/**
|
||||
* Blocks Initializer
|
||||
*
|
||||
* @package Trending/Popular Post Slider and Widget
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
function wtpsw_register_guten_block() {
|
||||
|
||||
// Block Editor Script
|
||||
wp_register_script( 'wtpsw-block-js', WTPSW_URL.'assets/js/blocks.build.js', array( 'wp-blocks', 'wp-block-editor', 'wp-i18n', 'wp-element', 'wp-components' ), WTPSW_VERSION, true );
|
||||
wp_localize_script( 'wtpsw-block-js', 'Wtpsw_Block', array(
|
||||
'pro_demo_link' => 'https://demo.essentialplugin.com/prodemo/pro-featured-and-trending-post/',
|
||||
'free_demo_link' => 'https://demo.essentialplugin.com/trending-post-demo/',
|
||||
'pro_link' => WTPSW_PLUGIN_LINK_UNLOCK,
|
||||
));
|
||||
|
||||
// Register block and explicit attributes for trending slider
|
||||
register_block_type( 'wtpsw-free/trending-slider', array(
|
||||
'attributes' => array(
|
||||
'align' => array(
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
),
|
||||
'className' => array(
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
),
|
||||
'showdate' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
),
|
||||
'showauthor' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
),
|
||||
'show_comment_count' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
),
|
||||
'hide_empty_comment_count' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => false,
|
||||
),
|
||||
'showcontent' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => false,
|
||||
),
|
||||
'words_limit' => array(
|
||||
'type' => 'number',
|
||||
'default' => 40,
|
||||
),
|
||||
'dots' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'true',
|
||||
),
|
||||
'arrows' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'true',
|
||||
),
|
||||
'autoplay' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'true',
|
||||
),
|
||||
'autoplayinterval' => array(
|
||||
'type' => 'number',
|
||||
'default' => 3000,
|
||||
),
|
||||
'speed' => array(
|
||||
'type' => 'number',
|
||||
'default' => 300,
|
||||
),
|
||||
'limit' => array(
|
||||
'type' => 'number',
|
||||
'default' => 10,
|
||||
),
|
||||
'post_type' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'post',
|
||||
),
|
||||
'view_by' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'views',
|
||||
),
|
||||
'order' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'desc',
|
||||
),
|
||||
),
|
||||
'render_callback' => 'wtpsw_trending_post_slider',
|
||||
));
|
||||
|
||||
|
||||
// Register block and explicit attributes for trending carousel
|
||||
register_block_type( 'wtpsw-free/trending-carousel', array(
|
||||
'attributes' => array(
|
||||
'align' => array(
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
),
|
||||
'className' => array(
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
),
|
||||
'showdate' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
),
|
||||
'showauthor' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
),
|
||||
'show_comment_count' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
),
|
||||
'hide_empty_comment_count' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => false,
|
||||
),
|
||||
'showcontent' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => false,
|
||||
),
|
||||
'words_limit' => array(
|
||||
'type' => 'number',
|
||||
'default' => 40,
|
||||
),
|
||||
'slides_to_show' => array(
|
||||
'type' => 'number',
|
||||
'default' => 3,
|
||||
),
|
||||
'slides_to_scroll' => array(
|
||||
'type' => 'number',
|
||||
'default' => 1,
|
||||
),
|
||||
'dots' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'true',
|
||||
),
|
||||
'arrows' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'true',
|
||||
),
|
||||
'autoplay' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'true',
|
||||
),
|
||||
'autoplayinterval' => array(
|
||||
'type' => 'number',
|
||||
'default' => 3000,
|
||||
),
|
||||
'speed' => array(
|
||||
'type' => 'number',
|
||||
'default' => 300,
|
||||
),
|
||||
'limit' => array(
|
||||
'type' => 'number',
|
||||
'default' => 10,
|
||||
),
|
||||
'post_type' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'post',
|
||||
),
|
||||
'view_by' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'views',
|
||||
),
|
||||
'order' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'DESC',
|
||||
),
|
||||
|
||||
),
|
||||
'render_callback' => 'wtpsw_popular_post_carousel',
|
||||
));
|
||||
|
||||
// Register block and explicit attributes for trending gridbox
|
||||
register_block_type( 'wtpsw-free/trending-gridbox', array(
|
||||
'attributes' => array(
|
||||
'align' => array(
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
),
|
||||
'className' => array(
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
),
|
||||
'showdate' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
),
|
||||
'showauthor' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
),
|
||||
'show_comment_count' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
),
|
||||
'hide_empty_comment_count' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => false,
|
||||
),
|
||||
'showcontent' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => false,
|
||||
),
|
||||
'words_limit' => array(
|
||||
'type' => 'number',
|
||||
'default' => 40,
|
||||
),
|
||||
'limit' => array(
|
||||
'type' => 'number',
|
||||
'default' => 5,
|
||||
),
|
||||
'post_type' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'post',
|
||||
),
|
||||
'view_by' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'views',
|
||||
),
|
||||
'order' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'DESC',
|
||||
),
|
||||
),
|
||||
'render_callback' => 'wtpsw_trending_post_gridbox',
|
||||
));
|
||||
|
||||
if ( function_exists( 'wp_set_script_translations' ) ) {
|
||||
wp_set_script_translations( 'wtpsw-block-js', 'wtpsw', WTPSW_DIR . '/languages' );
|
||||
}
|
||||
}
|
||||
add_action( 'init', 'wtpsw_register_guten_block' );
|
||||
|
||||
/**
|
||||
* Enqueue Gutenberg block assets for backend editor.
|
||||
*
|
||||
* @uses {wp-blocks} for block type registration & related functions.
|
||||
* @uses {wp-element} for WP Element abstraction — structure of blocks.
|
||||
* @uses {wp-i18n} to internationalize the block's text.
|
||||
* @uses {wp-editor} for WP editor styles.
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
function wtpsw_editor_assets() {
|
||||
|
||||
// Block Editor CSS
|
||||
if( ! wp_style_is( 'wpos-guten-block-css', 'registered' ) ) {
|
||||
wp_register_style( 'wpos-guten-block-css', WTPSW_URL.'assets/css/blocks.editor.build.css', array( 'wp-edit-blocks' ), WTPSW_VERSION );
|
||||
}
|
||||
|
||||
// Block Editor Script
|
||||
wp_enqueue_style( 'wpos-guten-block-css' );
|
||||
wp_enqueue_script( 'wtpsw-block-js' );
|
||||
}
|
||||
add_action( 'enqueue_block_editor_assets', 'wtpsw_editor_assets' );
|
||||
|
||||
/**
|
||||
* Adds an extra category to the block inserter
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
function wtpsw_add_block_category( $categories ) {
|
||||
|
||||
$guten_cats = wp_list_pluck( $categories, 'slug' );
|
||||
|
||||
if( ! in_array( 'wpos_guten_block', $guten_cats ) ) {
|
||||
$categories[] = array(
|
||||
'slug' => 'wpos_guten_block',
|
||||
'title' => esc_html__( 'Essential Plugin Blocks', 'wtpsw' ),
|
||||
'icon' => null,
|
||||
);
|
||||
}
|
||||
|
||||
return $categories;
|
||||
}
|
||||
add_filter( 'block_categories_all', 'wtpsw_add_block_category' );
|
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
/**
|
||||
* Pro Designs and Plugins Feed
|
||||
*
|
||||
* @package WP Trending Post Slider and Widget
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
} ?>
|
||||
|
||||
<div class="wrap wtpsw-wrap">
|
||||
<style type="text/css">
|
||||
.wpos-pro-box .hndle{background-color:#0073AA; color:#fff;}
|
||||
.wpos-pro-box .postbox{background:#dbf0fa none repeat scroll 0 0; border:1px solid #0073aa; color:#191e23;}
|
||||
.postbox-container .wpos-list li:before{font-family: dashicons; content: "\f139"; font-size:20px; color: #0073aa; vertical-align: middle;}
|
||||
.wtpsw-wrap .wpos-button-full{display:block; text-align:center; box-shadow:none; border-radius:0;}
|
||||
.wtpsw-shortcode-preview{background-color: #e7e7e7; font-weight: bold; padding: 2px 5px; display: inline-block; margin:0 0 2px 0;}
|
||||
.upgrade-to-pro{font-size:18px; text-align:center; margin-bottom:15px;}
|
||||
.wpos-copy-clipboard{-webkit-touch-callout: all; -webkit-user-select: all; -khtml-user-select: all; -moz-user-select: all; -ms-user-select: all; user-select: all;}
|
||||
.wpos-new-feature{ font-size: 10px; margin-left:2px; color: #fff; font-weight: bold; background-color: #03aa29; padding:1px 4px; font-style: normal; }
|
||||
.button-orange{background: #ff2700 !important;border-color: #ff2700 !important; font-weight: 600;}
|
||||
</style>
|
||||
<h2><?php esc_html_e( 'How It Works', 'wtpsw' ); ?></h2>
|
||||
<div class="post-box-container">
|
||||
<div id="poststuff">
|
||||
<div id="post-body" class="metabox-holder columns-2">
|
||||
<!--How it workd HTML -->
|
||||
<div id="post-body-content">
|
||||
<div class="metabox-holder">
|
||||
<div class="meta-box-sortables">
|
||||
<div class="postbox">
|
||||
<div class="postbox-header">
|
||||
<h2 class="hndle">
|
||||
<span><?php esc_html_e( 'Need Support & Solutions?', 'wtpsw' ); ?></span>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="inside">
|
||||
<p><?php esc_html_e('Boost design and best solution for your website.', 'wtpsw'); ?></p>
|
||||
<a class="button button-primary button-orange" href="<?php echo esc_url( WTPSW_PLUGIN_LINK_UNLOCK ); ?>" target="_blank"><?php esc_html_e( 'Grab Now', 'wtpsw' ); ?></a>
|
||||
</div><!-- .inside -->
|
||||
</div><!-- #general -->
|
||||
|
||||
<div class="postbox">
|
||||
<div class="postbox-header">
|
||||
<h2 class="hndle">
|
||||
<span><?php esc_html_e( 'How It Works - Display and Shortcode', 'wtpsw' ); ?></span>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="inside">
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php esc_html_e( 'Getting Started', 'wtpsw' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<p><?php esc_html_e( 'Trending Post display most visited post on your website. It works with WordPress default post type.', 'wtpsw' ); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php esc_html_e( 'All Shortcodes', 'wtpsw' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<span class="wpos-copy-clipboard wtpsw-shortcode-preview">[wtpsw_popular_post]</span> – <?php esc_html_e( 'Trending Post Slider View', 'wtpsw' ); ?><br />
|
||||
<span class="wpos-copy-clipboard wtpsw-shortcode-preview">[wtpsw_carousel]</span> – <?php esc_html_e( 'Trending Post Carousel View', 'wtpsw' ); ?><br />
|
||||
<span class="wpos-copy-clipboard wtpsw-shortcode-preview">[wtpsw_gridbox]</span> – <?php esc_html_e( 'Trending Post Gridbox View', 'wtpsw'); ?>
|
||||
<br/><br/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php esc_html_e('Documentation', 'wtpsw'); ?>:</label>
|
||||
</th>
|
||||
<td>
|
||||
<a class="button button-primary" href="https://docs.essentialplugin.com/trending-popular-post-slider-and-widget/" target="_blank"><?php esc_html_e('Check Documentation', 'wtpsw'); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="postbox">
|
||||
<div class="postbox-header">
|
||||
<h2 class="hndle">
|
||||
<span><?php esc_html_e( 'Gutenberg Support', 'wp-testimonial-with-widget' ); ?></span>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="inside">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<label><?php esc_html_e( 'How it Work', 'wp-testimonial-with-widget' ); ?>:</label>
|
||||
</th>
|
||||
<td>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Step-1. Go to the Gutenberg editor of your page.', 'wp-testimonial-with-widget' ); ?></li>
|
||||
<li><?php esc_html_e( 'Step-2. Search "testimonial" keyword in the gutenberg block list.', 'wp-testimonial-with-widget' ); ?></li>
|
||||
<li><?php esc_html_e( 'Step-3. Add any block of testimonial and you will find its relative options on the right end side.', 'wp-testimonial-with-widget' ); ?></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- .inside -->
|
||||
</div><!-- #general -->
|
||||
|
||||
<div class="postbox">
|
||||
<div class="postbox-header">
|
||||
<h2 class="hndle">
|
||||
<span><?php esc_html_e( 'Help to improve this plugin!', 'wtpsw' ); ?></span>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="inside">
|
||||
<p><?php esc_html_e('Enjoyed this plugin? You can help by rate this plugin', 'wtpsw'); ?> <a href="https://wordpress.org/support/plugin/wp-trending-post-slider-and-widget/reviews#new-post" target="_blank"><?php esc_html_e('5 stars!', 'wtpsw'); ?></a></p>
|
||||
</div><!-- .inside -->
|
||||
</div><!-- #general -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--Upgrad to Pro HTML -->
|
||||
<div id="postbox-container-1" class="postbox-container">
|
||||
<div class="metabox-holder wpos-pro-box">
|
||||
<div class="meta-box-sortables">
|
||||
<div class="postbox">
|
||||
<h3 class="hndle">
|
||||
<span><?php esc_html_e( 'Upgrate to Pro', 'wtpsw' ); ?></span>
|
||||
</h3>
|
||||
<div class="inside">
|
||||
<ul class="wpos-list">
|
||||
<li>40+ stunning and cool designs for Grid, slider, carousel and gridbox</li>
|
||||
<li>8 shortcodes</li>
|
||||
<li>Visual Composer Page Builder Support</li>
|
||||
<li>6 different types of widgets</li>
|
||||
<li>Custom post type support</li>
|
||||
<li>Gutenberg Block Supports.</li>
|
||||
<li>WPBakery Page Builder Supports</li>
|
||||
<li>Elementor, Beaver and SiteOrigin Page Builder Support. <span class="wpos-new-feature">New</span></li>
|
||||
<li>Divi Page Builder Native Support. <span class="wpos-new-feature">New</span></li>
|
||||
<li>Fusion Page Builder (Avada) native support.<span class="wpos-new-feature">New</span></li>
|
||||
<li>WP Templating Features</li>
|
||||
<li>Display Desired post include and exclude </li>
|
||||
<li>Display posts with include categories and exclude categories</li>
|
||||
<li>Display posts with particular include author and exclude author</li>
|
||||
<li>Custom CSS</li>
|
||||
<li>100% Multi language</li>
|
||||
</ul>
|
||||
<div class="upgrade-to-pro">Gain access to <strong>WP Trending Post Slider and Widget</strong> included in <br /><strong>Essential Plugin Bundle</div>
|
||||
<a class="button button-primary wpos-button-full button-orange" href="<?php echo esc_url(WTPSW_PLUGIN_LINK_UNLOCK); ?>" target="_blank"><?php esc_html_e( 'Grab Now', 'wtpsw' ); ?></a>
|
||||
</div><!-- .inside -->
|
||||
</div><!-- #general -->
|
||||
</div><!-- .meta-box-sortables -->
|
||||
</div><!-- .metabox-holder -->
|
||||
</div><!-- #post-container-1 -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user