Skip to content

Commit 9c8686d

Browse files
committed
Merge branch 'develop'
2 parents 1079560 + d900820 commit 9c8686d

File tree

13 files changed

+53
-46
lines changed

13 files changed

+53
-46
lines changed

admin/assets/js/plugins.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/settings/assets/js/gutenberg.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
var RawHTML = element.RawHTML;
2121
var Button = components.Button;
2222

23-
registerBlockType('ulf-gutenberg-block/block-'+block.hash, {
23+
registerBlockType(block.name, {
2424
title: block.gutenberg.title,
2525
description: block.gutenberg.description,
2626
icon: block.gutenberg.icon || 'screenoptions',
@@ -43,7 +43,7 @@
4343

4444
createElement(Button, {
4545
'data-modal-id': block.modal_id,
46-
'data-gutenberg-id': block.hash,
46+
'data-gutenberg-id': block.name,
4747
className: 'is-secondary ulf-shortcode-button',
4848
onClick: function () {
4949
window.ulf_gutenberg_props = props;

admin/settings/assets/js/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2613,14 +2613,14 @@
26132613
}
26142614

26152615
if ( sub_shortcode_value !== '' ) {
2616-
shortcode += ' ' + sub_shortcode_tag.replace('-', '_') + '="' + sub_shortcode_value.toString() + '"';
2616+
shortcode += ' ' + sub_shortcode_tag + '="' + sub_shortcode_value.toString() + '"';
26172617
}
26182618

26192619
});
26202620

26212621
} else {
26222622

2623-
shortcode += ' ' + shortcode_tag.replace('-', '_') + '="' + shortcode_value.toString() + '"';
2623+
shortcode += ' ' + shortcode_tag + '="' + shortcode_value.toString() + '"';
26242624

26252625
}
26262626

admin/settings/assets/js/main.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/settings/assets/js/plugins.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/settings/classes/setup.class.php

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
* @version 1.0.0
88
*
99
*/
10-
if ( ! class_exists( 'ULF' ) ) {
11-
class ULF {
10+
if ( ! class_exists( 'ULF_Setup' ) ) {
11+
class ULF_Setup {
1212

1313
// Default constants
1414
public static $premium = true;
15-
public static $version = '2.2.7';
15+
public static $version = '2.2.8';
1616
public static $dir = '';
1717
public static $url = '';
1818
public static $css = '';
@@ -39,11 +39,14 @@ class ULF {
3939

4040
private static $instance = null;
4141

42-
public static function init( $file = __FILE__ ) {
42+
public static function init( $file = __FILE__, $premium = true ) {
4343

4444
// Set file constant
4545
self::$file = $file;
4646

47+
// Set file constant
48+
self::$premium = $premium;
49+
4750
// Set constants
4851
self::constants();
4952

@@ -375,18 +378,18 @@ public static function include_plugin_url( $file ) {
375378
// Include files
376379
public static function includes() {
377380

378-
// Helpers
381+
// Include common functions
379382
self::include_plugin_file( 'functions/actions.php' );
380383
self::include_plugin_file( 'functions/helpers.php' );
381384
self::include_plugin_file( 'functions/sanitize.php' );
382385
self::include_plugin_file( 'functions/validate.php' );
383386

384-
// Includes free version classes
387+
// Include free version classes
385388
self::include_plugin_file( 'classes/abstract.class.php' );
386389
self::include_plugin_file( 'classes/fields.class.php' );
387390
self::include_plugin_file( 'classes/admin-options.class.php' );
388391

389-
// Includes premium version classes
392+
// Include premium version classes
390393
if ( self::$premium ) {
391394
self::include_plugin_file( 'classes/customize-options.class.php' );
392395
self::include_plugin_file( 'classes/metabox-options.class.php' );
@@ -560,9 +563,6 @@ public static function add_admin_enqueue_scripts() {
560563
return;
561564
}
562565

563-
// Check for developer mode
564-
$min = ( self::$premium && SCRIPT_DEBUG ) ? '' : '.min';
565-
566566
// Admin utilities
567567
wp_enqueue_media();
568568

@@ -572,12 +572,15 @@ public static function add_admin_enqueue_scripts() {
572572

573573
// Font awesome 4 and 5 loader
574574
if ( apply_filters( 'ulf_fa4', false ) ) {
575-
wp_enqueue_style( 'ulf-fa', 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome'. $min .'.css', array(), '4.7.0', 'all' );
575+
wp_enqueue_style( 'ulf-fa', 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css', array(), '4.7.0', 'all' );
576576
} else {
577-
wp_enqueue_style( 'ulf-fa5', 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/all'. $min .'.css', array(), '5.15.5', 'all' );
578-
wp_enqueue_style( 'ulf-fa5-v4-shims', 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/v4-shims'. $min .'.css', array(), '5.15.5', 'all' );
577+
wp_enqueue_style( 'ulf-fa5', 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/all.min.css', array(), '5.15.5', 'all' );
578+
wp_enqueue_style( 'ulf-fa5-v4-shims', 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/v4-shims.min.css', array(), '5.15.5', 'all' );
579579
}
580580

581+
// Check for developer mode
582+
$min = ( self::$premium && SCRIPT_DEBUG ) ? '' : '.min';
583+
581584
// Main style
582585
wp_enqueue_style( 'ulf', self::include_plugin_url( 'assets/css/style'. $min .'.css' ), array(), self::$version, 'all' );
583586

@@ -783,4 +786,16 @@ public static function field( $field = array(), $value = '', $unique = '', $wher
783786

784787
}
785788

786-
ULF::init( __FILE__ );
789+
ULF_Setup::init( __FILE__, true );
790+
791+
/**
792+
*
793+
* Extended Setup Class for Shortland
794+
*
795+
* @since 1.0.0
796+
* @version 1.0.0
797+
*
798+
*/
799+
if ( ! class_exists( 'ULF' ) ) {
800+
class ULF extends ULF_Setup{}
801+
}

admin/settings/classes/shortcode-options.class.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ public function __construct( $key, $params = array() ) {
5050

5151
if ( ! empty( $this->args['show_in_editor'] ) ) {
5252

53-
ULF::$shortcode_instances[$this->unique] = wp_parse_args( array( 'hash' => md5( $key ), 'modal_id' => $this->unique ), $this->args );
53+
$name = str_replace( '_', '-', sanitize_title( $this->unique ) );
54+
55+
ULF::$shortcode_instances[] = wp_parse_args( array( 'name' => 'ulf/'. $name, 'modal_id' => $this->unique ), $this->args );
5456

5557
// elementor editor support
5658
if ( ULF::is_active_plugin( 'elementor/elementor.php' ) ) {
@@ -322,9 +324,9 @@ public static function add_guteberg_blocks() {
322324

323325
wp_localize_script( 'ulf-gutenberg-block', 'ulf_gutenberg_blocks', ULF::$shortcode_instances );
324326

325-
foreach ( ULF::$shortcode_instances as $value ) {
327+
foreach ( ULF::$shortcode_instances as $block ) {
326328

327-
register_block_type( 'ulf-gutenberg-block/block-'. $value['hash'], array(
329+
register_block_type( $block['name'], array(
328330
'editor_script' => 'ulf-gutenberg-block',
329331
) );
330332

assets/js/wp-ulike.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! WP ULike - v4.6.0
1+
/*! WP ULike - v4.6.1
22
* https://wpulike.com
33
* TechnoWich 2022;
44
*/

assets/js/wp-ulike.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/hooks/third-party.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,7 @@ function wp_ulike_add_bp_notifications( $cp_ID, $type, $user_ID, $status, $has_l
340340
* @return string $return Formatted notification.
341341
*/
342342
function wp_ulike_format_buddypress_notifications( $content, $item_id, $secondary_item_id, $total_items, $format, $action, $component, $id ) {
343-
global $wp_filter,$wp_version;
344-
343+
// check for ulike notifications
345344
if ( strpos( $action, 'wp_ulike_' ) !== false ) {
346345
//Extracting ulike type from the action value.
347346
preg_match('/wp_ulike_(.*?)_action/', $action, $type);
@@ -403,19 +402,6 @@ function wp_ulike_format_buddypress_notifications( $content, $item_id, $secondar
403402
'link' => $custom_link
404403
), $custom_link, (int) $total_items, $item_id, $user_ID );
405404
}
406-
407-
if ( function_exists('bbp_get_version') && version_compare( bbp_get_version(), '2.6.0' , '<') ) {
408-
// global wp_filter to call bbPress wrapper function
409-
if( isset( $wp_filter['bp_notifications_get_notifications_for_user'][10]['bbp_format_buddypress_notifications'] ) ) {
410-
if( version_compare( $wp_version, '4.7', '>=' ) ) {
411-
$wp_filter['bp_notifications_get_notifications_for_user']->callbacks[10]['bbp_format_buddypress_notifications']['function'] = 'wp_ulike_bbp_format_buddypress_notifications';
412-
} else {
413-
$wp_filter['bp_notifications_get_notifications_for_user'][10]['bbp_format_buddypress_notifications']['function'] = 'wp_ulike_bbp_format_buddypress_notifications';
414-
}
415-
}
416-
}
417-
418-
return $content;
419405
}
420406

421407
return $content;

0 commit comments

Comments
 (0)