Changeset 3422476
- Timestamp:
- 12/18/2025 05:02:04 AM (3 months ago)
- Location:
- color-palette-block
- Files:
-
- 4 edited
-
tags/1.1.0/color-palette-block.php (modified) (3 diffs)
-
tags/1.1.0/readme.txt (modified) (1 diff)
-
trunk/color-palette-block.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
color-palette-block/tags/1.1.0/color-palette-block.php
r1901666 r3422476 1 1 <?php 2 2 3 /** 3 4 * Contributors: lubus, ajitbohra … … 13 14 * Tags: gutenberg, block, animation 14 15 * Requires at least: 3.0.1 15 * Tested up to: 4.9.416 * Tested up to: 6.9 16 17 * Stable tag: 1.1.0 17 18 * License: GPLv3 or later … … 22 23 23 24 // If this file is called directly, abort. 24 if ( ! defined( 'WPINC' )) {25 if (! defined('WPINC')) { 25 26 die; 26 27 } 27 28 28 if ( ! class_exists( 'lubusIN_Color_Palette_Block' ) ) : 29 /** 30 * lubusIN_Color_Palette_Block Class. 31 * 32 * Main Class. 33 * 34 * @since 1.0.0 35 */ 36 class lubusIN_Color_Palette_Block { 29 if (! class_exists('lubusIN_Color_Palette_Block')) : 37 30 /** 38 * Instance.31 * lubusIN_Color_Palette_Block Class. 39 32 * 40 * @since41 * @access private42 * @ var lubusIN_Color_Palette_Block33 * Main Class. 34 * 35 * @since 1.0.0 43 36 */ 44 static private $instance; 37 class lubusIN_Color_Palette_Block 38 { 39 /** 40 * Instance. 41 * 42 * @since 43 * @access private 44 * @var lubusIN_Color_Palette_Block 45 */ 46 static private $instance; 45 47 46 /** 47 * Singleton pattern. 48 * 49 * @since 50 * @access private 51 */ 52 private function __construct() { 53 $this->setup_constants(); 54 $this->init_hooks(); 55 } 48 /** 49 * Singleton pattern. 50 * 51 * @since 52 * @access private 53 */ 54 private function __construct() 55 { 56 $this->setup_constants(); 57 $this->init_hooks(); 58 } 56 59 57 60 58 /** 59 * Get instance. 60 * 61 * @since 62 * @access public 63 * @return lubusIN_Color_Palette_Block 64 */ 65 public static function get_instance() { 66 if ( null === static::$instance ) { 67 self::$instance = new static(); 61 /** 62 * Get instance. 63 * 64 * @since 65 * @access public 66 * @return lubusIN_Color_Palette_Block 67 */ 68 public static function get_instance() 69 { 70 if (null === static::$instance) { 71 self::$instance = new static(); 72 } 73 74 return self::$instance; 68 75 } 69 76 70 return self::$instance; 71 } 77 /** 78 * Hook into actions and filters. 79 * 80 * @since 1.0.0 81 */ 82 private function init_hooks() 83 { 84 // Set up localization on init Hook. 85 add_action('init', array($this, 'load_textdomain'), 0); 86 add_action('init', array($this, 'register_color_palette')); 87 } 72 88 73 /** 74 * Hook into actions and filters. 75 * 76 * @since 1.0.0 77 */ 78 private function init_hooks() { 79 // Set up localization on init Hook. 80 add_action( 'init', array( $this, 'load_textdomain' ), 0 ); 81 add_action( 'init', array( $this, 'register_color_palette' ) ); 82 } 89 /** 90 * Setup plugin constants 91 * 92 * @since 1.0 93 * @access private 94 * 95 * @return void 96 */ 97 private function setup_constants() 98 { 99 // Plugin version 100 if (! defined('CPB_VERSION')) { 101 define('CPB_VERSION', '1.0.0'); 102 } 103 // Plugin Root File 104 if (! defined('CPB_PLUGIN_FILE')) { 105 define('CPB_PLUGIN_FILE', __FILE__); 106 } 107 // Plugin Folder Path 108 if (! defined('CPB_PLUGIN_DIR')) { 109 define('CPB_PLUGIN_DIR', plugin_dir_path(CPB_PLUGIN_FILE)); 110 } 111 // Plugin Folder URL 112 if (! defined('CPB_PLUGIN_URL')) { 113 define('CPB_PLUGIN_URL', plugin_dir_url(CPB_PLUGIN_FILE)); 114 } 115 // Plugin Basename aka: "color-palette-block/color-palette-block.php" 116 if (! defined('CPB_PLUGIN_BASENAME')) { 117 define('CPB_PLUGIN_BASENAME', plugin_basename(CPB_PLUGIN_FILE)); 118 } 119 } 83 120 84 /** 85 * Setup plugin constants 86 * 87 * @since 1.0 88 * @access private 89 * 90 * @return void 91 */ 92 private function setup_constants() { 93 // Plugin version 94 if ( ! defined( 'CPB_VERSION' ) ) { 95 define( 'CPB_VERSION', '1.0.0' ); 121 /** 122 * Loads the plugin language files. 123 * 124 * @since 1.0.0 125 * @access public 126 * 127 * @return void 128 */ 129 public function load_textdomain() 130 { 131 $locale = apply_filters('plugin_locale', get_locale(), 'cpb'); 132 // wp-content/languages/plugin-name/plugin-name-en_EN.mo. 133 load_textdomain('cpb', trailingslashit(WP_LANG_DIR) . 'color-palette-block' . '/' . 'cpb' . '-' . $locale . '.mo'); 134 // wp-content/plugins/plugin-name/languages/plugin-name-en_EN.mo. 135 load_plugin_textdomain('cpb', false, basename(CPB_PLUGIN_DIR) . '/languages/'); 96 136 } 97 // Plugin Root File 98 if ( ! defined( 'CPB_PLUGIN_FILE' ) ) { 99 define( 'CPB_PLUGIN_FILE', __FILE__ ); 100 } 101 // Plugin Folder Path 102 if ( ! defined( 'CPB_PLUGIN_DIR' ) ) { 103 define( 'CPB_PLUGIN_DIR', plugin_dir_path( CPB_PLUGIN_FILE ) ); 104 } 105 // Plugin Folder URL 106 if ( ! defined( 'CPB_PLUGIN_URL' ) ) { 107 define( 'CPB_PLUGIN_URL', plugin_dir_url( CPB_PLUGIN_FILE ) ); 108 } 109 // Plugin Basename aka: "color-palette-block/color-palette-block.php" 110 if ( ! defined( 'CPB_PLUGIN_BASENAME' ) ) { 111 define( 'CPB_PLUGIN_BASENAME', plugin_basename( CPB_PLUGIN_FILE ) ); 137 138 /** 139 * Registers scripts 140 * 141 * @since 1.0.0 142 * @access public 143 * 144 * @return void 145 */ 146 public function register_color_palette() 147 { 148 $block_js = 'build/script.js'; 149 $block_css = 'build/style.css'; 150 $editor_css = 'build/editor.css'; 151 152 // Script 153 wp_register_script( 154 'color-palette-block-js', 155 CPB_PLUGIN_URL . $block_js, 156 array( 157 'wp-blocks', 158 'wp-element', 159 'wp-components', 160 'wp-i18n', 161 ), 162 filemtime(CPB_PLUGIN_DIR . $block_js) 163 ); 164 165 // Common 166 wp_register_style( 167 'color-palette-block', 168 CPB_PLUGIN_URL . $block_css, 169 array(), 170 filemtime(CPB_PLUGIN_DIR . $block_css) 171 ); 172 173 // Editor 174 wp_register_style( 175 'color-palette-block-editor', 176 CPB_PLUGIN_URL . $editor_css, 177 array(), 178 filemtime(CPB_PLUGIN_DIR . $editor_css) 179 ); 180 181 // Register block type 182 register_block_type('lubus/color-palette-block', array( 183 'style' => 'color-palette-block', 184 'editor_style' => 'color-palette-block-editor', 185 'script' => 'color-palette-block-js', 186 )); 112 187 } 113 188 } 114 115 /**116 * Loads the plugin language files.117 *118 * @since 1.0.0119 * @access public120 *121 * @return void122 */123 public function load_textdomain() {124 $locale = apply_filters( 'plugin_locale', get_locale(), 'cpb' );125 // wp-content/languages/plugin-name/plugin-name-en_EN.mo.126 load_textdomain( 'cpb', trailingslashit( WP_LANG_DIR ) . 'color-palette-block' . '/' . 'cpb' . '-' . $locale . '.mo' );127 // wp-content/plugins/plugin-name/languages/plugin-name-en_EN.mo.128 load_plugin_textdomain( 'cpb', false, basename( CPB_PLUGIN_DIR ) . '/languages/' );129 }130 131 /**132 * Registers scripts133 *134 * @since 1.0.0135 * @access public136 *137 * @return void138 */139 public function register_color_palette(){140 $block_js = 'build/script.js';141 $block_css = 'build/style.css';142 $editor_css = 'build/editor.css';143 144 // Script145 wp_register_script(146 'color-palette-block-js',147 CPB_PLUGIN_URL . $block_js,148 array(149 'wp-blocks',150 'wp-element',151 'wp-components',152 'wp-i18n',153 ),154 filemtime( CPB_PLUGIN_DIR . $block_js )155 );156 157 // Common158 wp_register_style(159 'color-palette-block',160 CPB_PLUGIN_URL . $block_css,161 array(),162 filemtime(CPB_PLUGIN_DIR . $block_css)163 );164 165 // Editor166 wp_register_style(167 'color-palette-block-editor',168 CPB_PLUGIN_URL . $editor_css,169 array(),170 filemtime(CPB_PLUGIN_DIR . $editor_css)171 );172 173 // Register block type174 register_block_type('lubus/color-palette-block', array(175 'style' => 'color-palette-block',176 'editor_style' => 'color-palette-block-editor',177 'script' => 'color-palette-block-js',178 ));179 }180 }181 189 182 190 endif; 183 191 184 192 lubusIN_Color_Palette_Block::get_instance(); 185 ?> -
color-palette-block/tags/1.1.0/readme.txt
r1901666 r3422476 1 1 === Color Palette === 2 Contributors: lubus,ajitbohra 2 Contributors: lubus,ajitbohra,punitv342 3 3 Donate link: http://www.lubus.in 4 4 Tags: gutenberg, block, color, palette 5 5 Requires at least: 3.0.1 6 Tested up to: 4.9.46 Tested up to: 6.9 7 7 Stable tag: 1.1.0 8 8 License: GPLv3 -
color-palette-block/trunk/color-palette-block.php
r1901666 r3422476 1 1 <?php 2 2 3 /** 3 4 * Contributors: lubus, ajitbohra … … 13 14 * Tags: gutenberg, block, animation 14 15 * Requires at least: 3.0.1 15 * Tested up to: 4.9.416 * Tested up to: 6.9 16 17 * Stable tag: 1.1.0 17 18 * License: GPLv3 or later … … 22 23 23 24 // If this file is called directly, abort. 24 if ( ! defined( 'WPINC' )) {25 if (! defined('WPINC')) { 25 26 die; 26 27 } 27 28 28 if ( ! class_exists( 'lubusIN_Color_Palette_Block' ) ) : 29 /** 30 * lubusIN_Color_Palette_Block Class. 31 * 32 * Main Class. 33 * 34 * @since 1.0.0 35 */ 36 class lubusIN_Color_Palette_Block { 29 if (! class_exists('lubusIN_Color_Palette_Block')) : 37 30 /** 38 * Instance.31 * lubusIN_Color_Palette_Block Class. 39 32 * 40 * @since41 * @access private42 * @ var lubusIN_Color_Palette_Block33 * Main Class. 34 * 35 * @since 1.0.0 43 36 */ 44 static private $instance; 37 class lubusIN_Color_Palette_Block 38 { 39 /** 40 * Instance. 41 * 42 * @since 43 * @access private 44 * @var lubusIN_Color_Palette_Block 45 */ 46 static private $instance; 45 47 46 /** 47 * Singleton pattern. 48 * 49 * @since 50 * @access private 51 */ 52 private function __construct() { 53 $this->setup_constants(); 54 $this->init_hooks(); 55 } 48 /** 49 * Singleton pattern. 50 * 51 * @since 52 * @access private 53 */ 54 private function __construct() 55 { 56 $this->setup_constants(); 57 $this->init_hooks(); 58 } 56 59 57 60 58 /** 59 * Get instance. 60 * 61 * @since 62 * @access public 63 * @return lubusIN_Color_Palette_Block 64 */ 65 public static function get_instance() { 66 if ( null === static::$instance ) { 67 self::$instance = new static(); 61 /** 62 * Get instance. 63 * 64 * @since 65 * @access public 66 * @return lubusIN_Color_Palette_Block 67 */ 68 public static function get_instance() 69 { 70 if (null === static::$instance) { 71 self::$instance = new static(); 72 } 73 74 return self::$instance; 68 75 } 69 76 70 return self::$instance; 71 } 77 /** 78 * Hook into actions and filters. 79 * 80 * @since 1.0.0 81 */ 82 private function init_hooks() 83 { 84 // Set up localization on init Hook. 85 add_action('init', array($this, 'load_textdomain'), 0); 86 add_action('init', array($this, 'register_color_palette')); 87 } 72 88 73 /** 74 * Hook into actions and filters. 75 * 76 * @since 1.0.0 77 */ 78 private function init_hooks() { 79 // Set up localization on init Hook. 80 add_action( 'init', array( $this, 'load_textdomain' ), 0 ); 81 add_action( 'init', array( $this, 'register_color_palette' ) ); 82 } 89 /** 90 * Setup plugin constants 91 * 92 * @since 1.0 93 * @access private 94 * 95 * @return void 96 */ 97 private function setup_constants() 98 { 99 // Plugin version 100 if (! defined('CPB_VERSION')) { 101 define('CPB_VERSION', '1.0.0'); 102 } 103 // Plugin Root File 104 if (! defined('CPB_PLUGIN_FILE')) { 105 define('CPB_PLUGIN_FILE', __FILE__); 106 } 107 // Plugin Folder Path 108 if (! defined('CPB_PLUGIN_DIR')) { 109 define('CPB_PLUGIN_DIR', plugin_dir_path(CPB_PLUGIN_FILE)); 110 } 111 // Plugin Folder URL 112 if (! defined('CPB_PLUGIN_URL')) { 113 define('CPB_PLUGIN_URL', plugin_dir_url(CPB_PLUGIN_FILE)); 114 } 115 // Plugin Basename aka: "color-palette-block/color-palette-block.php" 116 if (! defined('CPB_PLUGIN_BASENAME')) { 117 define('CPB_PLUGIN_BASENAME', plugin_basename(CPB_PLUGIN_FILE)); 118 } 119 } 83 120 84 /** 85 * Setup plugin constants 86 * 87 * @since 1.0 88 * @access private 89 * 90 * @return void 91 */ 92 private function setup_constants() { 93 // Plugin version 94 if ( ! defined( 'CPB_VERSION' ) ) { 95 define( 'CPB_VERSION', '1.0.0' ); 121 /** 122 * Loads the plugin language files. 123 * 124 * @since 1.0.0 125 * @access public 126 * 127 * @return void 128 */ 129 public function load_textdomain() 130 { 131 $locale = apply_filters('plugin_locale', get_locale(), 'cpb'); 132 // wp-content/languages/plugin-name/plugin-name-en_EN.mo. 133 load_textdomain('cpb', trailingslashit(WP_LANG_DIR) . 'color-palette-block' . '/' . 'cpb' . '-' . $locale . '.mo'); 134 // wp-content/plugins/plugin-name/languages/plugin-name-en_EN.mo. 135 load_plugin_textdomain('cpb', false, basename(CPB_PLUGIN_DIR) . '/languages/'); 96 136 } 97 // Plugin Root File 98 if ( ! defined( 'CPB_PLUGIN_FILE' ) ) { 99 define( 'CPB_PLUGIN_FILE', __FILE__ ); 100 } 101 // Plugin Folder Path 102 if ( ! defined( 'CPB_PLUGIN_DIR' ) ) { 103 define( 'CPB_PLUGIN_DIR', plugin_dir_path( CPB_PLUGIN_FILE ) ); 104 } 105 // Plugin Folder URL 106 if ( ! defined( 'CPB_PLUGIN_URL' ) ) { 107 define( 'CPB_PLUGIN_URL', plugin_dir_url( CPB_PLUGIN_FILE ) ); 108 } 109 // Plugin Basename aka: "color-palette-block/color-palette-block.php" 110 if ( ! defined( 'CPB_PLUGIN_BASENAME' ) ) { 111 define( 'CPB_PLUGIN_BASENAME', plugin_basename( CPB_PLUGIN_FILE ) ); 137 138 /** 139 * Registers scripts 140 * 141 * @since 1.0.0 142 * @access public 143 * 144 * @return void 145 */ 146 public function register_color_palette() 147 { 148 $block_js = 'build/script.js'; 149 $block_css = 'build/style.css'; 150 $editor_css = 'build/editor.css'; 151 152 // Script 153 wp_register_script( 154 'color-palette-block-js', 155 CPB_PLUGIN_URL . $block_js, 156 array( 157 'wp-blocks', 158 'wp-element', 159 'wp-components', 160 'wp-i18n', 161 ), 162 filemtime(CPB_PLUGIN_DIR . $block_js) 163 ); 164 165 // Common 166 wp_register_style( 167 'color-palette-block', 168 CPB_PLUGIN_URL . $block_css, 169 array(), 170 filemtime(CPB_PLUGIN_DIR . $block_css) 171 ); 172 173 // Editor 174 wp_register_style( 175 'color-palette-block-editor', 176 CPB_PLUGIN_URL . $editor_css, 177 array(), 178 filemtime(CPB_PLUGIN_DIR . $editor_css) 179 ); 180 181 // Register block type 182 register_block_type('lubus/color-palette-block', array( 183 'style' => 'color-palette-block', 184 'editor_style' => 'color-palette-block-editor', 185 'script' => 'color-palette-block-js', 186 )); 112 187 } 113 188 } 114 115 /**116 * Loads the plugin language files.117 *118 * @since 1.0.0119 * @access public120 *121 * @return void122 */123 public function load_textdomain() {124 $locale = apply_filters( 'plugin_locale', get_locale(), 'cpb' );125 // wp-content/languages/plugin-name/plugin-name-en_EN.mo.126 load_textdomain( 'cpb', trailingslashit( WP_LANG_DIR ) . 'color-palette-block' . '/' . 'cpb' . '-' . $locale . '.mo' );127 // wp-content/plugins/plugin-name/languages/plugin-name-en_EN.mo.128 load_plugin_textdomain( 'cpb', false, basename( CPB_PLUGIN_DIR ) . '/languages/' );129 }130 131 /**132 * Registers scripts133 *134 * @since 1.0.0135 * @access public136 *137 * @return void138 */139 public function register_color_palette(){140 $block_js = 'build/script.js';141 $block_css = 'build/style.css';142 $editor_css = 'build/editor.css';143 144 // Script145 wp_register_script(146 'color-palette-block-js',147 CPB_PLUGIN_URL . $block_js,148 array(149 'wp-blocks',150 'wp-element',151 'wp-components',152 'wp-i18n',153 ),154 filemtime( CPB_PLUGIN_DIR . $block_js )155 );156 157 // Common158 wp_register_style(159 'color-palette-block',160 CPB_PLUGIN_URL . $block_css,161 array(),162 filemtime(CPB_PLUGIN_DIR . $block_css)163 );164 165 // Editor166 wp_register_style(167 'color-palette-block-editor',168 CPB_PLUGIN_URL . $editor_css,169 array(),170 filemtime(CPB_PLUGIN_DIR . $editor_css)171 );172 173 // Register block type174 register_block_type('lubus/color-palette-block', array(175 'style' => 'color-palette-block',176 'editor_style' => 'color-palette-block-editor',177 'script' => 'color-palette-block-js',178 ));179 }180 }181 189 182 190 endif; 183 191 184 192 lubusIN_Color_Palette_Block::get_instance(); 185 ?> -
color-palette-block/trunk/readme.txt
r1901666 r3422476 1 1 === Color Palette === 2 Contributors: lubus,ajitbohra 2 Contributors: lubus,ajitbohra,punitv342 3 3 Donate link: http://www.lubus.in 4 4 Tags: gutenberg, block, color, palette 5 5 Requires at least: 3.0.1 6 Tested up to: 4.9.46 Tested up to: 6.9 7 7 Stable tag: 1.1.0 8 8 License: GPLv3
Note: See TracChangeset
for help on using the changeset viewer.