Changeset 3238468
- Timestamp:
- 02/11/2025 09:55:43 AM (13 months ago)
- Location:
- quickcreator
- Files:
-
- 6 edited
- 11 copied
-
tags/0.1.7 (copied) (copied from quickcreator/trunk)
-
tags/0.1.7/includes/admin/class-quickcreator-admin.php (copied) (copied from quickcreator/trunk/includes/admin/class-quickcreator-admin.php)
-
tags/0.1.7/includes/functions.php (copied) (copied from quickcreator/trunk/includes/functions.php)
-
tags/0.1.7/includes/quickcreator/class-content-importer.php (copied) (copied from quickcreator/trunk/includes/quickcreator/class-content-importer.php)
-
tags/0.1.7/includes/quickcreator/class-quickcreator.php (copied) (copied from quickcreator/trunk/includes/quickcreator/class-quickcreator.php) (1 diff)
-
tags/0.1.7/includes/quickcreator/content-parsers/class-classic-editor-parser.php (copied) (copied from quickcreator/trunk/includes/quickcreator/content-parsers/class-classic-editor-parser.php)
-
tags/0.1.7/includes/quickcreator/content-parsers/class-content-parser.php (modified) (17 diffs)
-
tags/0.1.7/includes/quickcreator/content-parsers/class-elementor-parser.php (copied) (copied from quickcreator/trunk/includes/quickcreator/content-parsers/class-elementor-parser.php)
-
tags/0.1.7/includes/quickcreator/content-parsers/class-gutenberg-parser.php (copied) (copied from quickcreator/trunk/includes/quickcreator/content-parsers/class-gutenberg-parser.php) (4 diffs)
-
tags/0.1.7/quickcreator.php (copied) (copied from quickcreator/trunk/quickcreator.php) (2 diffs)
-
tags/0.1.7/readme.txt (copied) (copied from quickcreator/trunk/readme.txt) (1 diff)
-
tags/0.1.7/templates/admin/settings.php (copied) (copied from quickcreator/trunk/templates/admin/settings.php)
-
trunk/includes/quickcreator/class-quickcreator.php (modified) (1 diff)
-
trunk/includes/quickcreator/content-parsers/class-content-parser.php (modified) (17 diffs)
-
trunk/includes/quickcreator/content-parsers/class-gutenberg-parser.php (modified) (4 diffs)
-
trunk/quickcreator.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
quickcreator/tags/0.1.7/includes/quickcreator/class-quickcreator.php
r3224032 r3238468 588 588 $saved_token = get_option('quickcreator_api_access_key', false); 589 589 590 file_put_contents(Quickcreator()->get_basedir() . '/dupasrala.txt', $received_token . ' - ' . $saved_token);591 592 590 if (null !== $received_token && false !== $saved_token && $received_token === $saved_token) { 593 591 return true; 594 592 } 593 594 file_put_contents(Quickcreator()->get_basedir() . '/dupasrala.txt', $received_token . ' - ' . $saved_token); 595 595 return false; 596 596 } -
quickcreator/tags/0.1.7/includes/quickcreator/content-parsers/class-content-parser.php
r3142565 r3238468 1 1 <?php 2 2 3 /** 3 4 * General Parser object, that handles all general parsing function. … … 12 13 * Object that imports data from different sources into WordPress. 13 14 */ 14 class Content_Parser { 15 class Content_Parser 16 { 15 17 16 18 /** … … 28 30 * @return string 29 31 */ 30 public function parse_content( $content ) { 31 32 $this->title = wp_strip_all_tags( $this->get_title_from_content( $content ) ); 32 public function parse_content($content) 33 { 34 35 $this->title = wp_strip_all_tags($this->get_title_from_content($content)); 33 36 34 37 return $content; … … 41 44 * @return string 42 45 */ 43 public function parse_title( $content ) { 44 return $this->get_title_from_content( $content ); 46 public function parse_title($content) 47 { 48 return $this->get_title_from_content($content); 45 49 } 46 50 … … 50 54 * @return string 51 55 */ 52 public function return_title() { 56 public function return_title() 57 { 53 58 54 59 return $this->title; … … 61 66 * @return void 62 67 */ 63 public function run_after_post_insert_actions( $post_id ) { 64 } 68 public function run_after_post_insert_actions($post_id) {} 65 69 66 70 … … 71 75 * @return string 72 76 */ 73 protected function get_title_from_content( $content ) { 74 75 preg_match( '~<h1[^>]*>(.*?)</h1>~i', $content, $match ); 77 protected function get_title_from_content($content) 78 { 79 80 preg_match('~<h1[^>]*>(.*?)</h1>~i', $content, $match); 76 81 $title = $match[1]; 77 82 … … 87 92 * @return string URL to image in media library. 88 93 */ 89 public function download_img_to_media_library( $image_url, $image_alt = '', $url_only = true ) { 90 91 $file_name = basename( $image_url ); 94 public function download_img_to_media_library($image_url, $image_alt = '', $url_only = true) 95 { 96 97 $file_name = basename($image_url); 92 98 $file_name = preg_replace('/\?.*$/', '', $file_name); 93 $file_name = sanitize_file_name( urlencode( $file_name ));94 $image_id = $this->find_image_by_name( $file_name);95 if ( 0 === $image_id) {96 $image_id = $this->upload_images_to_wp( $image_url);97 } 98 99 $this->update_image_alt( $image_id, $image_alt);100 $media_library_image_url = wp_get_attachment_url( $image_id);101 102 if ( $url_only) {99 $file_name = sanitize_file_name(urlencode($file_name)); 100 $image_id = $this->find_image_by_name($file_name); 101 if (0 === $image_id) { 102 $image_id = $this->upload_images_to_wp($image_url); 103 } 104 105 $this->update_image_alt($image_id, $image_alt); 106 $media_library_image_url = wp_get_attachment_url($image_id); 107 108 if ($url_only) { 103 109 return $media_library_image_url; 104 110 } … … 117 123 * @return int 118 124 */ 119 private function upload_images_to_wp( $image_url ) { 120 121 if ( empty( $image_url ) || ! wp_http_validate_url( $image_url ) ) { 125 private function upload_images_to_wp($image_url) 126 { 127 128 if (empty($image_url) || ! wp_http_validate_url($image_url)) { 122 129 return 0; 123 130 } … … 127 134 require_once ABSPATH . 'wp-admin/includes/image.php'; 128 135 129 $file_name = basename( $image_url);136 $file_name = basename($image_url); 130 137 $file_name = preg_replace('/\?.*$/', '', $file_name); 131 $tmp_directory = download_url( $image_url);138 $tmp_directory = download_url($image_url); 132 139 $content_type = ""; 133 140 134 $extension = pathinfo( $file_name, PATHINFO_EXTENSION);135 $headers = get_headers( $image_url);136 if ( empty( $extension ) || '' === $extension) {137 foreach ( $headers as $header) {138 if ( false !== strpos( $header, 'Content-Disposition' )) {139 preg_match( '~filename="(.*?)\.(.*?)"~i', $header, $match);141 $extension = pathinfo($file_name, PATHINFO_EXTENSION); 142 $headers = get_headers($image_url); 143 if (empty($extension) || '' === $extension) { 144 foreach ($headers as $header) { 145 if (false !== strpos($header, 'Content-Disposition')) { 146 preg_match('~filename="(.*?)\.(.*?)"~i', $header, $match); 140 147 $file_name .= '.' . $match[2]; 141 148 $extension = $match[2]; … … 145 152 } 146 153 147 foreach ( $headers as $header) {154 foreach ($headers as $header) { 148 155 if (false !== strpos($header, 'Content-Type')) { 149 preg_match('~Content-Type: (.*)~i', $header, $match);150 $content_type = trim($match[1]);151 if ( empty($extension) || '' === $extension) {152 preg_match('~.*/(.*)~i', $header, $match);153 $file_name .= '.' . $match[1];154 }155 break;156 preg_match('~Content-Type: (.*)~i', $header, $match); 157 $content_type = trim($match[1]); 158 if (empty($extension) || '' === $extension) { 159 preg_match('~.*/(.*)~i', $header, $match); 160 $file_name .= '.' . $match[1]; 161 } 162 break; 156 163 } 157 164 } 158 $file_name = sanitize_file_name( urlencode($file_name));165 $file_name = sanitize_file_name(urlencode($file_name)); 159 166 160 167 $file_array = array( … … 163 170 // 'type' => $content_type, 164 171 ); 165 if ( empty($extension) || '' === $extension) {166 $file_array['type'] = $content_type;167 } 168 169 $attachment_id = media_handle_sideload( $file_array);170 update_post_meta( $attachment_id, 'quickcreator_file_name', $file_name);171 @unlink( $tmp_directory); // phpcs:ignore172 if (empty($extension) || '' === $extension) { 173 $file_array['type'] = $content_type; 174 } 175 176 $attachment_id = media_handle_sideload($file_array); 177 update_post_meta($attachment_id, 'quickcreator_file_name', $file_name); 178 @unlink($tmp_directory); // phpcs:ignore 172 179 173 180 return $attachment_id; … … 180 187 * @return int 181 188 */ 182 private function find_image_by_name( $file_name ) { 189 private function find_image_by_name($file_name) 190 { 183 191 184 192 $image_id = 0; 185 193 186 $file_name = explode( '.', $file_name);194 $file_name = explode('.', $file_name); 187 195 $file_name = $file_name[0]; 188 196 189 197 $args = array( 190 198 'post_type' => 'attachment', 191 'name' => sanitize_title( $file_name),199 'name' => sanitize_title($file_name), 192 200 'posts_per_page' => 1, 193 201 'post_status' => 'inherit', 194 202 ); 195 203 196 $matching_images = get_posts( $args);197 198 if ( $matching_images) {199 $image = array_pop( $matching_images);204 $matching_images = get_posts($args); 205 206 if ($matching_images) { 207 $image = array_pop($matching_images); 200 208 $image_id = $image->ID; 201 209 } … … 211 219 * @return void 212 220 */ 213 private function update_image_alt( $image_id, $image_alt = '' ) { 214 215 if ( '' !== $image_alt ) { 216 update_post_meta( $image_id, '_wp_attachment_image_alt', trim( $image_alt ) ); 221 private function update_image_alt($image_id, $image_alt = '') 222 { 223 224 if ('' !== $image_alt) { 225 update_post_meta($image_id, '_wp_attachment_image_alt', trim($image_alt)); 217 226 } 218 227 } … … 224 233 * @return string 225 234 */ 226 protected function glue_attributes( $attributes_array ) { 235 protected function glue_attributes($attributes_array) 236 { 227 237 228 238 $attributes = ' '; 229 239 230 foreach ( $attributes_array as $key => $value) {240 foreach ($attributes_array as $key => $value) { 231 241 $attributes .= $key . '="' . $value . '" '; 232 242 } 233 $attributes = rtrim( $attributes);243 $attributes = rtrim($attributes); 234 244 235 245 return $attributes; … … 242 252 * @return string 243 253 */ 244 protected function get_inner_html( $node ) { 254 protected function get_inner_html($node) 255 { 245 256 $inner_html = ''; 246 257 247 258 // @codingStandardsIgnoreLine 248 foreach ( $node->childNodes as $child) {259 foreach ($node->childNodes as $child) { 249 260 250 261 // @codingStandardsIgnoreLine 251 $content = $child->ownerDocument->saveXML( $child);252 253 if ( '<li/>' !== $content) {262 $content = $child->ownerDocument->saveXML($child); 263 264 if ('<li/>' !== $content) { 254 265 $inner_html .= $content; 255 266 } … … 258 269 return $inner_html; 259 270 } 271 272 /** 273 * Extract inner HTML for provided node. 274 * 275 * @param DOMElement $node - node element to parse. 276 * @return string 277 */ 278 protected function get_raw_inner_html($node) 279 { 280 $inner_html = ''; 281 282 foreach ($node->childNodes as $child) { 283 284 $inner_html .= $child->ownerDocument->saveHTML($child); 285 } 286 287 return $inner_html; 288 } 260 289 } -
quickcreator/tags/0.1.7/includes/quickcreator/content-parsers/class-gutenberg-parser.php
r3173455 r3238468 95 95 } 96 96 97 if ('qc-block' === $node_type) { 98 $execute_for_child = false; 99 } 100 97 101 return $execute_for_child; 98 102 } … … 158 162 } 159 163 164 if ('qc-block' === $node_name) { 165 return $this->parse_node_quickcreator_block($node, $attributes, $gutenberg_attribute); 166 } 167 160 168 return ''; 161 169 } 170 162 171 163 172 … … 262 271 unset($attributes_array['style']); 263 272 } 273 } 274 275 276 /** 277 * Parses <p> node. 278 * 279 * @param DOMNode|DOMDocument|DOMElement $node - node to parse. 280 * @param array $attributes - HTML attributes for the node, example: class="" src="". 281 * @param string $gutenberg_attribute - Attributes for Gutenberg tag. 282 * @return string 283 */ 284 private function parse_node_quickcreator_block($node, $attributes, $gutenberg_attribute) 285 { 286 $attributes = $this->glue_attributes($attributes); 287 288 $node_content = $this->get_raw_inner_html($node); 289 if ('' === $node_content) { 290 return ''; 291 } 292 293 $content = '<!-- wp:html ' . $gutenberg_attribute . '-->' . PHP_EOL; 294 $content .= $node_content . PHP_EOL; 295 $content .= '<!-- /wp:html -->' . PHP_EOL . PHP_EOL; 296 297 return $content; 264 298 } 265 299 … … 346 380 $content .= '</div></figure>' . PHP_EOL; 347 381 $content .= '<!-- /wp:embed -->' . PHP_EOL . PHP_EOL; 348 382 349 383 return $content; 350 384 } -
quickcreator/tags/0.1.7/quickcreator.php
r3226047 r3238468 4 4 * Plugin URI: https://wordpress.org/plugins/quickcreator/ 5 5 * Description: Create post with Quickcreator in WordPress 6 * Version: 0.1. 66 * Version: 0.1.7 7 7 * Author: Quickcreator 8 8 * Author URI: https://quickcreator.io … … 22 22 23 23 if ( ! defined( 'QUICKCREATOR_BLOG_VERSION' ) ) { 24 define( 'QUICKCREATOR_BLOG_VERSION', '0.1. 2' );24 define( 'QUICKCREATOR_BLOG_VERSION', '0.1.7' ); 25 25 } 26 26 -
quickcreator/tags/0.1.7/readme.txt
r3226047 r3238468 5 5 Requires PHP: 7.4 6 6 Tested up to: 6.6 7 Stable tag: 0.1. 67 Stable tag: 0.1.7 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
quickcreator/trunk/includes/quickcreator/class-quickcreator.php
r3224032 r3238468 588 588 $saved_token = get_option('quickcreator_api_access_key', false); 589 589 590 file_put_contents(Quickcreator()->get_basedir() . '/dupasrala.txt', $received_token . ' - ' . $saved_token);591 592 590 if (null !== $received_token && false !== $saved_token && $received_token === $saved_token) { 593 591 return true; 594 592 } 593 594 file_put_contents(Quickcreator()->get_basedir() . '/dupasrala.txt', $received_token . ' - ' . $saved_token); 595 595 return false; 596 596 } -
quickcreator/trunk/includes/quickcreator/content-parsers/class-content-parser.php
r3142565 r3238468 1 1 <?php 2 2 3 /** 3 4 * General Parser object, that handles all general parsing function. … … 12 13 * Object that imports data from different sources into WordPress. 13 14 */ 14 class Content_Parser { 15 class Content_Parser 16 { 15 17 16 18 /** … … 28 30 * @return string 29 31 */ 30 public function parse_content( $content ) { 31 32 $this->title = wp_strip_all_tags( $this->get_title_from_content( $content ) ); 32 public function parse_content($content) 33 { 34 35 $this->title = wp_strip_all_tags($this->get_title_from_content($content)); 33 36 34 37 return $content; … … 41 44 * @return string 42 45 */ 43 public function parse_title( $content ) { 44 return $this->get_title_from_content( $content ); 46 public function parse_title($content) 47 { 48 return $this->get_title_from_content($content); 45 49 } 46 50 … … 50 54 * @return string 51 55 */ 52 public function return_title() { 56 public function return_title() 57 { 53 58 54 59 return $this->title; … … 61 66 * @return void 62 67 */ 63 public function run_after_post_insert_actions( $post_id ) { 64 } 68 public function run_after_post_insert_actions($post_id) {} 65 69 66 70 … … 71 75 * @return string 72 76 */ 73 protected function get_title_from_content( $content ) { 74 75 preg_match( '~<h1[^>]*>(.*?)</h1>~i', $content, $match ); 77 protected function get_title_from_content($content) 78 { 79 80 preg_match('~<h1[^>]*>(.*?)</h1>~i', $content, $match); 76 81 $title = $match[1]; 77 82 … … 87 92 * @return string URL to image in media library. 88 93 */ 89 public function download_img_to_media_library( $image_url, $image_alt = '', $url_only = true ) { 90 91 $file_name = basename( $image_url ); 94 public function download_img_to_media_library($image_url, $image_alt = '', $url_only = true) 95 { 96 97 $file_name = basename($image_url); 92 98 $file_name = preg_replace('/\?.*$/', '', $file_name); 93 $file_name = sanitize_file_name( urlencode( $file_name ));94 $image_id = $this->find_image_by_name( $file_name);95 if ( 0 === $image_id) {96 $image_id = $this->upload_images_to_wp( $image_url);97 } 98 99 $this->update_image_alt( $image_id, $image_alt);100 $media_library_image_url = wp_get_attachment_url( $image_id);101 102 if ( $url_only) {99 $file_name = sanitize_file_name(urlencode($file_name)); 100 $image_id = $this->find_image_by_name($file_name); 101 if (0 === $image_id) { 102 $image_id = $this->upload_images_to_wp($image_url); 103 } 104 105 $this->update_image_alt($image_id, $image_alt); 106 $media_library_image_url = wp_get_attachment_url($image_id); 107 108 if ($url_only) { 103 109 return $media_library_image_url; 104 110 } … … 117 123 * @return int 118 124 */ 119 private function upload_images_to_wp( $image_url ) { 120 121 if ( empty( $image_url ) || ! wp_http_validate_url( $image_url ) ) { 125 private function upload_images_to_wp($image_url) 126 { 127 128 if (empty($image_url) || ! wp_http_validate_url($image_url)) { 122 129 return 0; 123 130 } … … 127 134 require_once ABSPATH . 'wp-admin/includes/image.php'; 128 135 129 $file_name = basename( $image_url);136 $file_name = basename($image_url); 130 137 $file_name = preg_replace('/\?.*$/', '', $file_name); 131 $tmp_directory = download_url( $image_url);138 $tmp_directory = download_url($image_url); 132 139 $content_type = ""; 133 140 134 $extension = pathinfo( $file_name, PATHINFO_EXTENSION);135 $headers = get_headers( $image_url);136 if ( empty( $extension ) || '' === $extension) {137 foreach ( $headers as $header) {138 if ( false !== strpos( $header, 'Content-Disposition' )) {139 preg_match( '~filename="(.*?)\.(.*?)"~i', $header, $match);141 $extension = pathinfo($file_name, PATHINFO_EXTENSION); 142 $headers = get_headers($image_url); 143 if (empty($extension) || '' === $extension) { 144 foreach ($headers as $header) { 145 if (false !== strpos($header, 'Content-Disposition')) { 146 preg_match('~filename="(.*?)\.(.*?)"~i', $header, $match); 140 147 $file_name .= '.' . $match[2]; 141 148 $extension = $match[2]; … … 145 152 } 146 153 147 foreach ( $headers as $header) {154 foreach ($headers as $header) { 148 155 if (false !== strpos($header, 'Content-Type')) { 149 preg_match('~Content-Type: (.*)~i', $header, $match);150 $content_type = trim($match[1]);151 if ( empty($extension) || '' === $extension) {152 preg_match('~.*/(.*)~i', $header, $match);153 $file_name .= '.' . $match[1];154 }155 break;156 preg_match('~Content-Type: (.*)~i', $header, $match); 157 $content_type = trim($match[1]); 158 if (empty($extension) || '' === $extension) { 159 preg_match('~.*/(.*)~i', $header, $match); 160 $file_name .= '.' . $match[1]; 161 } 162 break; 156 163 } 157 164 } 158 $file_name = sanitize_file_name( urlencode($file_name));165 $file_name = sanitize_file_name(urlencode($file_name)); 159 166 160 167 $file_array = array( … … 163 170 // 'type' => $content_type, 164 171 ); 165 if ( empty($extension) || '' === $extension) {166 $file_array['type'] = $content_type;167 } 168 169 $attachment_id = media_handle_sideload( $file_array);170 update_post_meta( $attachment_id, 'quickcreator_file_name', $file_name);171 @unlink( $tmp_directory); // phpcs:ignore172 if (empty($extension) || '' === $extension) { 173 $file_array['type'] = $content_type; 174 } 175 176 $attachment_id = media_handle_sideload($file_array); 177 update_post_meta($attachment_id, 'quickcreator_file_name', $file_name); 178 @unlink($tmp_directory); // phpcs:ignore 172 179 173 180 return $attachment_id; … … 180 187 * @return int 181 188 */ 182 private function find_image_by_name( $file_name ) { 189 private function find_image_by_name($file_name) 190 { 183 191 184 192 $image_id = 0; 185 193 186 $file_name = explode( '.', $file_name);194 $file_name = explode('.', $file_name); 187 195 $file_name = $file_name[0]; 188 196 189 197 $args = array( 190 198 'post_type' => 'attachment', 191 'name' => sanitize_title( $file_name),199 'name' => sanitize_title($file_name), 192 200 'posts_per_page' => 1, 193 201 'post_status' => 'inherit', 194 202 ); 195 203 196 $matching_images = get_posts( $args);197 198 if ( $matching_images) {199 $image = array_pop( $matching_images);204 $matching_images = get_posts($args); 205 206 if ($matching_images) { 207 $image = array_pop($matching_images); 200 208 $image_id = $image->ID; 201 209 } … … 211 219 * @return void 212 220 */ 213 private function update_image_alt( $image_id, $image_alt = '' ) { 214 215 if ( '' !== $image_alt ) { 216 update_post_meta( $image_id, '_wp_attachment_image_alt', trim( $image_alt ) ); 221 private function update_image_alt($image_id, $image_alt = '') 222 { 223 224 if ('' !== $image_alt) { 225 update_post_meta($image_id, '_wp_attachment_image_alt', trim($image_alt)); 217 226 } 218 227 } … … 224 233 * @return string 225 234 */ 226 protected function glue_attributes( $attributes_array ) { 235 protected function glue_attributes($attributes_array) 236 { 227 237 228 238 $attributes = ' '; 229 239 230 foreach ( $attributes_array as $key => $value) {240 foreach ($attributes_array as $key => $value) { 231 241 $attributes .= $key . '="' . $value . '" '; 232 242 } 233 $attributes = rtrim( $attributes);243 $attributes = rtrim($attributes); 234 244 235 245 return $attributes; … … 242 252 * @return string 243 253 */ 244 protected function get_inner_html( $node ) { 254 protected function get_inner_html($node) 255 { 245 256 $inner_html = ''; 246 257 247 258 // @codingStandardsIgnoreLine 248 foreach ( $node->childNodes as $child) {259 foreach ($node->childNodes as $child) { 249 260 250 261 // @codingStandardsIgnoreLine 251 $content = $child->ownerDocument->saveXML( $child);252 253 if ( '<li/>' !== $content) {262 $content = $child->ownerDocument->saveXML($child); 263 264 if ('<li/>' !== $content) { 254 265 $inner_html .= $content; 255 266 } … … 258 269 return $inner_html; 259 270 } 271 272 /** 273 * Extract inner HTML for provided node. 274 * 275 * @param DOMElement $node - node element to parse. 276 * @return string 277 */ 278 protected function get_raw_inner_html($node) 279 { 280 $inner_html = ''; 281 282 foreach ($node->childNodes as $child) { 283 284 $inner_html .= $child->ownerDocument->saveHTML($child); 285 } 286 287 return $inner_html; 288 } 260 289 } -
quickcreator/trunk/includes/quickcreator/content-parsers/class-gutenberg-parser.php
r3173455 r3238468 95 95 } 96 96 97 if ('qc-block' === $node_type) { 98 $execute_for_child = false; 99 } 100 97 101 return $execute_for_child; 98 102 } … … 158 162 } 159 163 164 if ('qc-block' === $node_name) { 165 return $this->parse_node_quickcreator_block($node, $attributes, $gutenberg_attribute); 166 } 167 160 168 return ''; 161 169 } 170 162 171 163 172 … … 262 271 unset($attributes_array['style']); 263 272 } 273 } 274 275 276 /** 277 * Parses <p> node. 278 * 279 * @param DOMNode|DOMDocument|DOMElement $node - node to parse. 280 * @param array $attributes - HTML attributes for the node, example: class="" src="". 281 * @param string $gutenberg_attribute - Attributes for Gutenberg tag. 282 * @return string 283 */ 284 private function parse_node_quickcreator_block($node, $attributes, $gutenberg_attribute) 285 { 286 $attributes = $this->glue_attributes($attributes); 287 288 $node_content = $this->get_raw_inner_html($node); 289 if ('' === $node_content) { 290 return ''; 291 } 292 293 $content = '<!-- wp:html ' . $gutenberg_attribute . '-->' . PHP_EOL; 294 $content .= $node_content . PHP_EOL; 295 $content .= '<!-- /wp:html -->' . PHP_EOL . PHP_EOL; 296 297 return $content; 264 298 } 265 299 … … 346 380 $content .= '</div></figure>' . PHP_EOL; 347 381 $content .= '<!-- /wp:embed -->' . PHP_EOL . PHP_EOL; 348 382 349 383 return $content; 350 384 } -
quickcreator/trunk/quickcreator.php
r3226047 r3238468 4 4 * Plugin URI: https://wordpress.org/plugins/quickcreator/ 5 5 * Description: Create post with Quickcreator in WordPress 6 * Version: 0.1. 66 * Version: 0.1.7 7 7 * Author: Quickcreator 8 8 * Author URI: https://quickcreator.io … … 22 22 23 23 if ( ! defined( 'QUICKCREATOR_BLOG_VERSION' ) ) { 24 define( 'QUICKCREATOR_BLOG_VERSION', '0.1. 2' );24 define( 'QUICKCREATOR_BLOG_VERSION', '0.1.7' ); 25 25 } 26 26 -
quickcreator/trunk/readme.txt
r3226047 r3238468 5 5 Requires PHP: 7.4 6 6 Tested up to: 6.6 7 Stable tag: 0.1. 67 Stable tag: 0.1.7 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.