Plugin Directory

Changeset 1789024


Ignore:
Timestamp:
12/18/2017 06:14:30 PM (8 years ago)
Author:
activeim
Message:

added variation content error handling

Location:
marketing-optimizer/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • marketing-optimizer/trunk/includes/class.mo_post_type.php

    r1787753 r1789024  
    525525     * Get variation content for editor
    526526     */
    527     public function mo_get_variation_content_for_editor($content, $post_id) {
    528        
     527    public function mo_get_variation_content_for_editor($content, $post_id) {       
    529528        global $post;
    530         $mo_obj = $this->get_obj_by_type($post_id);
    531         $v_id = $mo_obj->get_current_variation();
    532        
    533         if (get_post_type($post_id) === $this->get_mo_pt_post_type()) {
    534            
    535             try {
    536                 $content_tmp = $mo_obj->get_variation_property($v_id, 'content');
    537                 $content = ($content_tmp && $v_id===0)?$post->post_content:$content_tmp;
    538             } catch (Exception $e) {
    539                 $content = '';
    540             }
    541 
    542             return $content;
    543            
    544         }
     529           
     530        try {
     531            if (get_post_type($post_id) !== $this->get_mo_pt_post_type()) {     
     532                return $content;
     533            }
     534               
     535            $mo_obj = $this->get_obj_by_type($post_id);
     536            $variation_id = $mo_obj->get_current_variation();       
     537                 
     538            if ($variation_id !== 0) {
     539                $content_tmp = $mo_obj->get_variation_property($variation_id, 'content');
     540                $content = ($content_tmp) ? $content_tmp : $content;
     541            }
     542           
     543        } catch (Exception $e) {
     544            $content = '';
     545        }     
    545546
    546547        return $content;
  • marketing-optimizer/trunk/marketing-optimizer.php

    r1787753 r1789024  
    33 * Plugin Name: Marketing Optimizer for Wordpress Plugin
    44 * URI: http://www.marketingoptimizer.com/?apcid=8381
    5  * Version: 20171215
     5 * Version: 20171218
    66 * Description: Create Landing Pages for Wordpress
    77 * Author: Marketing Optimizer, customercare@marketingoptimizer.com
     
    2323    CONST MO_DIRECTORY = 'marketing-optimizer';
    2424
    25     public static $plugin_version = '20171215';
     25    public static $plugin_version = '20171218';
    2626
    2727    public static $plugin_name = 'marketing-optimizer';
  • marketing-optimizer/trunk/readme.txt

    r1787753 r1789024  
    109109
    110110== Changelog ==
     111= Version 20171218 =
     112* #bugFix added handling for setting variation content
    111113= Version 20171215 =
    112114* #bugFix fixed error with Divi theme page builder, switching between front-end visual editor and regular page editor lost content
Note: See TracChangeset for help on using the changeset viewer.