Skip to content

Commit

Permalink
equalise features to Top 10 Pro
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaydsouza committed Jan 13, 2025
1 parent 1e15b5b commit 841dfd5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
8 changes: 5 additions & 3 deletions includes/admin/settings/class-settings-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ public function callback_number( $args ) {
* @return void
*/
public function callback_select( $args ) {
$value = isset( $args['value'] ) ? $args['value'] : $this->get_option( $args['id'], $args['default'] );
$value = isset( $args['value'] ) ? $args['value'] : $this->get_option( $args['id'], $args['default'] );
$disabled = ( ! empty( $args['disabled'] ) || $args['pro'] ) ? ' disabled="disabled"' : '';

if ( isset( $args['chosen'] ) ) {
$chosen = 'class="chosen"';
Expand All @@ -541,10 +542,11 @@ public function callback_select( $args ) {
}

$html = sprintf(
'<select id="%1$s[%2$s]" name="%1$s[%2$s]" %3$s />',
'<select id="%1$s[%2$s]" name="%1$s[%2$s]" %3$s %4$s />',
$this->settings_key,
sanitize_key( $args['id'] ),
$chosen
$chosen,
$disabled
);

foreach ( $args['options'] as $option => $name ) {
Expand Down
14 changes: 9 additions & 5 deletions includes/class-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,22 @@ private function init() {

$this->hooks();

if ( is_admin() ) {
$this->admin = new Admin\Admin();
if ( is_multisite() ) {
$this->admin = new Admin\Network\Admin();
}
if ( ! function_exists( 'tptn_freemius' ) ) {
require_once __DIR__ . '/load-freemius.php';
}

if ( tptn_freemius()->is__premium_only() ) {
if ( tptn_freemius()->can_use_premium_code() ) {
$this->pro = new Pro\Pro();
}
}

if ( is_admin() ) {
$this->admin = new Admin\Admin();
if ( is_multisite() ) {
$this->admin = new Admin\Network\Admin();
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-server-side-render'), 'version' => '71315c6cd75943b6522a');
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-server-side-render'), 'version' => 'ba152ea881f21ecfaefa');
2 changes: 1 addition & 1 deletion includes/frontend/blocks/build/popular-posts/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions includes/frontend/blocks/class-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,12 @@ private static function get_allowed_svg_tags() {
*/
public static function enqueue_block_editor_assets() {

$styles = Settings::get_styles();
$styles = Settings::get_styles();
$file_prefix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';

foreach ( $styles as $style ) {

$style_array = Styles_Handler::get_style( $style['id'] );
$file_prefix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';

if ( ! empty( $style_array['name'] ) ) {
$style = $style_array['name'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export const StyleControls = ({ attributes, onChange }) => {
};

const styles =
typeof top10ProBlockSettings !== 'undefined' &&
Array.isArray(top10ProBlockSettings.styles)
? top10ProBlockSettings.styles
typeof window.top10ProBlockSettings !== 'undefined' &&
Array.isArray(window.top10ProBlockSettings.styles)
? window.top10ProBlockSettings.styles
: [
{ value: 'no_style', label: __('No styles', 'top-10') },
{
Expand Down

0 comments on commit 841dfd5

Please sign in to comment.