Changeset 3460601
- Timestamp:
- 02/13/2026 09:17:28 AM (5 days ago)
- Location:
- snap-blocks
- Files:
-
- 78 added
- 10 deleted
- 24 edited
- 1 copied
-
tags/1.2.0 (copied) (copied from snap-blocks/trunk)
-
tags/1.2.0/README.txt (modified) (5 diffs)
-
tags/1.2.0/admin/admin.php (modified) (1 diff)
-
tags/1.2.0/admin/post-type.php (modified) (5 diffs)
-
tags/1.2.0/assets/build/admin-rtl.css (modified) (1 diff)
-
tags/1.2.0/assets/build/admin.asset.php (modified) (1 diff)
-
tags/1.2.0/assets/build/admin.css (modified) (1 diff)
-
tags/1.2.0/assets/build/admin.css.map (added)
-
tags/1.2.0/assets/build/admin.js.map (added)
-
tags/1.2.0/assets/build/conditions-rtl.css (added)
-
tags/1.2.0/assets/build/conditions.asset.php (added)
-
tags/1.2.0/assets/build/conditions.css (added)
-
tags/1.2.0/assets/build/conditions.css.map (added)
-
tags/1.2.0/assets/build/conditions.js (added)
-
tags/1.2.0/assets/build/conditions.js.map (added)
-
tags/1.2.0/assets/build/public-rtl.css (deleted)
-
tags/1.2.0/assets/build/public.asset.php (deleted)
-
tags/1.2.0/assets/build/public.css (deleted)
-
tags/1.2.0/assets/build/public.js (deleted)
-
tags/1.2.0/assets/images/puzzle.svg (added)
-
tags/1.2.0/assets/images/square-blocks.svg (added)
-
tags/1.2.0/assets/select2 (added)
-
tags/1.2.0/assets/select2/select2.css (added)
-
tags/1.2.0/includes/conditions (added)
-
tags/1.2.0/includes/conditions/admin (added)
-
tags/1.2.0/includes/conditions/admin/ajax.php (added)
-
tags/1.2.0/includes/conditions/admin/controller.php (added)
-
tags/1.2.0/includes/conditions/admin/index.php (added)
-
tags/1.2.0/includes/conditions/admin/modal.php (added)
-
tags/1.2.0/includes/conditions/admin/table-column.php (added)
-
tags/1.2.0/includes/conditions/bootstrap.php (added)
-
tags/1.2.0/includes/conditions/index.php (added)
-
tags/1.2.0/includes/conditions/sections (added)
-
tags/1.2.0/includes/conditions/sections/index.php (added)
-
tags/1.2.0/includes/conditions/sections/section-manager.php (added)
-
tags/1.2.0/includes/conditions/sections/woocommerce (added)
-
tags/1.2.0/includes/conditions/sections/woocommerce/cart.php (added)
-
tags/1.2.0/includes/conditions/sections/woocommerce/checkout.php (added)
-
tags/1.2.0/includes/conditions/sections/woocommerce/index.php (added)
-
tags/1.2.0/includes/conditions/sections/woocommerce/my-account.php (added)
-
tags/1.2.0/includes/conditions/sections/woocommerce/product-archive.php (added)
-
tags/1.2.0/includes/conditions/sections/woocommerce/single-product.php (added)
-
tags/1.2.0/includes/conditions/sections/woocommerce/thank-you.php (added)
-
tags/1.2.0/includes/conditions/sections/wordpress (added)
-
tags/1.2.0/includes/conditions/sections/wordpress/index.php (added)
-
tags/1.2.0/includes/conditions/sections/wordpress/page.php (added)
-
tags/1.2.0/includes/conditions/sections/wordpress/post-archive.php (added)
-
tags/1.2.0/includes/conditions/sections/wordpress/single-post.php (added)
-
tags/1.2.0/includes/conditions/storage.php (added)
-
tags/1.2.0/includes/elementor/integration.php (modified) (1 diff)
-
tags/1.2.0/includes/plugin.php (modified) (4 diffs)
-
tags/1.2.0/includes/shortcode.php (modified) (1 diff)
-
tags/1.2.0/includes/wpbakery/integration.php (modified) (3 diffs)
-
tags/1.2.0/languages/snap-blocks.pot (added)
-
tags/1.2.0/snap-blocks.php (modified) (4 diffs)
-
tags/1.2.0/vendor/composer/installed.php (modified) (2 diffs)
-
tags/1.2.0/vendor/freemius/wordpress-sdk/README.md (deleted)
-
trunk/README.txt (modified) (5 diffs)
-
trunk/admin/admin.php (modified) (1 diff)
-
trunk/admin/post-type.php (modified) (5 diffs)
-
trunk/assets/build/admin-rtl.css (modified) (1 diff)
-
trunk/assets/build/admin.asset.php (modified) (1 diff)
-
trunk/assets/build/admin.css (modified) (1 diff)
-
trunk/assets/build/admin.css.map (added)
-
trunk/assets/build/admin.js.map (added)
-
trunk/assets/build/conditions-rtl.css (added)
-
trunk/assets/build/conditions.asset.php (added)
-
trunk/assets/build/conditions.css (added)
-
trunk/assets/build/conditions.css.map (added)
-
trunk/assets/build/conditions.js (added)
-
trunk/assets/build/conditions.js.map (added)
-
trunk/assets/build/public-rtl.css (deleted)
-
trunk/assets/build/public.asset.php (deleted)
-
trunk/assets/build/public.css (deleted)
-
trunk/assets/build/public.js (deleted)
-
trunk/assets/images/puzzle.svg (added)
-
trunk/assets/images/square-blocks.svg (added)
-
trunk/assets/select2 (added)
-
trunk/assets/select2/select2.css (added)
-
trunk/includes/conditions (added)
-
trunk/includes/conditions/admin (added)
-
trunk/includes/conditions/admin/ajax.php (added)
-
trunk/includes/conditions/admin/controller.php (added)
-
trunk/includes/conditions/admin/index.php (added)
-
trunk/includes/conditions/admin/modal.php (added)
-
trunk/includes/conditions/admin/table-column.php (added)
-
trunk/includes/conditions/bootstrap.php (added)
-
trunk/includes/conditions/index.php (added)
-
trunk/includes/conditions/sections (added)
-
trunk/includes/conditions/sections/index.php (added)
-
trunk/includes/conditions/sections/section-manager.php (added)
-
trunk/includes/conditions/sections/woocommerce (added)
-
trunk/includes/conditions/sections/woocommerce/cart.php (added)
-
trunk/includes/conditions/sections/woocommerce/checkout.php (added)
-
trunk/includes/conditions/sections/woocommerce/index.php (added)
-
trunk/includes/conditions/sections/woocommerce/my-account.php (added)
-
trunk/includes/conditions/sections/woocommerce/product-archive.php (added)
-
trunk/includes/conditions/sections/woocommerce/single-product.php (added)
-
trunk/includes/conditions/sections/woocommerce/thank-you.php (added)
-
trunk/includes/conditions/sections/wordpress (added)
-
trunk/includes/conditions/sections/wordpress/index.php (added)
-
trunk/includes/conditions/sections/wordpress/page.php (added)
-
trunk/includes/conditions/sections/wordpress/post-archive.php (added)
-
trunk/includes/conditions/sections/wordpress/single-post.php (added)
-
trunk/includes/conditions/storage.php (added)
-
trunk/includes/elementor/integration.php (modified) (1 diff)
-
trunk/includes/plugin.php (modified) (4 diffs)
-
trunk/includes/shortcode.php (modified) (1 diff)
-
trunk/includes/wpbakery/integration.php (modified) (3 diffs)
-
trunk/languages/snap-blocks.pot (added)
-
trunk/snap-blocks.php (modified) (4 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/vendor/freemius/wordpress-sdk/README.md (deleted)
Legend:
- Unmodified
- Added
- Removed
-
snap-blocks/tags/1.2.0/README.txt
r3418044 r3460601 1 1 === Snap Blocks === 2 2 Contributors: devnethr, MarinMatosevic 3 Tags: elementor, template, content blocks, repeatable blocks, layout3 Tags: elementor, template, content blocks, repeatable content, layout 4 4 Requires PHP: 7.4 5 Stable tag: 1. 1.25 Stable tag: 1.2.0 6 6 Tested up to: 6.9 7 7 License: GPLv2 or later … … 20 20 🛠️ Built for developers, designers, and content editors who want a smarter way to manage repeatable content across their WordPress sites. 21 21 22 ### [DOCUMENTATION](https://devnet.hr/docs/snap-blocks/) | [SNAP BLOCKS PRO](https://devnet.hr/plugins/snap-blocks/) 22 23 23 24 == Features == … … 27 28 - Insert blocks via **shortcode**, Elementor widget, or WPBakery element 28 29 - Widgets include a dropdown selector for easy block selection 29 - Organize blocks using a `Group` taxonomy 30 - Built-in **Duplicate** action for faster block creation 31 - Clean, minimal UI — integrates seamlessly with the WordPress dashboard 30 - Group taxonomy for better organization 31 - Duplicate blocks with one click 32 - Lightweight and clean admin UI 33 - No performance overhead 34 35 == PRO Features == 36 37 With [Snap Blocks PRO](https://devnet.hr/plugins/snap-blocks/), you unlock automatic block insertion, advanced display conditions, precise hook placement control, and full compatibility with WooCommerce and core WordPress contexts. 38 39 - Automatic block insertion (no shortcode needed) 40 - Hook position selector (WooCommerce & WordPress hooks) 41 - Display blocks based on context: 42 - WooCommerce 43 - Single Product 44 - Product Archive 45 - Cart 46 - Checkout 47 - Thank You page 48 - My Account 49 - WordPress 50 - Single Post 51 - Page 52 - Post Archive 53 - Advanced conditions: 54 - Specific products 55 - Categories 56 - Tags 57 - Pages 58 - Posts 59 - Multiple conditions support 60 - Custom hook name option 61 - Priority control for precise placement 62 - Developer-friendly architecture 32 63 33 64 … … 77 108 Here are some other plugins we have developed that you might find useful: 78 109 79 - [Free Shipping Label](https://wordpress.org/plugins/ free-shipping-label/) - Increase order revenue by showing your customers just how close they are to your free shipping threshold.80 - [FSL Discount Add-On](https://devnet.hr/plugins/ free-shipping-label/#fsl-discount) - By setting customizable thresholds for single, double, or triple-step discounts, you’ll motivate shoppers to add more to their carts.110 - [Free Shipping Label](https://wordpress.org/plugins/snap-blocks/) - Increase order revenue by showing your customers just how close they are to your free shipping threshold. 111 - [FSL Discount Add-On](https://devnet.hr/plugins/snap-blocks/#fsl-discount) - By setting customizable thresholds for single, double, or triple-step discounts, you’ll motivate shoppers to add more to their carts. 81 112 - [Product Price History](https://wordpress.org/plugins/product-price-history/) - Track product price history with customizable charts and graphs on your WooCommerce store. Show lowest price and increase customer trust. 82 113 - [Easy Subscribe](https://wordpress.org/plugins/easy-subscribe/) - Effortlessly integrate customizable subscription forms on your WordPress site with a simple shortcode. … … 128 159 == Changelog == 129 160 161 = 1.2.0 = 162 163 *2026-02-13* 164 165 * Fix: Resolved edge case where shortcode rendered empty wrapper 166 * Fix: Minor admin UI styling inconsistencies 167 * Update: Freemius SDK updated to the latest version 168 * Improvement: Optimized block rendering performance 169 * UI: New centralized conditions modal interface 170 171 130 172 = 1.1.2 = 131 173 -
snap-blocks/tags/1.2.0/admin/admin.php
r3373574 r3460601 4 4 5 5 use Devnet\SnapBlocks\Admin\PostType; 6 7 if (! defined('ABSPATH')) { 6 if ( !defined( 'ABSPATH' ) ) { 8 7 exit; 9 8 } 9 final class AdminSide { 10 private static $plugin_name; 10 11 12 private static $version; 11 13 12 class AdminSide 13 { 14 private $plugin_name; 15 private $version; 16 17 public function __construct($plugin_name, $version) 18 { 19 20 $this->plugin_name = $plugin_name; 21 $this->version = $version; 22 14 public static function init( $plugin_name, $version ) { 15 self::$plugin_name = $plugin_name; 16 self::$version = $version; 23 17 // Setup post_type 24 new PostType(); 25 26 $post_type = isset($_GET['post_type']) ? sanitize_text_field($_GET['post_type']) : null; 27 28 add_filter('plugin_action_links_' . DEVNET_SNAP_BLOCKS_PATH_FILE, [$this, 'plugin_action_links']); 29 30 if ($post_type === 'snap_block') { 31 add_filter('admin_footer_text', [$this, 'admin_credits']); 18 PostType::init(); 19 $post_type = ( isset( $_GET['post_type'] ) ? sanitize_text_field( $_GET['post_type'] ) : null ); 20 add_filter( 'plugin_action_links_' . DEVNET_SNAP_BLOCKS_PATH_FILE, [self::class, 'plugin_action_links'] ); 21 if ( $post_type === 'snap_block' ) { 22 add_action( 'admin_enqueue_scripts', [self::class, 'enqueue_assets'] ); 23 add_filter( 'admin_footer_text', [self::class, 'admin_credits'] ); 24 add_action( 'all_admin_notices', [self::class, 'admin_notices'] ); 32 25 } 33 26 } 34 27 35 36 public function plugin_action_links($links) 37 { 38 39 $custom_links = []; 40 $custom_links[] = '<a href="' . esc_url(get_admin_url(null, 'edit.php?post_type=snap_block')) . '">' . esc_html__('Settings', 'snap-blocks') . '</a>'; 41 42 return array_merge($custom_links, $links); 28 public static function enqueue_assets( string $hook ) : void { 29 $screen = get_current_screen(); 30 if ( !$screen || $screen->post_type !== 'snap_block' ) { 31 return; 32 } 33 $base_url = DEVNET_SNAP_BLOCKS_URL . 'assets/build/'; 34 wp_enqueue_style( 35 self::$plugin_name . '-admin', 36 $base_url . 'admin.css', 37 [], 38 self::$version 39 ); 40 $asset_file = $base_url . 'admin.asset.php'; 41 $asset_data = ( file_exists( $asset_file ) ? include $asset_file : [ 42 'dependencies' => ['jquery'], 43 'version' => self::$version, 44 ] ); 45 wp_enqueue_script( 46 self::$plugin_name . '-admin', 47 $base_url . 'admin.js', 48 $asset_data['dependencies'], 49 $asset_data['version'], 50 true 51 ); 52 wp_localize_script( self::$plugin_name . '-admin', 'devnet_snap_blocks_admin_script_data', [ 53 'ajaxurl' => admin_url( 'admin-ajax.php' ), 54 'nonce' => wp_create_nonce( 'snap_blocks_admin' ), 55 ] ); 43 56 } 44 57 58 public static function plugin_action_links( $links ) { 59 $custom_links = []; 60 $custom_links[] = '<a href="' . esc_url( get_admin_url( null, 'edit.php?post_type=snap_block' ) ) . '">' . esc_html__( 'Settings', 'snap-blocks' ) . '</a>'; 61 return array_merge( $custom_links, $links ); 62 } 45 63 46 public function admin_credits($footer_text) 47 { 48 $footer_text = ''; 64 public static function admin_notices() { 65 $screen = get_current_screen(); 66 if ( !$screen || $screen->post_type !== 'snap_block' || $screen->base !== 'edit' ) { 67 return; 68 } 69 ?> 70 <div class="notice notice-info is-dismissible snap-blocks-docs-notice"> 71 <p> 72 <strong><?php 73 esc_html_e( 'Need help with Snap Blocks?', 'snap-blocks' ); 74 ?></strong><br> 75 <?php 76 esc_html_e( 'Learn how to create reusable blocks, insert them via shortcode or widget, and use display conditions.', 'snap-blocks' ); 77 ?> 78 </p> 79 80 <p> 81 <a href="<?php 82 echo esc_url( 'https://devnet.hr/docs/snap-blocks/' ); 83 ?>" 84 target="_blank" 85 class="button button-primary"> 86 <?php 87 esc_html_e( 'View Documentation', 'snap-blocks' ); 88 ?> 89 </a> 90 </p> 91 </div> 92 <?php 93 } 94 95 public static function admin_credits( $footer_text ) { 96 $footer_text = ''; 49 97 $footer_text .= '<div class="snap-blocks-admin-footer">'; 50 98 $footer_text .= '<div class="snap-blocks-footer-message">'; 51 99 $footer_text .= 'Please rate <strong>Snap Blocks</strong> <a href="https://wordpress.org/support/plugin/snap-blocks/reviews/?rate=5#new-post" target="_blank">★★★★★</a> on <a href="https://wordpress.org/support/plugin/snap-blocks/reviews/?rate=5#new-post" target="_blank">WordPress.org</a> to help us spread the word. Thank you from the <a href="https://devnet.hr/" target="_blank">Devnet</a> team!'; 52 100 $footer_text .= '</div>'; 101 // $footer_text .= '<div class="snap-blocks-pro">'; 102 // $footer_text .= '<a href="https://devnet.hr/plugins/snap-blocks/" target="_blank">Go PRO: More Features, More Power!</a>'; 103 // $footer_text .= '</div>'; 53 104 $footer_text .= '</div>'; 54 $footer_text .= '</div>';55 56 105 return $footer_text; 57 106 } 107 58 108 } -
snap-blocks/tags/1.2.0/admin/post-type.php
r3418044 r3460601 9 9 10 10 11 class PostType11 final class PostType 12 12 { 13 public function __construct()14 { 15 add_action('init', [ $this, 'register_blocks'], 1);16 add_filter('manage_edit-snap_block_columns', [ $this, 'edit_snap_blocks_columns']);17 add_action('manage_snap_block_posts_custom_column', [ $this, 'manage_snap_blocks_columns'], 10, 2);18 19 add_filter('post_row_actions', [ $this, 'duplicate_action'], 10, 2);20 add_filter('admin_action_snap_block_duplicate_post_as_draft', [ $this, 'duplicate_post_as_draft'], 10, 2);21 22 add_filter('template_include', [ $this, 'force_blank_template']);23 } 24 25 public function register_blocks()13 public static function init() 14 { 15 add_action('init', [self::class, 'register_blocks'], 1); 16 add_filter('manage_edit-snap_block_columns', [self::class, 'edit_snap_blocks_columns']); 17 add_action('manage_snap_block_posts_custom_column', [self::class, 'manage_snap_blocks_columns'], 10, 2); 18 19 add_filter('post_row_actions', [self::class, 'duplicate_action'], 10, 2); 20 add_filter('admin_action_snap_block_duplicate_post_as_draft', [self::class, 'duplicate_post_as_draft'], 10, 2); 21 22 add_filter('template_include', [self::class, 'force_blank_template']); 23 } 24 25 public static function register_blocks() 26 26 { 27 27 … … 97 97 } 98 98 99 public function edit_snap_blocks_columns($columns)99 public static function edit_snap_blocks_columns($columns) 100 100 { 101 101 unset($columns['date']); 102 102 103 $columns['taxonomy-snap_block_group'] = esc_html__('Group', 'snap-blocks'); 104 103 105 $new_columns = [ 104 ' shortcode' => esc_html__('Shortcode', 'snap-blocks'),105 ' group' => esc_html__('Group', 'snap-blocks'),106 'date' => esc_html__('Date', 'snap-blocks')106 'auto_insert' => esc_html__('Auto insert', 'snap-blocks'), 107 'shortcode' => esc_html__('Shortcode', 'snap-blocks'), 108 'date' => esc_html__('Date', 'snap-blocks') 107 109 ]; 108 110 … … 111 113 } 112 114 113 public function manage_snap_blocks_columns($column, $post_id)115 public static function manage_snap_blocks_columns($column, $post_id) 114 116 { 115 117 switch ($column) { 118 116 119 case 'shortcode': 117 echo '[snap_block id="' . absint($post_id) . '"]'; 120 $shortcode = '[snap_block id="' . absint($post_id) . '"]'; 121 echo '<input class="snap-blocks-input-shortcode" type="text" readonly="readonly" onfocus="this.select()" value="' . esc_attr($shortcode) . '">'; 118 122 break; 119 case 'group': 120 $terms = wp_get_post_terms($post_id, 'snap_block_group'); 121 $post_type = get_post_type($post_id); 122 $keys = array_keys($terms); 123 $last_key = end($keys); 124 125 if (!$terms) { 126 echo '—'; 127 return; 128 } 129 130 foreach ($terms as $key => $term) { 131 $name = $term->name; 132 133 if ($key !== $last_key) { 134 $name .= ','; 135 } 136 137 $edit_url = 'edit.php?post_type=' . $post_type . '&snap_block_group=' . $term->slug; 138 139 echo '<a href="' . esc_url($edit_url) . '">'; 140 echo esc_html($name); 141 echo '</a>'; 142 } 143 144 break; 145 } 146 } 147 148 public function duplicate_action($actions, $post) 123 } 124 } 125 126 public static function duplicate_action($actions, $post) 149 127 { 150 128 if ($post->post_type !== 'snap_block') { … … 158 136 } 159 137 160 public function duplicate_post_as_draft()138 public static function duplicate_post_as_draft() 161 139 { 162 140 global $wpdb; … … 232 210 } 233 211 234 public function force_blank_template($template)212 public static function force_blank_template($template) 235 213 { 236 214 if (is_singular('snap_block')) { -
snap-blocks/tags/1.2.0/assets/build/admin-rtl.css
r3289677 r3460601 1 1 #wpfooter{background-color:#fff;display:block!important}#footer-upgrade{display:none}.snap-blocks-admin-footer{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.snap-blocks-admin-footer .snap-blocks-pro a{align-items:center;background-color:#311d7e;color:#fff;display:flex;justify-content:space-between;padding:1rem;text-decoration:none}.snap-blocks-admin-footer .snap-blocks-pro a:hover{text-decoration:underline} -
snap-blocks/tags/1.2.0/assets/build/admin.asset.php
r3289677 r3460601 1 <?php return array('dependencies' => array(), 'version' => ' fc8877339ae163dff5cd');1 <?php return array('dependencies' => array(), 'version' => '9a933df12f9ea2e45913'); -
snap-blocks/tags/1.2.0/assets/build/admin.css
r3289677 r3460601 1 1 #wpfooter{background-color:#fff;display:block!important}#footer-upgrade{display:none}.snap-blocks-admin-footer{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.snap-blocks-admin-footer .snap-blocks-pro a{align-items:center;background-color:#311d7e;color:#fff;display:flex;justify-content:space-between;padding:1rem;text-decoration:none}.snap-blocks-admin-footer .snap-blocks-pro a:hover{text-decoration:underline} -
snap-blocks/tags/1.2.0/includes/elementor/integration.php
r3373574 r3460601 11 11 12 12 13 class Integration13 final class Integration 14 14 { 15 15 16 public function __construct()16 public static function init() 17 17 { 18 add_action('elementor/widgets/register', [ $this, 'register_elementor_widget']);19 add_filter('elementor/default_generic_elementor_document_type', [ $this, 'set_elementor_canvas_template'], 10, 2);18 add_action('elementor/widgets/register', [self::class, 'register_elementor_widget']); 19 add_filter('elementor/default_generic_elementor_document_type', [self::class, 'set_elementor_canvas_template'], 10, 2); 20 20 } 21 21 22 public function register_elementor_widget($widgets_manager)22 public static function register_elementor_widget($widgets_manager) 23 23 { 24 24 self::register_widget($widgets_manager); 25 25 } 26 26 27 public function set_elementor_canvas_template($document_type, $post_type)27 public static function set_elementor_canvas_template($document_type, $post_type) 28 28 { 29 29 if ($post_type === 'snap_block') { -
snap-blocks/tags/1.2.0/includes/plugin.php
r3373574 r3460601 5 5 use Devnet\SnapBlocks\Admin\AdminSide; 6 6 use Devnet\SnapBlocks\Includes\Shortcode; 7 use Devnet\SnapBlocks\Includes\Conditions\Bootstrap as ConditionsBootstrap; 7 8 use Devnet\SnapBlocks\Includes\Elementor\Integration as ElementorIntegration; 8 9 use Devnet\SnapBlocks\Includes\WPBakery\Integration as WPBIntegration; … … 14 15 15 16 16 class Plugin17 final class Plugin 17 18 { 18 19 19 protected $plugin_name ;20 protected $version ;20 protected $plugin_name = DEVNET_SNAP_BLOCKS_NAME; 21 protected $version = DEVNET_SNAP_BLOCKS_VERSION; 21 22 22 23 public function __construct() 23 24 { 24 25 $this->version = DEVNET_SNAP_BLOCKS_VERSION;26 $this->plugin_name = DEVNET_SNAP_BLOCKS_NAME;27 28 25 $this->load_dependencies(); 29 26 } … … 34 31 require_once DEVNET_SNAP_BLOCKS_PATH_DIR . '/admin/admin.php'; 35 32 require_once DEVNET_SNAP_BLOCKS_PATH_DIR . '/admin/post-type.php'; 33 34 require_once DEVNET_SNAP_BLOCKS_PATH_DIR . '/includes/conditions/bootstrap.php'; 35 36 36 37 37 require_once DEVNET_SNAP_BLOCKS_PATH_DIR . '/includes/shortcode.php'; … … 46 46 { 47 47 48 new AdminSide($this->get_plugin_name(), $this->get_version()); 49 new Shortcode(); 50 new ElementorIntegration(); 48 AdminSide::init($this->plugin_name, $this->version); 49 Shortcode::init(); 50 51 ElementorIntegration::init(); 51 52 52 53 if (function_exists('vc_map')) { 53 new WPBIntegration();54 WPBIntegration::init(); 54 55 } 55 }56 56 57 public function get_plugin_name() 58 { 59 return $this->plugin_name; 60 } 61 62 public function get_version() 63 { 64 return $this->version; 57 (new ConditionsBootstrap())->init(); 65 58 } 66 59 } -
snap-blocks/tags/1.2.0/includes/shortcode.php
r3373574 r3460601 9 9 10 10 11 class Shortcode11 final class Shortcode 12 12 { 13 13 14 public function __construct()14 public static function init() 15 15 { 16 add_shortcode('snap_block', [ $this, 'render_shortcode']);16 add_shortcode('snap_block', [self::class, 'render_shortcode']); 17 17 } 18 18 19 public function render_shortcode($atts)19 public static function render_shortcode($atts) 20 20 { 21 21 $atts = shortcode_atts([ -
snap-blocks/tags/1.2.0/includes/wpbakery/integration.php
r3418044 r3460601 9 9 10 10 11 class Integration11 final class Integration 12 12 { 13 13 14 public function __construct()14 public static function init() 15 15 { 16 add_action('vc_before_init', [ $this, 'register_vc_element']);16 add_action('vc_before_init', [self::class, 'register_vc_element']); 17 17 } 18 18 19 public function register_vc_element()19 public static function register_vc_element() 20 20 { 21 21 … … 32 32 'heading' => __('Select Snap Block', 'snap-blocks'), 33 33 'param_name' => 'id', 34 'value' => $this->get_snap_block_dropdown_options(),34 'value' => self::get_snap_block_dropdown_options(), 35 35 'admin_label' => true, 36 36 'description' => __('Choose which snap block to insert.', 'snap-blocks') … … 40 40 } 41 41 42 private function get_snap_block_dropdown_options()42 private static function get_snap_block_dropdown_options() 43 43 { 44 44 $blocks = get_posts([ -
snap-blocks/tags/1.2.0/snap-blocks.php
r3418044 r3460601 4 4 * Plugin Name: Snap Blocks 5 5 * Description: Snap blocks with popular page builder support via shortcode or widget. 6 * Version: 1. 1.26 * Version: 1.2.0 7 7 * Requires at least: 6.4 8 8 * Requires PHP: 7.4 … … 12 12 * Text Domain: snap-blocks 13 13 * Domain Path: /languages 14 * 14 15 */ 15 16 16 use Devnet\SnapBlocks\Includes\Plugin; 17 18 if (!defined('ABSPATH')) { 17 if ( !defined( 'ABSPATH' ) ) { 19 18 exit; 20 19 } 21 22 if (function_exists('devnet_sb_fs')) { 23 devnet_sb_fs()->set_basename(true, __FILE__); 20 if ( function_exists( 'devnet_sb_fs' ) ) { 21 devnet_sb_fs()->set_basename( false, __FILE__ ); 24 22 } else { 25 if ( !function_exists('devnet_sb_fs')) {23 if ( !function_exists( 'devnet_sb_fs' ) ) { 26 24 // Create a helper function for easy SDK access. 27 function devnet_sb_fs() 28 { 25 function devnet_sb_fs() { 29 26 global $devnet_sb_fs; 30 31 if (!isset($devnet_sb_fs)) { 27 if ( !isset( $devnet_sb_fs ) ) { 32 28 // Include Freemius SDK. 33 29 require_once __DIR__ . '/vendor/freemius/wordpress-sdk/start.php'; 34 35 $devnet_sb_fs = fs_dynamic_init([ 30 $devnet_sb_fs = fs_dynamic_init( [ 36 31 'id' => '21030', 37 32 'slug' => 'snap-blocks', … … 40 35 'is_org_compliant' => true, 41 36 'is_premium' => false, 37 'premium_suffix' => 'Pro', 42 38 'has_addons' => false, 43 'has_paid_plans' => false, 39 'has_paid_plans' => true, 40 'trial' => [ 41 'days' => 7, 42 'is_require_payment' => true, 43 ], 44 44 'menu' => [ 45 'slug' => 'edit.php?post_type=snap_block',46 'account' => false47 ]48 ] );45 'slug' => 'edit.php?post_type=snap_block', 46 ], 47 'is_live' => true, 48 ] ); 49 49 } 50 51 50 return $devnet_sb_fs; 52 51 } … … 55 54 devnet_sb_fs(); 56 55 // Signal that SDK was initiated. 57 do_action( 'devnet_sb_fs_loaded');56 do_action( 'devnet_sb_fs_loaded' ); 58 57 } 59 60 if (!function_exists('devnet_sb_fs_is_submenu_visible')) { 61 function devnet_sb_fs_is_submenu_visible($is_visible, $menu_id) 62 { 63 if ('contact' != $menu_id) { 58 if ( !function_exists( 'devnet_sb_fs_is_submenu_visible' ) ) { 59 function devnet_sb_fs_is_submenu_visible( $is_visible, $menu_id ) { 60 if ( 'contact' != $menu_id ) { 64 61 return $is_visible; 65 62 } 66 67 63 return devnet_sb_fs()->can_use_premium_code(); 68 64 } 65 69 66 } 67 if ( !function_exists( 'devnet_sb_fs_custom_icon' ) ) { 68 function devnet_sb_fs_custom_icon() { 69 return dirname( __FILE__ ) . '/assets/images/logo.png'; 70 } 70 71 71 if (!function_exists('devnet_sb_fs_custom_icon')) {72 function devnet_sb_fs_custom_icon()73 {74 return dirname(__FILE__) . '/assets/images/logo.png';75 }76 72 } 77 78 73 /* 79 74 * Run Freemius actions and filters. 80 75 */ 81 if (function_exists('devnet_sb_fs')) { 82 devnet_sb_fs()->add_filter('is_submenu_visible', 'devnet_sb_fs_is_submenu_visible', 10, 2); 83 devnet_sb_fs()->add_filter('plugin_icon', 'devnet_sb_fs_custom_icon'); 76 if ( function_exists( 'devnet_sb_fs' ) ) { 77 devnet_sb_fs()->add_filter( 78 'is_submenu_visible', 79 'devnet_sb_fs_is_submenu_visible', 80 10, 81 2 82 ); 83 devnet_sb_fs()->add_filter( 'plugin_icon', 'devnet_sb_fs_custom_icon' ); 84 84 } 85 86 define('DEVNET_SNAP_BLOCKS_VERSION', '1.1.2'); 87 define('DEVNET_SNAP_BLOCKS_NAME', 'snap-blocks'); 88 define('DEVNET_SNAP_BLOCKS_PATH_DIR', plugin_dir_path(__FILE__)); 89 define('DEVNET_SNAP_BLOCKS_PATH_FILE', plugin_basename(__FILE__)); 90 define('DEVNET_SNAP_BLOCKS_URL', plugin_dir_url(__FILE__)); 91 92 add_action('plugins_loaded', function () { 93 85 define( 'DEVNET_SNAP_BLOCKS_VERSION', '1.2.0' ); 86 define( 'DEVNET_SNAP_BLOCKS_NAME', 'snap-blocks' ); 87 define( 'DEVNET_SNAP_BLOCKS_PATH_DIR', plugin_dir_path( __FILE__ ) ); 88 define( 'DEVNET_SNAP_BLOCKS_PATH_FILE', plugin_basename( __FILE__ ) ); 89 define( 'DEVNET_SNAP_BLOCKS_URL', plugin_dir_url( __FILE__ ) ); 90 add_action( 'plugins_loaded', function () { 94 91 require DEVNET_SNAP_BLOCKS_PATH_DIR . 'includes/plugin.php'; 95 92 $plugin = new Plugin(); 96 93 $plugin->run(); 97 } );94 } ); 98 95 } -
snap-blocks/tags/1.2.0/vendor/composer/installed.php
r3418044 r3460601 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 1b47485e1a756a86d640a0cc7e493b45589205f3',6 'reference' => '2dd9efb8d4ae4b9fa7f55d100b2920ac7e00b8c4', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' 1b47485e1a756a86d640a0cc7e493b45589205f3',16 'reference' => '2dd9efb8d4ae4b9fa7f55d100b2920ac7e00b8c4', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
snap-blocks/trunk/README.txt
r3418044 r3460601 1 1 === Snap Blocks === 2 2 Contributors: devnethr, MarinMatosevic 3 Tags: elementor, template, content blocks, repeatable blocks, layout3 Tags: elementor, template, content blocks, repeatable content, layout 4 4 Requires PHP: 7.4 5 Stable tag: 1. 1.25 Stable tag: 1.2.0 6 6 Tested up to: 6.9 7 7 License: GPLv2 or later … … 20 20 🛠️ Built for developers, designers, and content editors who want a smarter way to manage repeatable content across their WordPress sites. 21 21 22 ### [DOCUMENTATION](https://devnet.hr/docs/snap-blocks/) | [SNAP BLOCKS PRO](https://devnet.hr/plugins/snap-blocks/) 22 23 23 24 == Features == … … 27 28 - Insert blocks via **shortcode**, Elementor widget, or WPBakery element 28 29 - Widgets include a dropdown selector for easy block selection 29 - Organize blocks using a `Group` taxonomy 30 - Built-in **Duplicate** action for faster block creation 31 - Clean, minimal UI — integrates seamlessly with the WordPress dashboard 30 - Group taxonomy for better organization 31 - Duplicate blocks with one click 32 - Lightweight and clean admin UI 33 - No performance overhead 34 35 == PRO Features == 36 37 With [Snap Blocks PRO](https://devnet.hr/plugins/snap-blocks/), you unlock automatic block insertion, advanced display conditions, precise hook placement control, and full compatibility with WooCommerce and core WordPress contexts. 38 39 - Automatic block insertion (no shortcode needed) 40 - Hook position selector (WooCommerce & WordPress hooks) 41 - Display blocks based on context: 42 - WooCommerce 43 - Single Product 44 - Product Archive 45 - Cart 46 - Checkout 47 - Thank You page 48 - My Account 49 - WordPress 50 - Single Post 51 - Page 52 - Post Archive 53 - Advanced conditions: 54 - Specific products 55 - Categories 56 - Tags 57 - Pages 58 - Posts 59 - Multiple conditions support 60 - Custom hook name option 61 - Priority control for precise placement 62 - Developer-friendly architecture 32 63 33 64 … … 77 108 Here are some other plugins we have developed that you might find useful: 78 109 79 - [Free Shipping Label](https://wordpress.org/plugins/ free-shipping-label/) - Increase order revenue by showing your customers just how close they are to your free shipping threshold.80 - [FSL Discount Add-On](https://devnet.hr/plugins/ free-shipping-label/#fsl-discount) - By setting customizable thresholds for single, double, or triple-step discounts, you’ll motivate shoppers to add more to their carts.110 - [Free Shipping Label](https://wordpress.org/plugins/snap-blocks/) - Increase order revenue by showing your customers just how close they are to your free shipping threshold. 111 - [FSL Discount Add-On](https://devnet.hr/plugins/snap-blocks/#fsl-discount) - By setting customizable thresholds for single, double, or triple-step discounts, you’ll motivate shoppers to add more to their carts. 81 112 - [Product Price History](https://wordpress.org/plugins/product-price-history/) - Track product price history with customizable charts and graphs on your WooCommerce store. Show lowest price and increase customer trust. 82 113 - [Easy Subscribe](https://wordpress.org/plugins/easy-subscribe/) - Effortlessly integrate customizable subscription forms on your WordPress site with a simple shortcode. … … 128 159 == Changelog == 129 160 161 = 1.2.0 = 162 163 *2026-02-13* 164 165 * Fix: Resolved edge case where shortcode rendered empty wrapper 166 * Fix: Minor admin UI styling inconsistencies 167 * Update: Freemius SDK updated to the latest version 168 * Improvement: Optimized block rendering performance 169 * UI: New centralized conditions modal interface 170 171 130 172 = 1.1.2 = 131 173 -
snap-blocks/trunk/admin/admin.php
r3373574 r3460601 4 4 5 5 use Devnet\SnapBlocks\Admin\PostType; 6 7 if (! defined('ABSPATH')) { 6 if ( !defined( 'ABSPATH' ) ) { 8 7 exit; 9 8 } 9 final class AdminSide { 10 private static $plugin_name; 10 11 12 private static $version; 11 13 12 class AdminSide 13 { 14 private $plugin_name; 15 private $version; 16 17 public function __construct($plugin_name, $version) 18 { 19 20 $this->plugin_name = $plugin_name; 21 $this->version = $version; 22 14 public static function init( $plugin_name, $version ) { 15 self::$plugin_name = $plugin_name; 16 self::$version = $version; 23 17 // Setup post_type 24 new PostType(); 25 26 $post_type = isset($_GET['post_type']) ? sanitize_text_field($_GET['post_type']) : null; 27 28 add_filter('plugin_action_links_' . DEVNET_SNAP_BLOCKS_PATH_FILE, [$this, 'plugin_action_links']); 29 30 if ($post_type === 'snap_block') { 31 add_filter('admin_footer_text', [$this, 'admin_credits']); 18 PostType::init(); 19 $post_type = ( isset( $_GET['post_type'] ) ? sanitize_text_field( $_GET['post_type'] ) : null ); 20 add_filter( 'plugin_action_links_' . DEVNET_SNAP_BLOCKS_PATH_FILE, [self::class, 'plugin_action_links'] ); 21 if ( $post_type === 'snap_block' ) { 22 add_action( 'admin_enqueue_scripts', [self::class, 'enqueue_assets'] ); 23 add_filter( 'admin_footer_text', [self::class, 'admin_credits'] ); 24 add_action( 'all_admin_notices', [self::class, 'admin_notices'] ); 32 25 } 33 26 } 34 27 35 36 public function plugin_action_links($links) 37 { 38 39 $custom_links = []; 40 $custom_links[] = '<a href="' . esc_url(get_admin_url(null, 'edit.php?post_type=snap_block')) . '">' . esc_html__('Settings', 'snap-blocks') . '</a>'; 41 42 return array_merge($custom_links, $links); 28 public static function enqueue_assets( string $hook ) : void { 29 $screen = get_current_screen(); 30 if ( !$screen || $screen->post_type !== 'snap_block' ) { 31 return; 32 } 33 $base_url = DEVNET_SNAP_BLOCKS_URL . 'assets/build/'; 34 wp_enqueue_style( 35 self::$plugin_name . '-admin', 36 $base_url . 'admin.css', 37 [], 38 self::$version 39 ); 40 $asset_file = $base_url . 'admin.asset.php'; 41 $asset_data = ( file_exists( $asset_file ) ? include $asset_file : [ 42 'dependencies' => ['jquery'], 43 'version' => self::$version, 44 ] ); 45 wp_enqueue_script( 46 self::$plugin_name . '-admin', 47 $base_url . 'admin.js', 48 $asset_data['dependencies'], 49 $asset_data['version'], 50 true 51 ); 52 wp_localize_script( self::$plugin_name . '-admin', 'devnet_snap_blocks_admin_script_data', [ 53 'ajaxurl' => admin_url( 'admin-ajax.php' ), 54 'nonce' => wp_create_nonce( 'snap_blocks_admin' ), 55 ] ); 43 56 } 44 57 58 public static function plugin_action_links( $links ) { 59 $custom_links = []; 60 $custom_links[] = '<a href="' . esc_url( get_admin_url( null, 'edit.php?post_type=snap_block' ) ) . '">' . esc_html__( 'Settings', 'snap-blocks' ) . '</a>'; 61 return array_merge( $custom_links, $links ); 62 } 45 63 46 public function admin_credits($footer_text) 47 { 48 $footer_text = ''; 64 public static function admin_notices() { 65 $screen = get_current_screen(); 66 if ( !$screen || $screen->post_type !== 'snap_block' || $screen->base !== 'edit' ) { 67 return; 68 } 69 ?> 70 <div class="notice notice-info is-dismissible snap-blocks-docs-notice"> 71 <p> 72 <strong><?php 73 esc_html_e( 'Need help with Snap Blocks?', 'snap-blocks' ); 74 ?></strong><br> 75 <?php 76 esc_html_e( 'Learn how to create reusable blocks, insert them via shortcode or widget, and use display conditions.', 'snap-blocks' ); 77 ?> 78 </p> 79 80 <p> 81 <a href="<?php 82 echo esc_url( 'https://devnet.hr/docs/snap-blocks/' ); 83 ?>" 84 target="_blank" 85 class="button button-primary"> 86 <?php 87 esc_html_e( 'View Documentation', 'snap-blocks' ); 88 ?> 89 </a> 90 </p> 91 </div> 92 <?php 93 } 94 95 public static function admin_credits( $footer_text ) { 96 $footer_text = ''; 49 97 $footer_text .= '<div class="snap-blocks-admin-footer">'; 50 98 $footer_text .= '<div class="snap-blocks-footer-message">'; 51 99 $footer_text .= 'Please rate <strong>Snap Blocks</strong> <a href="https://wordpress.org/support/plugin/snap-blocks/reviews/?rate=5#new-post" target="_blank">★★★★★</a> on <a href="https://wordpress.org/support/plugin/snap-blocks/reviews/?rate=5#new-post" target="_blank">WordPress.org</a> to help us spread the word. Thank you from the <a href="https://devnet.hr/" target="_blank">Devnet</a> team!'; 52 100 $footer_text .= '</div>'; 101 // $footer_text .= '<div class="snap-blocks-pro">'; 102 // $footer_text .= '<a href="https://devnet.hr/plugins/snap-blocks/" target="_blank">Go PRO: More Features, More Power!</a>'; 103 // $footer_text .= '</div>'; 53 104 $footer_text .= '</div>'; 54 $footer_text .= '</div>';55 56 105 return $footer_text; 57 106 } 107 58 108 } -
snap-blocks/trunk/admin/post-type.php
r3418044 r3460601 9 9 10 10 11 class PostType11 final class PostType 12 12 { 13 public function __construct()14 { 15 add_action('init', [ $this, 'register_blocks'], 1);16 add_filter('manage_edit-snap_block_columns', [ $this, 'edit_snap_blocks_columns']);17 add_action('manage_snap_block_posts_custom_column', [ $this, 'manage_snap_blocks_columns'], 10, 2);18 19 add_filter('post_row_actions', [ $this, 'duplicate_action'], 10, 2);20 add_filter('admin_action_snap_block_duplicate_post_as_draft', [ $this, 'duplicate_post_as_draft'], 10, 2);21 22 add_filter('template_include', [ $this, 'force_blank_template']);23 } 24 25 public function register_blocks()13 public static function init() 14 { 15 add_action('init', [self::class, 'register_blocks'], 1); 16 add_filter('manage_edit-snap_block_columns', [self::class, 'edit_snap_blocks_columns']); 17 add_action('manage_snap_block_posts_custom_column', [self::class, 'manage_snap_blocks_columns'], 10, 2); 18 19 add_filter('post_row_actions', [self::class, 'duplicate_action'], 10, 2); 20 add_filter('admin_action_snap_block_duplicate_post_as_draft', [self::class, 'duplicate_post_as_draft'], 10, 2); 21 22 add_filter('template_include', [self::class, 'force_blank_template']); 23 } 24 25 public static function register_blocks() 26 26 { 27 27 … … 97 97 } 98 98 99 public function edit_snap_blocks_columns($columns)99 public static function edit_snap_blocks_columns($columns) 100 100 { 101 101 unset($columns['date']); 102 102 103 $columns['taxonomy-snap_block_group'] = esc_html__('Group', 'snap-blocks'); 104 103 105 $new_columns = [ 104 ' shortcode' => esc_html__('Shortcode', 'snap-blocks'),105 ' group' => esc_html__('Group', 'snap-blocks'),106 'date' => esc_html__('Date', 'snap-blocks')106 'auto_insert' => esc_html__('Auto insert', 'snap-blocks'), 107 'shortcode' => esc_html__('Shortcode', 'snap-blocks'), 108 'date' => esc_html__('Date', 'snap-blocks') 107 109 ]; 108 110 … … 111 113 } 112 114 113 public function manage_snap_blocks_columns($column, $post_id)115 public static function manage_snap_blocks_columns($column, $post_id) 114 116 { 115 117 switch ($column) { 118 116 119 case 'shortcode': 117 echo '[snap_block id="' . absint($post_id) . '"]'; 120 $shortcode = '[snap_block id="' . absint($post_id) . '"]'; 121 echo '<input class="snap-blocks-input-shortcode" type="text" readonly="readonly" onfocus="this.select()" value="' . esc_attr($shortcode) . '">'; 118 122 break; 119 case 'group': 120 $terms = wp_get_post_terms($post_id, 'snap_block_group'); 121 $post_type = get_post_type($post_id); 122 $keys = array_keys($terms); 123 $last_key = end($keys); 124 125 if (!$terms) { 126 echo '—'; 127 return; 128 } 129 130 foreach ($terms as $key => $term) { 131 $name = $term->name; 132 133 if ($key !== $last_key) { 134 $name .= ','; 135 } 136 137 $edit_url = 'edit.php?post_type=' . $post_type . '&snap_block_group=' . $term->slug; 138 139 echo '<a href="' . esc_url($edit_url) . '">'; 140 echo esc_html($name); 141 echo '</a>'; 142 } 143 144 break; 145 } 146 } 147 148 public function duplicate_action($actions, $post) 123 } 124 } 125 126 public static function duplicate_action($actions, $post) 149 127 { 150 128 if ($post->post_type !== 'snap_block') { … … 158 136 } 159 137 160 public function duplicate_post_as_draft()138 public static function duplicate_post_as_draft() 161 139 { 162 140 global $wpdb; … … 232 210 } 233 211 234 public function force_blank_template($template)212 public static function force_blank_template($template) 235 213 { 236 214 if (is_singular('snap_block')) { -
snap-blocks/trunk/assets/build/admin-rtl.css
r3289677 r3460601 1 1 #wpfooter{background-color:#fff;display:block!important}#footer-upgrade{display:none}.snap-blocks-admin-footer{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.snap-blocks-admin-footer .snap-blocks-pro a{align-items:center;background-color:#311d7e;color:#fff;display:flex;justify-content:space-between;padding:1rem;text-decoration:none}.snap-blocks-admin-footer .snap-blocks-pro a:hover{text-decoration:underline} -
snap-blocks/trunk/assets/build/admin.asset.php
r3289677 r3460601 1 <?php return array('dependencies' => array(), 'version' => ' fc8877339ae163dff5cd');1 <?php return array('dependencies' => array(), 'version' => '9a933df12f9ea2e45913'); -
snap-blocks/trunk/assets/build/admin.css
r3289677 r3460601 1 1 #wpfooter{background-color:#fff;display:block!important}#footer-upgrade{display:none}.snap-blocks-admin-footer{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.snap-blocks-admin-footer .snap-blocks-pro a{align-items:center;background-color:#311d7e;color:#fff;display:flex;justify-content:space-between;padding:1rem;text-decoration:none}.snap-blocks-admin-footer .snap-blocks-pro a:hover{text-decoration:underline} -
snap-blocks/trunk/includes/elementor/integration.php
r3373574 r3460601 11 11 12 12 13 class Integration13 final class Integration 14 14 { 15 15 16 public function __construct()16 public static function init() 17 17 { 18 add_action('elementor/widgets/register', [ $this, 'register_elementor_widget']);19 add_filter('elementor/default_generic_elementor_document_type', [ $this, 'set_elementor_canvas_template'], 10, 2);18 add_action('elementor/widgets/register', [self::class, 'register_elementor_widget']); 19 add_filter('elementor/default_generic_elementor_document_type', [self::class, 'set_elementor_canvas_template'], 10, 2); 20 20 } 21 21 22 public function register_elementor_widget($widgets_manager)22 public static function register_elementor_widget($widgets_manager) 23 23 { 24 24 self::register_widget($widgets_manager); 25 25 } 26 26 27 public function set_elementor_canvas_template($document_type, $post_type)27 public static function set_elementor_canvas_template($document_type, $post_type) 28 28 { 29 29 if ($post_type === 'snap_block') { -
snap-blocks/trunk/includes/plugin.php
r3373574 r3460601 5 5 use Devnet\SnapBlocks\Admin\AdminSide; 6 6 use Devnet\SnapBlocks\Includes\Shortcode; 7 use Devnet\SnapBlocks\Includes\Conditions\Bootstrap as ConditionsBootstrap; 7 8 use Devnet\SnapBlocks\Includes\Elementor\Integration as ElementorIntegration; 8 9 use Devnet\SnapBlocks\Includes\WPBakery\Integration as WPBIntegration; … … 14 15 15 16 16 class Plugin17 final class Plugin 17 18 { 18 19 19 protected $plugin_name ;20 protected $version ;20 protected $plugin_name = DEVNET_SNAP_BLOCKS_NAME; 21 protected $version = DEVNET_SNAP_BLOCKS_VERSION; 21 22 22 23 public function __construct() 23 24 { 24 25 $this->version = DEVNET_SNAP_BLOCKS_VERSION;26 $this->plugin_name = DEVNET_SNAP_BLOCKS_NAME;27 28 25 $this->load_dependencies(); 29 26 } … … 34 31 require_once DEVNET_SNAP_BLOCKS_PATH_DIR . '/admin/admin.php'; 35 32 require_once DEVNET_SNAP_BLOCKS_PATH_DIR . '/admin/post-type.php'; 33 34 require_once DEVNET_SNAP_BLOCKS_PATH_DIR . '/includes/conditions/bootstrap.php'; 35 36 36 37 37 require_once DEVNET_SNAP_BLOCKS_PATH_DIR . '/includes/shortcode.php'; … … 46 46 { 47 47 48 new AdminSide($this->get_plugin_name(), $this->get_version()); 49 new Shortcode(); 50 new ElementorIntegration(); 48 AdminSide::init($this->plugin_name, $this->version); 49 Shortcode::init(); 50 51 ElementorIntegration::init(); 51 52 52 53 if (function_exists('vc_map')) { 53 new WPBIntegration();54 WPBIntegration::init(); 54 55 } 55 }56 56 57 public function get_plugin_name() 58 { 59 return $this->plugin_name; 60 } 61 62 public function get_version() 63 { 64 return $this->version; 57 (new ConditionsBootstrap())->init(); 65 58 } 66 59 } -
snap-blocks/trunk/includes/shortcode.php
r3373574 r3460601 9 9 10 10 11 class Shortcode11 final class Shortcode 12 12 { 13 13 14 public function __construct()14 public static function init() 15 15 { 16 add_shortcode('snap_block', [ $this, 'render_shortcode']);16 add_shortcode('snap_block', [self::class, 'render_shortcode']); 17 17 } 18 18 19 public function render_shortcode($atts)19 public static function render_shortcode($atts) 20 20 { 21 21 $atts = shortcode_atts([ -
snap-blocks/trunk/includes/wpbakery/integration.php
r3418044 r3460601 9 9 10 10 11 class Integration11 final class Integration 12 12 { 13 13 14 public function __construct()14 public static function init() 15 15 { 16 add_action('vc_before_init', [ $this, 'register_vc_element']);16 add_action('vc_before_init', [self::class, 'register_vc_element']); 17 17 } 18 18 19 public function register_vc_element()19 public static function register_vc_element() 20 20 { 21 21 … … 32 32 'heading' => __('Select Snap Block', 'snap-blocks'), 33 33 'param_name' => 'id', 34 'value' => $this->get_snap_block_dropdown_options(),34 'value' => self::get_snap_block_dropdown_options(), 35 35 'admin_label' => true, 36 36 'description' => __('Choose which snap block to insert.', 'snap-blocks') … … 40 40 } 41 41 42 private function get_snap_block_dropdown_options()42 private static function get_snap_block_dropdown_options() 43 43 { 44 44 $blocks = get_posts([ -
snap-blocks/trunk/snap-blocks.php
r3418044 r3460601 4 4 * Plugin Name: Snap Blocks 5 5 * Description: Snap blocks with popular page builder support via shortcode or widget. 6 * Version: 1. 1.26 * Version: 1.2.0 7 7 * Requires at least: 6.4 8 8 * Requires PHP: 7.4 … … 12 12 * Text Domain: snap-blocks 13 13 * Domain Path: /languages 14 * 14 15 */ 15 16 16 use Devnet\SnapBlocks\Includes\Plugin; 17 18 if (!defined('ABSPATH')) { 17 if ( !defined( 'ABSPATH' ) ) { 19 18 exit; 20 19 } 21 22 if (function_exists('devnet_sb_fs')) { 23 devnet_sb_fs()->set_basename(true, __FILE__); 20 if ( function_exists( 'devnet_sb_fs' ) ) { 21 devnet_sb_fs()->set_basename( false, __FILE__ ); 24 22 } else { 25 if ( !function_exists('devnet_sb_fs')) {23 if ( !function_exists( 'devnet_sb_fs' ) ) { 26 24 // Create a helper function for easy SDK access. 27 function devnet_sb_fs() 28 { 25 function devnet_sb_fs() { 29 26 global $devnet_sb_fs; 30 31 if (!isset($devnet_sb_fs)) { 27 if ( !isset( $devnet_sb_fs ) ) { 32 28 // Include Freemius SDK. 33 29 require_once __DIR__ . '/vendor/freemius/wordpress-sdk/start.php'; 34 35 $devnet_sb_fs = fs_dynamic_init([ 30 $devnet_sb_fs = fs_dynamic_init( [ 36 31 'id' => '21030', 37 32 'slug' => 'snap-blocks', … … 40 35 'is_org_compliant' => true, 41 36 'is_premium' => false, 37 'premium_suffix' => 'Pro', 42 38 'has_addons' => false, 43 'has_paid_plans' => false, 39 'has_paid_plans' => true, 40 'trial' => [ 41 'days' => 7, 42 'is_require_payment' => true, 43 ], 44 44 'menu' => [ 45 'slug' => 'edit.php?post_type=snap_block',46 'account' => false47 ]48 ] );45 'slug' => 'edit.php?post_type=snap_block', 46 ], 47 'is_live' => true, 48 ] ); 49 49 } 50 51 50 return $devnet_sb_fs; 52 51 } … … 55 54 devnet_sb_fs(); 56 55 // Signal that SDK was initiated. 57 do_action( 'devnet_sb_fs_loaded');56 do_action( 'devnet_sb_fs_loaded' ); 58 57 } 59 60 if (!function_exists('devnet_sb_fs_is_submenu_visible')) { 61 function devnet_sb_fs_is_submenu_visible($is_visible, $menu_id) 62 { 63 if ('contact' != $menu_id) { 58 if ( !function_exists( 'devnet_sb_fs_is_submenu_visible' ) ) { 59 function devnet_sb_fs_is_submenu_visible( $is_visible, $menu_id ) { 60 if ( 'contact' != $menu_id ) { 64 61 return $is_visible; 65 62 } 66 67 63 return devnet_sb_fs()->can_use_premium_code(); 68 64 } 65 69 66 } 67 if ( !function_exists( 'devnet_sb_fs_custom_icon' ) ) { 68 function devnet_sb_fs_custom_icon() { 69 return dirname( __FILE__ ) . '/assets/images/logo.png'; 70 } 70 71 71 if (!function_exists('devnet_sb_fs_custom_icon')) {72 function devnet_sb_fs_custom_icon()73 {74 return dirname(__FILE__) . '/assets/images/logo.png';75 }76 72 } 77 78 73 /* 79 74 * Run Freemius actions and filters. 80 75 */ 81 if (function_exists('devnet_sb_fs')) { 82 devnet_sb_fs()->add_filter('is_submenu_visible', 'devnet_sb_fs_is_submenu_visible', 10, 2); 83 devnet_sb_fs()->add_filter('plugin_icon', 'devnet_sb_fs_custom_icon'); 76 if ( function_exists( 'devnet_sb_fs' ) ) { 77 devnet_sb_fs()->add_filter( 78 'is_submenu_visible', 79 'devnet_sb_fs_is_submenu_visible', 80 10, 81 2 82 ); 83 devnet_sb_fs()->add_filter( 'plugin_icon', 'devnet_sb_fs_custom_icon' ); 84 84 } 85 86 define('DEVNET_SNAP_BLOCKS_VERSION', '1.1.2'); 87 define('DEVNET_SNAP_BLOCKS_NAME', 'snap-blocks'); 88 define('DEVNET_SNAP_BLOCKS_PATH_DIR', plugin_dir_path(__FILE__)); 89 define('DEVNET_SNAP_BLOCKS_PATH_FILE', plugin_basename(__FILE__)); 90 define('DEVNET_SNAP_BLOCKS_URL', plugin_dir_url(__FILE__)); 91 92 add_action('plugins_loaded', function () { 93 85 define( 'DEVNET_SNAP_BLOCKS_VERSION', '1.2.0' ); 86 define( 'DEVNET_SNAP_BLOCKS_NAME', 'snap-blocks' ); 87 define( 'DEVNET_SNAP_BLOCKS_PATH_DIR', plugin_dir_path( __FILE__ ) ); 88 define( 'DEVNET_SNAP_BLOCKS_PATH_FILE', plugin_basename( __FILE__ ) ); 89 define( 'DEVNET_SNAP_BLOCKS_URL', plugin_dir_url( __FILE__ ) ); 90 add_action( 'plugins_loaded', function () { 94 91 require DEVNET_SNAP_BLOCKS_PATH_DIR . 'includes/plugin.php'; 95 92 $plugin = new Plugin(); 96 93 $plugin->run(); 97 } );94 } ); 98 95 } -
snap-blocks/trunk/vendor/composer/installed.php
r3418044 r3460601 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 1b47485e1a756a86d640a0cc7e493b45589205f3',6 'reference' => '2dd9efb8d4ae4b9fa7f55d100b2920ac7e00b8c4', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' 1b47485e1a756a86d640a0cc7e493b45589205f3',16 'reference' => '2dd9efb8d4ae4b9fa7f55d100b2920ac7e00b8c4', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.