Changeset 2235501
- Timestamp:
- 01/29/2020 10:53:23 PM (6 years ago)
- Location:
- lndr-page-builder/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (3 diffs)
-
includes/class-lndr.php (modified) (2 diffs)
-
lndr.php (modified) (3 diffs)
-
public/class-lndr-public.php (modified) (8 diffs)
-
public/lndr_test.json (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lndr-page-builder/trunk/README.txt
r1768535 r2235501 5 5 Requires at least: 4.7 6 6 Tested up to: 4.8 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 39 39 https://wordpress.org/plugins/debug-bar/ (For general debugging) 40 40 41 = I have everything setup correctly, however my page is not being imported into WordPress = 41 = I have everything setup correctly, however my page is not being imported into WordPress = 42 42 43 43 If you do not see Lndr page published on your wordpress website. It might be because of the WordPress Cron (WP) cron and due to low traffic volume. For example, for WordPress sites hosted on WP engine, see https://wpengine.com/support/wp-cron-wordpress-scheduling/, by contacting support and enable "alternate cron" will resolve the issue … … 57 57 1.0 Fully working version 58 58 1.1 Added instant publishing feature 59 1.2 Added publish add root domain (using keyword lndr-frontpage) 59 60 60 61 == Upgrade notice == -
lndr-page-builder/trunk/includes/class-lndr.php
r1768535 r2235501 70 70 71 71 $this->plugin_name = 'Lndr'; 72 $this->version = '1. 1';72 $this->version = '1.2'; 73 73 74 74 $this->load_dependencies(); … … 164 164 $plugin_public = new Lndr_Public( $this->get_plugin_name(), $this->get_version()); 165 165 $this->loader->add_filter('page_template', $plugin_public, 'lndr_page_template'); 166 $this->loader->add_filter( 'frontpage_template', $plugin_public, 'lndr_page_template' ); 166 167 $this->loader->add_action('rest_api_init', $plugin_public, 'service_routes'); 167 168 // $this->loader->add_action('init', $plugin_public, 'rewrite_api_route'); -
lndr-page-builder/trunk/lndr.php
r1768535 r2235501 4 4 Description: This plugin allows you to publish pages from Lndr to Wordpress websites directly. 5 5 Author: Incc.io 6 Version: 1. 16 Version: 1.2 7 7 Author URI: http://www.lndr.co 8 8 */ … … 25 25 26 26 global $lndr_version; 27 $lndr_version = '1. 1';27 $lndr_version = '1.2'; 28 28 29 29 /** … … 45 45 if (get_site_option('lndr_version') != $lndr_version) { 46 46 // update for specific versions 47 if ($lndr_version == '1. 1') {47 if ($lndr_version == '1.2') { 48 48 // we had added a new service path for manual sync, however, there's no need to do anything 49 49 // as it is automatically added -
lndr-page-builder/trunk/public/class-lndr-public.php
r1768535 r2235501 1 1 <?php 2 2 const LNDR_API_GET_PROJECT = 'https://www.lndr.co/v1/projects'; 3 const LNDR_WP_HOMEPAGE_PATH = 'lndr-frontpage'; 3 4 4 5 … … 421 422 // update the new post meta 422 423 update_post_meta($existing_post_by_alias->ID, 'lndr_project_id', $page['id']); 424 // set the page to the frontpage if necessary 425 $this->set_front_page($existing_post_by_alias->ID, $path); 423 426 } 424 427 } … … 439 442 // @todo: catch error? 440 443 wp_update_post( $update_post ); 444 $this->set_front_page($existing_post_by_project_id->ID, $path); 441 445 } 442 446 } … … 455 459 ], 456 460 ]; 457 wp_insert_post($new_post); 461 $post_id = wp_insert_post($new_post); 462 if ((bool)$post_id) { 463 $this->set_front_page($post_id, $path); 464 } 458 465 } 459 466 } … … 479 486 return; 480 487 } 488 489 $frontpage_settings = get_option('show_on_front', 'posts'); 481 490 482 491 foreach ($existing_posts as $post_id => $project_id) { … … 486 495 // @todo: future there can be an archived stage = trash or archive 487 496 wp_delete_post($post_id, true); 497 // Check and reset frontpage settings as a fallback 498 $this->reset_front_page($post_id, $frontpage_settings); 488 499 } 489 500 else … … 494 505 // @todo: future there can be an archived stage = trash or archive 495 506 wp_delete_post($post_id, true); 507 $this->reset_front_page($post_id, $frontpage_settings); 496 508 } 497 509 } … … 541 553 542 554 /** 555 * Set the special page deployed to wordpress as the front_page 556 * @param $post_id | The ID of the page/post 557 * @param $path | The path of the page/post which should be the name of the page 558 */ 559 function set_front_page($post_id, $path) { 560 if ($path == LNDR_WP_HOMEPAGE_PATH) { 561 // Update this just in case 562 update_option('show_on_front', 'page'); 563 // Setting the front-page ID to our page 564 update_option('page_on_front', $post_id); 565 } 566 } 567 568 /** 569 * Resetting the frontpage to showing a list of posts 570 * @param $post_id | The post id of the page 571 * @param $front_settings | get_option('show_on_front', 'posts'); 572 */ 573 function reset_front_page($post_id, $front_settings = 'posts') { 574 if ($front_settings == 'page') { 575 $frontpage_id = get_option('page_on_front', 0); 576 if ($frontpage_id == $post_id) { 577 update_option('show_on_front', 'posts'); 578 update_option('page_on_front', 0); 579 } 580 } 581 } 582 583 /** 543 584 * Register our query parameter for WP to use 544 585 * @param $vars -
lndr-page-builder/trunk/public/lndr_test.json
r1767069 r2235501 2 2 "projects": [ 3 3 { 4 "id": " 81",5 "title": " Golf",4 "id": "72", 5 "title": "Sporty", 6 6 "description": "This is a smiple example project", 7 7 "keywords": "simple, example, landing, hello, world", 8 8 "template": "Sporty", 9 "editor_url": "http://www.lndr.co/projects/ 81/edit",10 "screenshot": "http:///www.lndr.co/project_files/ 81/screenshot.jpg?refresh=cb05d691b1a0ccc7eb4f426d",9 "editor_url": "http://www.lndr.co/projects/72/edit", 10 "screenshot": "http:///www.lndr.co/project_files/72/screenshot.jpg?refresh=cb05d691b1a0ccc7eb4f426d", 11 11 "url": "http:///p.lndr/sporty", 12 "publish_url": "http://localhost:8888/sandbox_ wp/golf",13 "published": " true",12 "publish_url": "http://localhost:8888/sandbox_d8/sports_demo", 13 "published": "false", 14 14 "created_at": "Thu, 18 May 2017 07:22:12 UTC +00:00", 15 15 "updated_at": "Mon, 22 May 2017 09:01:22 UTC +00:00"
Note: See TracChangeset
for help on using the changeset viewer.