Changeset 2340904
- Timestamp:
- 07/15/2020 11:26:49 AM (6 years ago)
- Location:
- easycontent/trunk
- Files:
-
- 3 edited
-
app/Post.php (modified) (2 diffs)
-
easycontent-wp.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easycontent/trunk/app/Post.php
r2285656 r2340904 190 190 { 191 191 try { 192 $parameters = [ 193 'title' => $this->_wpPostObject->post_title, 194 'content' => $this->_wpPostObject->post_content, 195 'meta_title' => $this->getMetaTitle(), 196 'meta_description' => $this->getMetaDescription(), 197 'featured_image' => $this->getFeaturedImageUrl(), 198 'excerpt' => $this->_wpPostObject->post_excerpt, 199 'tags' => $this->getPostTagsNames(), 200 'custom_post_slug' => $this->getPostSlug() 201 ]; 202 203 if ( ! $this->isSynced() ) { 204 $parameters['categories'] = CategoriesMapper::getRelatedCategoriesList( $this->_wpPostObject ); 205 } 206 192 207 // Creates API model to perform requests 193 208 $article = ! $this->isSynced() 194 ? Article::create( [ 195 'title' => $this->_wpPostObject->post_title, 196 'content' => $this->_wpPostObject->post_content, 197 'categories' => CategoriesMapper::getRelatedCategoriesList( $this->_wpPostObject ), 198 'meta_title' => $this->getMetaTitle(), 199 'meta_description' => $this->getMetaDescription() 200 ] ) 201 : ( new Article( $this->getArticle()->id ) )->addNewRevision( [ 202 'title' => $this->_wpPostObject->post_title, 203 'content' => $this->_wpPostObject->post_content, 204 'meta_title' => $this->getMetaTitle(), 205 'meta_description' => $this->getMetaDescription() 206 ] ); 209 ? Article::create( $parameters ) 210 : ( new Article( $this->getArticle()->id ) )->addNewRevision( $parameters ); 207 211 208 212 … … 333 337 334 338 339 public function getFeaturedImageUrl() 340 { 341 return get_the_post_thumbnail_url( $this->_wpPostObject, 'full' ) ?: ''; 342 } 343 344 345 public function getPostSlug() 346 { 347 return get_post_field( 'post_name', $this->_wpPostObject ); 348 } 349 350 351 public function getPostTagsNames() 352 { 353 /** @var \WP_Term[]|false|\WP_Error */ 354 $tags = get_the_tags( $this->_wpPostObject->ID ); 355 356 if ( false === $tags || is_wp_error( $tags ) ) { 357 return []; 358 } 359 360 $strings = []; 361 362 /** @var \WP_Term $tag */ 363 foreach ( $tags as $tag ) { 364 $strings[] = $tag->name; 365 } 366 367 return $strings; 368 } 369 370 335 371 public function setContent($content = '') 336 372 { -
easycontent/trunk/easycontent-wp.php
r2327436 r2340904 4 4 * Plugin URI: https://easycontent.io 5 5 * Description: Imports articles from EasyContent to your wordpress site and exports articles from your wordpress site to EasyContent 6 * Version: 1.0. 46 * Version: 1.0.5 7 7 * Requires at least: 5.0.7 8 8 * Requires PHP: 5.6 … … 21 21 22 22 if ( ! defined( 'EASYCONTENT_PLUGIN_VERSION' ) ) { 23 define( 'EASYCONTENT_PLUGIN_VERSION', '1.0. 4' );23 define( 'EASYCONTENT_PLUGIN_VERSION', '1.0.5' ); 24 24 } 25 25 -
easycontent/trunk/readme.txt
r2327436 r2340904 4 4 Tags: easycontent, easy content, workflow, approval, collaboration, import, export, manage writers, publishing, content flow, editorial, approval process, content tool 5 5 Requires at least: 5.0.7 6 Tested up to: 5. 46 Tested up to: 5.3 7 7 Requires PHP: 5.6 8 8 Stable tag: 1.0.4 … … 61 61 == Changelog == 62 62 63 = 1.0.5 = 64 * Better EasyContent.io integration 65 63 66 = 1.0.4 = 64 67 * Plugin now uses only public API key
Note: See TracChangeset
for help on using the changeset viewer.