Changeset 2020451
- Timestamp:
- 01/28/2019 01:39:31 PM (7 years ago)
- Location:
- cloud-blocks
- Files:
-
- 1 deleted
- 3 edited
- 43 copied
-
tags/1.1.3 (copied) (copied from cloud-blocks/trunk)
-
tags/1.1.3/README.md (copied) (copied from cloud-blocks/trunk/README.md)
-
tags/1.1.3/assets (copied) (copied from cloud-blocks/trunk/assets)
-
tags/1.1.3/assets/css/style.css (copied) (copied from cloud-blocks/trunk/assets/css/style.css)
-
tags/1.1.3/assets/js/script.js (copied) (copied from cloud-blocks/trunk/assets/js/script.js)
-
tags/1.1.3/assets/js/script.min.js (copied) (copied from cloud-blocks/trunk/assets/js/script.min.js)
-
tags/1.1.3/assets/source/js/block-component.js (copied) (copied from cloud-blocks/trunk/assets/source/js/block-component.js)
-
tags/1.1.3/assets/source/js/block-details.js (copied) (copied from cloud-blocks/trunk/assets/source/js/block-details.js)
-
tags/1.1.3/assets/source/js/explorer-filter.js (copied) (copied from cloud-blocks/trunk/assets/source/js/explorer-filter.js)
-
tags/1.1.3/assets/source/js/script.js (copied) (copied from cloud-blocks/trunk/assets/source/js/script.js)
-
tags/1.1.3/assets/source/scss/style.css (copied) (copied from cloud-blocks/trunk/assets/source/scss/style.css)
-
tags/1.1.3/assets/source/scss/style.scss (copied) (copied from cloud-blocks/trunk/assets/source/scss/style.scss)
-
tags/1.1.3/assets/thumbnail.png (copied) (copied from cloud-blocks/trunk/assets/thumbnail.png)
-
tags/1.1.3/cloud-blocks.php (copied) (copied from cloud-blocks/trunk/cloud-blocks.php)
-
tags/1.1.3/composer.json (copied) (copied from cloud-blocks/trunk/composer.json)
-
tags/1.1.3/composer.lock (copied) (copied from cloud-blocks/trunk/composer.lock)
-
tags/1.1.3/core (copied) (copied from cloud-blocks/trunk/core)
-
tags/1.1.3/core/Activator.php (copied) (copied from cloud-blocks/trunk/core/Activator.php)
-
tags/1.1.3/core/Blocks/Blocks.php (copied) (copied from cloud-blocks/trunk/core/Blocks/Blocks.php) (2 diffs)
-
tags/1.1.3/core/Blocks/Explore.php (copied) (copied from cloud-blocks/trunk/core/Blocks/Explore.php)
-
tags/1.1.3/core/Blocks/Options.php (copied) (copied from cloud-blocks/trunk/core/Blocks/Options.php)
-
tags/1.1.3/core/CloudBlocks.php (copied) (copied from cloud-blocks/trunk/core/CloudBlocks.php)
-
tags/1.1.3/core/Settings/Tools.php (copied) (copied from cloud-blocks/trunk/core/Settings/Tools.php)
-
tags/1.1.3/core/Settings/Translations.php (copied) (copied from cloud-blocks/trunk/core/Settings/Translations.php)
-
tags/1.1.3/docs (copied) (copied from cloud-blocks/trunk/docs)
-
tags/1.1.3/docs/changelog.md (copied) (copied from cloud-blocks/trunk/docs/changelog.md) (1 diff)
-
tags/1.1.3/docs/create-block.md (copied) (copied from cloud-blocks/trunk/docs/create-block.md)
-
tags/1.1.3/docs/hooks.md (copied) (copied from cloud-blocks/trunk/docs/hooks.md)
-
tags/1.1.3/docs/migrate-block.md (copied) (copied from cloud-blocks/trunk/docs/migrate-block.md)
-
tags/1.1.3/docs/private-blocks.md (copied) (copied from cloud-blocks/trunk/docs/private-blocks.md)
-
tags/1.1.3/languages (copied) (copied from cloud-blocks/trunk/languages)
-
tags/1.1.3/languages/cloud-blocks-it_IT.mo (copied) (copied from cloud-blocks/trunk/languages/cloud-blocks-it_IT.mo)
-
tags/1.1.3/languages/cloud-blocks-it_IT.po (copied) (copied from cloud-blocks/trunk/languages/cloud-blocks-it_IT.po)
-
tags/1.1.3/languages/cloud-blocks-nb_NO.mo (copied) (copied from cloud-blocks/trunk/languages/cloud-blocks-nb_NO.mo)
-
tags/1.1.3/languages/cloud-blocks-nb_NO.po (copied) (copied from cloud-blocks/trunk/languages/cloud-blocks-nb_NO.po)
-
tags/1.1.3/languages/cloud-blocks-pl_PL.mo (copied) (copied from cloud-blocks/trunk/languages/cloud-blocks-pl_PL.mo)
-
tags/1.1.3/languages/cloud-blocks-pl_PL.po (copied) (copied from cloud-blocks/trunk/languages/cloud-blocks-pl_PL.po)
-
tags/1.1.3/languages/cloud-blocks-pt.mo (copied) (copied from cloud-blocks/trunk/languages/cloud-blocks-pt.mo)
-
tags/1.1.3/languages/cloud-blocks-pt.po (copied) (copied from cloud-blocks/trunk/languages/cloud-blocks-pt.po)
-
tags/1.1.3/languages/cloud-blocks-pt_PT.mo (copied) (copied from cloud-blocks/trunk/languages/cloud-blocks-pt_PT.mo)
-
tags/1.1.3/languages/cloud-blocks-pt_PT.po (copied) (copied from cloud-blocks/trunk/languages/cloud-blocks-pt_PT.po)
-
tags/1.1.3/readme.txt (copied) (copied from cloud-blocks/trunk/readme.txt) (1 diff)
-
tags/1.1.3/vendor (copied) (copied from cloud-blocks/trunk/vendor)
-
tags/1.1.3/vendor/bin (deleted)
-
trunk/core/Blocks/Blocks.php (modified) (2 diffs)
-
trunk/docs/changelog.md (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cloud-blocks/tags/1.1.3/core/Blocks/Blocks.php
r2007547 r2020451 28 28 add_action( 'wp_ajax_fgc_local_blocks', array( $this, 'local_blocks' ) ); 29 29 add_action( 'wp_ajax_nopriv_fgc_local_blocks', array( $this, 'local_blocks' ) ); 30 31 // add_action( 'init', array( $this, 'custom_blocks' ) );32 30 } 33 31 … … 153 151 ); 154 152 wp_send_json_success( $response ); 155 }156 157 /**158 * Check for existence of custom blocks and load them.159 * Custom blocks can be uploaded to /wp-content/gutenberg-blocks/160 * They must follow file structure like:161 * -/block-dir/162 * --/style.css163 * --/script.js164 *165 * @since 1.0.0166 * @param167 * @return168 */169 public function custom_blocks() {170 // First we must make sure files.php loaded171 if ( ! function_exists( 'get_home_path' ) ) {172 include_once ABSPATH . '/wp-admin/includes/file.php';173 }174 // list all blocks (The sub-directory of /gutenberg-blocks/).175 $gutenberg_blocks_dir = wp_upload_dir()['basedir'] . '/gutenberg-blocks/';176 $gutenberg_blocks = list_files($gutenberg_blocks_dir, 1);177 // Then loop through blocks.178 foreach ($gutenberg_blocks as $block) {179 preg_match( '/([a-zA-Z-_]*(:?\/))$/i', $block, $block_name);180 $block_name = str_replace('/', '', $block_name);181 // And list js and css files.182 $block_files = list_files($block . 'build', 1);183 184 // Reset script and styles of the block185 $block_style = null;186 $editor_style = null;187 $block_script = null;188 189 // Extract block js and css files190 foreach ($block_files as $file) {191 if ( preg_match('/style.css$/i', $file) ) {192 preg_match( '/wp-content\/uploads\/gutenberg-blocks\/[a-zA-Z0-9-_\/.]*/i', $file, $block_style );193 }194 if ( preg_match('/editor.css$/i', $file) ) {195 preg_match( '/wp-content\/uploads\/gutenberg-blocks\/[a-zA-Z0-9-_\/.]*/i', $file, $editor_style );196 }197 if ( preg_match('/index.js$/i', $file) ) {198 preg_match( '/wp-content\/uploads\/gutenberg-blocks\/[a-zA-Z0-9-_\/.]*/i', $file, $block_script );199 }200 }201 global $pagenow;202 if ( ( $pagenow == 'post-new.php' || $pagenow == 'post.php' ) && isset( $block_script ) && !empty( $block_script ) ) {203 wp_enqueue_script( $block_name[0], '/' . $block_script[0], array( 'wp-editor', 'wp-blocks', 'wp-element', 'wp-i18n' ), FGC_VERSION, true);204 }205 if ( ( $pagenow == 'post-new.php' || $pagenow == 'post.php' || !is_admin() ) && isset( $block_style ) && !empty( $block_style ) ) {206 wp_enqueue_style( $block_name[0], '/' . $block_style[0], array(), FGC_VERSION);207 if ( isset( $editor_style ) && !empty( $editor_style ) && is_admin() ) {208 wp_enqueue_style( $block_name[0] . '-editor', '/' . $editor_style[0], array(), FGC_VERSION);209 }210 }211 }212 153 } 213 154 -
cloud-blocks/tags/1.1.3/docs/changelog.md
r2020434 r2020451 4 4 * **Fix**: Fix some translations 5 5 * **Fix**: Fix database table issue if plugin network activated [issue #13](https://github.com/front/cloud-blocks/issues/13) 6 * **Cleanup**: Remove custom_blocks method since its not used anymore. This method was for scanning local blocks inside /wp-content/gutenberg-blocks directory 6 7 7 8 #### 1.1.2 -
cloud-blocks/tags/1.1.3/readme.txt
r2020434 r2020451 79 79 * Fix: Fix some translations 80 80 * Fix: Fix database table issue if plugin network activated [issue #13](https://github.com/front/cloud-blocks/issues/13) 81 * Cleanup: Remove custom_blocks method since its not used anymore. This method was for scanning local blocks inside /wp-content/gutenberg-blocks directory 81 82 82 83 = 1.1.2 = -
cloud-blocks/trunk/core/Blocks/Blocks.php
r2007547 r2020451 28 28 add_action( 'wp_ajax_fgc_local_blocks', array( $this, 'local_blocks' ) ); 29 29 add_action( 'wp_ajax_nopriv_fgc_local_blocks', array( $this, 'local_blocks' ) ); 30 31 // add_action( 'init', array( $this, 'custom_blocks' ) );32 30 } 33 31 … … 153 151 ); 154 152 wp_send_json_success( $response ); 155 }156 157 /**158 * Check for existence of custom blocks and load them.159 * Custom blocks can be uploaded to /wp-content/gutenberg-blocks/160 * They must follow file structure like:161 * -/block-dir/162 * --/style.css163 * --/script.js164 *165 * @since 1.0.0166 * @param167 * @return168 */169 public function custom_blocks() {170 // First we must make sure files.php loaded171 if ( ! function_exists( 'get_home_path' ) ) {172 include_once ABSPATH . '/wp-admin/includes/file.php';173 }174 // list all blocks (The sub-directory of /gutenberg-blocks/).175 $gutenberg_blocks_dir = wp_upload_dir()['basedir'] . '/gutenberg-blocks/';176 $gutenberg_blocks = list_files($gutenberg_blocks_dir, 1);177 // Then loop through blocks.178 foreach ($gutenberg_blocks as $block) {179 preg_match( '/([a-zA-Z-_]*(:?\/))$/i', $block, $block_name);180 $block_name = str_replace('/', '', $block_name);181 // And list js and css files.182 $block_files = list_files($block . 'build', 1);183 184 // Reset script and styles of the block185 $block_style = null;186 $editor_style = null;187 $block_script = null;188 189 // Extract block js and css files190 foreach ($block_files as $file) {191 if ( preg_match('/style.css$/i', $file) ) {192 preg_match( '/wp-content\/uploads\/gutenberg-blocks\/[a-zA-Z0-9-_\/.]*/i', $file, $block_style );193 }194 if ( preg_match('/editor.css$/i', $file) ) {195 preg_match( '/wp-content\/uploads\/gutenberg-blocks\/[a-zA-Z0-9-_\/.]*/i', $file, $editor_style );196 }197 if ( preg_match('/index.js$/i', $file) ) {198 preg_match( '/wp-content\/uploads\/gutenberg-blocks\/[a-zA-Z0-9-_\/.]*/i', $file, $block_script );199 }200 }201 global $pagenow;202 if ( ( $pagenow == 'post-new.php' || $pagenow == 'post.php' ) && isset( $block_script ) && !empty( $block_script ) ) {203 wp_enqueue_script( $block_name[0], '/' . $block_script[0], array( 'wp-editor', 'wp-blocks', 'wp-element', 'wp-i18n' ), FGC_VERSION, true);204 }205 if ( ( $pagenow == 'post-new.php' || $pagenow == 'post.php' || !is_admin() ) && isset( $block_style ) && !empty( $block_style ) ) {206 wp_enqueue_style( $block_name[0], '/' . $block_style[0], array(), FGC_VERSION);207 if ( isset( $editor_style ) && !empty( $editor_style ) && is_admin() ) {208 wp_enqueue_style( $block_name[0] . '-editor', '/' . $editor_style[0], array(), FGC_VERSION);209 }210 }211 }212 153 } 213 154 -
cloud-blocks/trunk/docs/changelog.md
r2020434 r2020451 4 4 * **Fix**: Fix some translations 5 5 * **Fix**: Fix database table issue if plugin network activated [issue #13](https://github.com/front/cloud-blocks/issues/13) 6 * **Cleanup**: Remove custom_blocks method since its not used anymore. This method was for scanning local blocks inside /wp-content/gutenberg-blocks directory 6 7 7 8 #### 1.1.2 -
cloud-blocks/trunk/readme.txt
r2020434 r2020451 79 79 * Fix: Fix some translations 80 80 * Fix: Fix database table issue if plugin network activated [issue #13](https://github.com/front/cloud-blocks/issues/13) 81 * Cleanup: Remove custom_blocks method since its not used anymore. This method was for scanning local blocks inside /wp-content/gutenberg-blocks directory 81 82 82 83 = 1.1.2 =
Note: See TracChangeset
for help on using the changeset viewer.