Changeset 3399693
- Timestamp:
- 11/20/2025 12:00:15 PM (4 months ago)
- Location:
- awesome-logo-carousel-block
- Files:
-
- 69 added
- 2 edited
-
tags/2.2.0 (added)
-
tags/2.2.0/admin (added)
-
tags/2.2.0/admin/admin.php (added)
-
tags/2.2.0/admin/css (added)
-
tags/2.2.0/admin/css/admin.css (added)
-
tags/2.2.0/admin/css/editor.css (added)
-
tags/2.2.0/admin/dci (added)
-
tags/2.2.0/admin/dci/alg.svg (added)
-
tags/2.2.0/admin/dci/assets (added)
-
tags/2.2.0/admin/dci/assets/css (added)
-
tags/2.2.0/admin/dci/assets/css/dci.css (added)
-
tags/2.2.0/admin/dci/assets/js (added)
-
tags/2.2.0/admin/dci/assets/js/dci.js (added)
-
tags/2.2.0/admin/dci/deactivate-feedback.php (added)
-
tags/2.2.0/admin/dci/insights.php (added)
-
tags/2.2.0/admin/dci/notice.php (added)
-
tags/2.2.0/admin/dci/start.php (added)
-
tags/2.2.0/admin/js (added)
-
tags/2.2.0/admin/js/admin.js (added)
-
tags/2.2.0/build (added)
-
tags/2.2.0/build/blocks (added)
-
tags/2.2.0/build/blocks/grid-logo (added)
-
tags/2.2.0/build/blocks/grid-logo/block.json (added)
-
tags/2.2.0/build/blocks/grid-logo/index-rtl.css (added)
-
tags/2.2.0/build/blocks/grid-logo/index.asset.php (added)
-
tags/2.2.0/build/blocks/grid-logo/index.css (added)
-
tags/2.2.0/build/blocks/grid-logo/index.js (added)
-
tags/2.2.0/build/blocks/grid-logo/style-index-rtl.css (added)
-
tags/2.2.0/build/blocks/grid-logo/style-index.css (added)
-
tags/2.2.0/build/blocks/logo (added)
-
tags/2.2.0/build/blocks/logo-carousel (added)
-
tags/2.2.0/build/blocks/logo-carousel/block.json (added)
-
tags/2.2.0/build/blocks/logo-carousel/index-rtl.css (added)
-
tags/2.2.0/build/blocks/logo-carousel/index.asset.php (added)
-
tags/2.2.0/build/blocks/logo-carousel/index.css (added)
-
tags/2.2.0/build/blocks/logo-carousel/index.js (added)
-
tags/2.2.0/build/blocks/logo-carousel/style-index-rtl.css (added)
-
tags/2.2.0/build/blocks/logo-carousel/style-index.css (added)
-
tags/2.2.0/build/blocks/logo-carousel/view.asset.php (added)
-
tags/2.2.0/build/blocks/logo-carousel/view.js (added)
-
tags/2.2.0/build/blocks/logo/block.json (added)
-
tags/2.2.0/build/blocks/logo/index.asset.php (added)
-
tags/2.2.0/build/blocks/logo/index.js (added)
-
tags/2.2.0/build/blocks/logo/style-index-rtl.css (added)
-
tags/2.2.0/build/blocks/logo/style-index.css (added)
-
tags/2.2.0/build/global (added)
-
tags/2.2.0/build/global/index-rtl.css (added)
-
tags/2.2.0/build/global/index.asset.php (added)
-
tags/2.2.0/build/global/index.css (added)
-
tags/2.2.0/build/global/index.js (added)
-
tags/2.2.0/build/modules (added)
-
tags/2.2.0/build/modules/index.asset.php (added)
-
tags/2.2.0/build/modules/index.js (added)
-
tags/2.2.0/inc (added)
-
tags/2.2.0/inc/assets (added)
-
tags/2.2.0/inc/assets/css (added)
-
tags/2.2.0/inc/assets/css/swiper-bundle.min.css (added)
-
tags/2.2.0/inc/assets/js (added)
-
tags/2.2.0/inc/assets/js/swiper-bundle.min.js (added)
-
tags/2.2.0/inc/classes (added)
-
tags/2.2.0/inc/classes/enqueue.php (added)
-
tags/2.2.0/inc/classes/register.php (added)
-
tags/2.2.0/inc/classes/style.php (added)
-
tags/2.2.0/inc/init.php (added)
-
tags/2.2.0/inc/instance.php (added)
-
tags/2.2.0/languages (added)
-
tags/2.2.0/languages/awesome-logo-carousel-block.pot (added)
-
tags/2.2.0/plugin.php (added)
-
tags/2.2.0/readme.txt (added)
-
trunk/plugin.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
awesome-logo-carousel-block/trunk/plugin.php
r3289524 r3399693 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.0 8 * Version: 2. 1.108 * Version: 2.2.0 9 9 * Author: Gutenbergkits Team 10 10 * Author URI: https://gutenbergkits.com 11 11 * License: GPL-2.0-or-later 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html13 12 * Text Domain: awesome-logo-carousel-blocks 14 13 * Domain Path: /languages 15 *16 14 */ 17 15 18 // Stop Direct Access 19 if ( ! defined( 'ABSPATH' ) ) { 20 exit; 21 } 16 if ( ! defined( 'ABSPATH' ) ) exit; 22 17 23 24 /**25 * Blocks Final Class26 */27 18 if( ! class_exists ( 'Alcb_Logo_Carousel' ) ) { 28 19 29 20 final class Alcb_Logo_Carousel { 30 21 31 // version 32 const VERSION = '2.1.10'; 33 34 // instance 22 const VERSION = '2.2.0'; 35 23 private static $instance = null; 36 24 37 // constructor38 25 public function __construct() { 26 27 // Media Custom Field Hooks 28 add_filter('attachment_fields_to_edit', [ $this, 'add_custom_link_field_to_media'], 10, 2); 29 add_filter('attachment_fields_to_save', [ $this, 'save_custom_link_field'], 10, 2); 30 add_action('rest_api_init', [ $this, 'register_custom_link_rest_field']); 31 39 32 $this->constants(); 40 33 $this->includes(); 41 34 42 // enable redirect43 35 register_activation_hook( __FILE__, [ $this, 'redirect_to_admin' ] ); 44 // handle redirect45 36 add_action( 'admin_init', [ $this, 'handle_redirection' ] ); 46 37 } 47 38 48 /**49 * Define Constants50 *51 * @return void52 */53 39 public function constants() { 54 40 $constants = [ … … 61 47 62 48 foreach ( $constants as $key => $value ) { 63 if ( ! defined( $key ) ) { 64 define( $key, $value ); 65 } 49 if ( ! defined( $key ) ) define( $key, $value ); 66 50 } 67 51 } 68 52 69 /**70 * Includes71 *72 * @return void73 */74 53 public function includes() { 75 54 require_once ALCB_INC . 'instance.php'; … … 78 57 } 79 58 80 /** 81 * Instance 82 * 83 * @return Alcb_Logo_Carousel 84 */ 85 public static function instance() { 86 if ( is_null( self::$instance ) ) { 87 self::$instance = new self(); 88 } 89 return self::$instance; 59 // Add custom field 60 public function add_custom_link_field_to_media($form_fields, $post) { 61 $form_fields['gtvb_custom_link'] = [ 62 'label' => __('Link', 'awesome-logo-carousel-blocks'), 63 'input' => 'text', 64 'value' => get_post_meta($post->ID, '_gtvb_custom_link', true), 65 'helps' => __('Custom link for this image', 'awesome-logo-carousel-blocks') 66 ]; 67 return $form_fields; 90 68 } 91 69 92 /** 93 * Redirect to admin page after activation 94 */ 70 // Save custom field 71 public function save_custom_link_field($post, $attachment) { 72 if (isset($attachment['gtvb_custom_link'])) { 73 update_post_meta($post['ID'], '_gtvb_custom_link', sanitize_text_field($attachment['gtvb_custom_link'])); 74 } 75 return $post; 76 } 77 78 // Add to REST API 79 public function register_custom_link_rest_field() { 80 register_rest_field('attachment', 'gtvb_custom_link', [ 81 'get_callback' => function($object){ 82 return get_post_meta($object['id'], '_gtvb_custom_link', true); 83 }, 84 'update_callback' => function($value, $object){ 85 return update_post_meta($object['id'], '_gtvb_custom_link', sanitize_text_field($value)); 86 }, 87 'schema' => [ 88 'description' => __('Custom link for the image', 'awesome-logo-carousel-blocks'), 89 'type' => 'string', 90 'context' => ['view', 'edit'] 91 ] 92 ]); 93 } 94 95 95 public function redirect_to_admin() { 96 96 set_transient( '_alcb_redirect', true, 30 ); 97 97 } 98 98 99 /**100 * Handle Redirection101 */102 99 public function handle_redirection() { 103 100 if ( get_transient( '_alcb_redirect' ) ) { 104 101 delete_transient( '_alcb_redirect' ); 105 if ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) && ! ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { 106 wp_safe_redirect( admin_url( 'options-general.php?page=aclb-carousel' ) ); 107 exit; 108 } 102 wp_safe_redirect( admin_url( 'options-general.php?page=aclb-carousel' ) ); 103 exit; 109 104 } 110 105 } 111 106 107 public static function instance() { 108 if ( is_null( self::$instance ) ) self::$instance = new self(); 109 return self::$instance; 110 } 112 111 } 113 112 114 // initialize the plugin115 113 function alcb_logo_carousel() { 116 114 return Alcb_Logo_Carousel::instance(); 117 115 } 118 116 119 // kick-off120 117 alcb_logo_carousel(); 121 122 118 } -
awesome-logo-carousel-block/trunk/readme.txt
r3289524 r3399693 4 4 Requires at least: 6.0 5 5 Tested up to: 6.8 6 Stable tag: 2. 1.106 Stable tag: 2.2.0 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 89 89 90 90 == Changelog == 91 = 2.2.0 = 92 * Fixed: Logo link issues 91 93 92 94 = 2.1.10 =
Note: See TracChangeset
for help on using the changeset viewer.