Changeset 1989464
- Timestamp:
- 12/08/2018 07:34:25 PM (7 years ago)
- Location:
- solo-blocks-photo-gallery/trunk
- Files:
-
- 4 edited
-
core/assets.php (modified) (4 diffs)
-
loader.php (modified) (8 diffs)
-
readme.txt (modified) (2 diffs)
-
solo-blocks-photo-gallery.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
solo-blocks-photo-gallery/trunk/core/assets.php
r1987619 r1989464 39 39 } 40 40 41 function get_jed_locale_data( $domain ){42 $translations = get_translations_for_domain( $domain);41 function get_jed_locale_data($domain){ 42 $translations = get_translations_for_domain($domain); 43 43 44 44 $locale = array( … … 49 49 ); 50 50 51 if ( ! empty( $translations->headers['Plural-Forms'] )) {51 if(!empty($translations->headers['Plural-Forms'])) { 52 52 $locale['']['plural_forms'] = $translations->headers['Plural-Forms']; 53 53 } 54 54 55 foreach ( $translations->entries as $msgid => $entry) {56 $locale[ $msgid] = $entry->translations;55 foreach($translations->entries as $msgid => $entry) { 56 $locale[$msgid] = $entry->translations; 57 57 } 58 58 … … 64 64 */ 65 65 function enqueue_block_assets(){ 66 wp_enqueue_style('wp-blocks'); 66 67 if(apply_filters('solo/blocks/gallery/photo/style/enable-style', true)) { 67 68 wp_enqueue_style( 68 69 'solo-blocks-photo-gallery-frontend', 69 70 plugins_url('dist/frontend.css', dirname(__FILE__)), 70 array( 'wp-blocks'),71 array(), 71 72 filemtime(plugin_dir_path(__DIR__).'dist/frontend.css') 72 73 ); … … 100 101 function enqueue_block_editor_assets(){ 101 102 wp_enqueue_media(); 102 wp_enqueue_script( 'media-grid');103 wp_enqueue_script( 'media');103 wp_enqueue_script('media-grid'); 104 wp_enqueue_script('media'); 104 105 // Scripts. 105 106 wp_enqueue_script( -
solo-blocks-photo-gallery/trunk/loader.php
r1980538 r1989464 29 29 $this->actions(); 30 30 31 $this->FILE = dirname(__FILE__).'/'.$this->FILE;31 $this->FILE = dirname(__FILE__).'/'.$this->FILE; 32 32 $this->required_plugin_path = plugin_dir_path(__DIR__).$this->required_plugin; 33 33 … … 39 39 $this->NAME = $plugin_info['Name']; 40 40 define('SOLO_GALLERY_VERSION', $plugin_info['Version']); 41 } 42 43 function _is_gutenberg_installed(){ 44 $file_path = 'gutenberg/gutenberg.php'; 45 $installed_plugins = get_plugins(); 46 47 return isset($installed_plugins[$file_path]); 41 48 } 42 49 … … 55 62 56 63 if(!function_exists('register_block_type')) { 57 add_action('admin_notices', array($this,'required_plugin_not_loaded')); 64 add_action('admin_notices', array( $this, 'required_plugin_not_loaded' )); 65 58 66 return; 59 67 } … … 61 69 require_once(ABSPATH.'wp-admin/includes/plugin.php'); 62 70 } 63 $ gutenberg_version = get_plugin_data($this->required_plugin_path);71 $version = get_bloginfo('version'); 64 72 65 if(!version_compare($gutenberg_version['Version'], $this->required_plugin_version, '>=')) { 66 add_action('admin_notices', array($this,'required_plugin_wrong_version')); 67 } else { 73 if ($this->_is_gutenberg_installed()) { 74 $gutenberg_version = get_plugin_data($this->required_plugin_path); 75 76 if(!version_compare($gutenberg_version['Version'], $this->required_plugin_version, '>=')) { 77 add_action('admin_notices', array( $this, 'required_plugin_wrong_version' )); 78 } else { 79 require_once __DIR__.'/core/init.php'; 80 } 81 82 } else if (version_compare($version, '5.0', '>=')) { 68 83 require_once __DIR__.'/core/init.php'; 69 84 } 70 71 85 } 72 86 … … 84 98 $activation_url = wp_nonce_url('plugins.php?action=activate&plugin='.$this->required_plugin.'&plugin_status=all&paged=1&s', 'activate-plugin_'.$this->required_plugin); 85 99 86 $message = '<p>'.sprintf(esc_html__('%1$s is not working because you need to activate the %2$s plugin.', 'solo-gallery-photo-textdomain'), $this->NAME,$this->required_plugin_name).'</p>';87 $message .= sprintf('<p><a href="%s" class="button-primary">%s</a></p>', $activation_url, sprintf(esc_html__('Activate %1$s Now', 'solo-gallery-photo-textdomain'), $this->required_plugin_name));100 $message = '<p>'.sprintf(esc_html__('%1$s is not working because you need to activate the %2$s plugin.', 'solo-gallery-photo-textdomain'), $this->NAME, $this->required_plugin_name).'</p>'; 101 $message .= sprintf('<p><a href="%s" class="button-primary">%s</a></p>', $activation_url, sprintf(esc_html__('Activate %1$s Now', 'solo-gallery-photo-textdomain'), $this->required_plugin_name)); 88 102 } else { 89 103 if(!current_user_can('install_plugins')) { … … 93 107 $install_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=gutenberg'), 'install-plugin_gutenberg'); 94 108 95 $message = '<p>'.sprintf(esc_html__('%1$s is not working because you need to install the %2$s plugin.', 'solo-gallery-photo-textdomain'), $this->NAME,$this->required_plugin_name).'</p>';96 $message .= '<p>'.sprintf('<a href="%s" class="button-primary">%s</a>', $install_url, sprintf(esc_html__('Install %1$s Now', 'solo-gallery-photo-textdomain'), $this->required_plugin_name)).'</p>';109 $message = '<p>'.sprintf(esc_html__('%1$s is not working because you need to install the %2$s plugin.', 'solo-gallery-photo-textdomain'), $this->NAME, $this->required_plugin_name).'</p>'; 110 $message .= '<p>'.sprintf('<a href="%s" class="button-primary">%s</a>', $install_url, sprintf(esc_html__('Install %1$s Now', 'solo-gallery-photo-textdomain'), $this->required_plugin_name)).'</p>'; 97 111 } 98 112 … … 101 115 102 116 function required_plugin_wrong_version(){ 103 $msg = sprintf(esc_html__('%1$s requires an update of the %2$s version up to %3$s to work properly.', 'solo-gallery-photo-textdomain'), $this->NAME, $this->required_plugin_name, $this->required_plugin_version);117 $msg = sprintf(esc_html__('%1$s requires an update of the %2$s version up to %3$s to work properly.', 'solo-gallery-photo-textdomain'), $this->NAME, $this->required_plugin_name, $this->required_plugin_version); 104 118 echo '<div class="error"><p>'.$msg.'</p></div>'; 105 119 } … … 112 126 } 113 127 114 public function __clone() {128 public function __clone(){ 115 129 // Cloning instances of the class is forbidden. 116 _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'solo-gallery-photo-textdomain' ), $this->VERSION);130 _doing_it_wrong(__FUNCTION__, esc_html__('Cheatin’ huh?', 'solo-gallery-photo-textdomain'), $this->VERSION); 117 131 } 118 132 119 public function __wakeup() {133 public function __wakeup(){ 120 134 // Unserializing instances of the class is forbidden. 121 _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'solo-gallery-photo-textdomain' ), $this->VERSION);135 _doing_it_wrong(__FUNCTION__, esc_html__('Cheatin’ huh?', 'solo-gallery-photo-textdomain'), $this->VERSION); 122 136 } 123 137 } -
solo-blocks-photo-gallery/trunk/readme.txt
r1987619 r1989464 6 6 Tested up to: 5.0.0 7 7 Requires PHP: 5.6 8 Stable tag: 1.0.6 8 Stable tag: 1.0.6.1 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 19 19 20 20 [Solo Blocks Photo Gallery](https://livewp.site/wp/md/gutenote/solo-blocks-photo-gallery/) 21 22 **Watch this Video to See the Solo Gallery in Action:** 23 [youtube https://www.youtube.com/watch?v=5Jxxz9vXQlk] 21 24 22 25 The advantages of the plugin: -
solo-blocks-photo-gallery/trunk/solo-blocks-photo-gallery.php
r1987619 r1989464 4 4 * Plugin URI: https://soloblocks.com/ 5 5 * Description: Solo Blocks Photo Gallery - is a collection of the galleries for the Gutenberg WordPress editor. 6 * Version: 1.0.6 6 * Version: 1.0.6.1 7 7 * Author: Solo Blocks 8 8 * Text Domain: solo-gallery-photo-textdomain
Note: See TracChangeset
for help on using the changeset viewer.