array($this, 'renderCallback'),
'editor_script' => 'akdev-spline-animation-script',
'title'=> ('Spline Animation'),
'icon'=> ('art'),
'category'=> ('animations'),
'description'=> ('Small block editor plugin to add spline animations to delight your user experience'),
'editor_style' => 'akdev-spline-animation-style' ,
'attributes'=>$blockDecode['attributes'],
));
// options page
function akdev_options_assets() {
wp_enqueue_style('akdev-spline-animation-style', plugin_dir_url(__FILE__) . 'build/style-index.css');
}
// plugin notice card with review link
function akdev_review_notice() {
// Check if the user has dismissed the notice permanently
$user_id = get_current_user_id();
$dismissed = get_user_meta($user_id, 'akdev_dismissed_review_notice', true);
$rate_later = get_user_meta($user_id, 'akdev_rate_later_notice', true);
// Display the notice if it has not been dismissed permanently or if the "Rate Later" period has passed
if (!$dismissed && (!$rate_later || (time() > $rate_later + WEEK_IN_SECONDS))) {
?>
Give Spline animation plugin a review
Thank you for choosing AKDev Spline animation plugin for your spline animation needs. We hope you love it. Could you take a couple of seconds posting a nice review to share your happy experience?
If you enjoy using our plugin, please consider leaving a review.
Your review is appreciated and will highlight this plugin to more users and result in more installations and feedback which can result in fixing more bugs and adding new features.
Rate now
Rate later
Already did
' . __('Donate', 'akdev-spline-animation') . '');
// tutorial link
$links_array[] = sprintf('' . __('Tutorial', 'akdev-spline-animation') . '');
}
return $links_array;
}
add_filter('plugin_row_meta','akdev_insert_plugin_row_meta', 10, 2 );
function akdev_dismiss_review_notice() {
if ( current_user_can('edit_posts') ) {
update_user_meta( get_current_user_id(), 'akdev_dismissed_review_notice', true );
}
wp_die(); // this is required to terminate immediately and return a proper response
}
add_action('wp_ajax_akdev_dismiss_review_notice', 'akdev_dismiss_review_notice');
?>
AKDev Spline animation | Options
Check this box if you like to enable smooth scrolling for your animation pages.
How to use this plugin
post ) ) {
array_push(
$block_categories,
array(
'slug' => 'animations',
'title' => __( 'Animations', 'create-block' ),
'icon' => null,
)
);
}
return $block_categories;
}
add_filter( 'block_categories_all', 'filter_block_categories_when_post_provided', 10, 2 );
}
function renderCallback($attributes) {
if (!is_admin()) {
wp_enqueue_script('spline-akdev/frontend-script', plugin_dir_url(__FILE__) . 'build/client.js', array('wp-element'));
wp_enqueue_style('spline-akdev/frontend-styles', plugin_dir_url(__FILE__) . 'build/index.css');
}
$json = wp_json_encode($attributes);
$json = wp_json_encode($attributes);
$result = json_decode($json,true);
$customStyles = wp_json_encode($result['customStyles'],true);
$classNames = wp_json_encode($result['className'],true);
$customStyles = wp_json_encode($result['customStyles'],true);
$classNames = wp_json_encode($result['className'],true);
$classNamesData = json_decode($classNames, true);
$data = json_decode($customStyles, true);
$cssString = '';
if ($data) {
// Convert associative array to CSS style string
foreach ($data as $property => $value) {
$cssString .= $property . ':' . $value . ';';
}
}
ob_start();
?>
' data-attributes='' >