Plugin Directory

Changeset 1812062


Ignore:
Timestamp:
01/30/2018 04:33:32 PM (8 years ago)
Author:
tildapublishing
Message:

fix error in WP4.9

Location:
tilda-publishing
Files:
23 added
4 edited

Legend:

Unmodified
Added
Removed
  • tilda-publishing/trunk/class.tilda-admin.php

    r1721030 r1812062  
    191191
    192192        $data = get_post_meta($postID, '_tilda', true);
    193         if (! is_array($data)) {
    194             $data = array();
    195         }
    196193        foreach($_POST['tilda'] as $key => $val) {
    197194            $data[sanitize_key($key)] = esc_html($val);
     
    482479        $uniq = array();
    483480
    484         foreach($tildapage->images as $image) {
    485             if( isset($uniq[$image->from]) ){ continue; }
    486             $uniq[$image->from] = 1;
    487 
    488             if ($export_imgpath > '') {
    489                 $exportimages[] = '|'.$export_imgpath.'/'.$image->to.'|i';
    490             } else {
    491                 $exportimages[] = '|'.$image->to.'|i';
    492             }
    493             $replaceimages[] = $upload_path.$image->to;
     481        if (is_array($tildapage->images)) {
     482            foreach($tildapage->images as $image) {
     483                if( isset($uniq[$image->from]) ){ continue; }
     484                $uniq[$image->from] = 1;
     485
     486                if ($export_imgpath > '') {
     487                    $exportimages[] = '|'.$export_imgpath.'/'.$image->to.'|i';
     488                } else {
     489                    $exportimages[] = '|'.$image->to.'|i';
     490                }
     491                $replaceimages[] = $upload_path.$image->to;
     492            }
    494493        }
    495494        $html = preg_replace($exportimages, $replaceimages, $tildapage->html);
     
    538537            $meta = array();
    539538        }
    540 
    541539        $meta['export_imgpath'] = $project->export_imgpath;
    542540        $meta['export_csspath'] = $project->export_csspath;
  • tilda-publishing/trunk/class.tilda.php

    r1721033 r1812062  
    7070    {
    7171    }
    72    
     72
    7373    public static function plugin_activation()
    7474    {
     
    155155        if (
    156156            $_SERVER['REMOTE_ADDR']<>"194.177.22.186"
    157             && $_SERVER['REMOTE_ADDR']<>"31.186.102.154"
    158             && $_SERVER['REMOTE_ADDR']<>"31.186.102.155"
    159             && $_SERVER['REMOTE_ADDR']<>"31.186.102.156"
     157            && $_SERVER['REMOTE_ADDR']<>'95.213.201.187'
    160158        ) {
    161159            echo "Access denied";
     
    242240            }
    243241
    244 
    245242            if (isset($data) && isset($data["status"]) && $data["status"] == 'on') {
    246243                $page = self::get_local_page($data["page_id"],$data["project_id"], $post->ID);
     
    249246                $js_links = $page->js;
    250247
    251                 foreach ($css_links as $file) {
    252                     $name = basename($file);
    253                     wp_enqueue_style($name, $file);
     248                if (is_array($css_links)) {
     249                    foreach ($css_links as $file) {
     250                        $name = basename($file);
     251                        wp_enqueue_style($name, $file);
     252                    }
    254253                }
    255254
    256                 foreach ($js_links as $file) {
    257                     $name = basename($file);
    258                     wp_enqueue_script($name, $file);
     255                if (is_array($js_links)) {
     256                    foreach ($js_links as $file) {
     257                        $name = basename($file);
     258                        wp_enqueue_script($name, $file);
     259                    }
    259260                }
    260261            }
     
    320321            if (! empty($page->html)) {
    321322                remove_filter( 'the_content', 'wpautop' );
     323                remove_filter( 'the_excerpt', 'wpautop' );
    322324                return $page->html;
    323325            }
     
    495497        $ar = array();
    496498        if (sizeof($page->css) == 0) {
    497             foreach($projects[$project_id]->css as $css) {
    498                 $ar[] = $upload_path . 'css/'.$css->to;
     499            if (is_array($projects[$project_id]->css)) {
     500                foreach($projects[$project_id]->css as $css) {
     501                    $ar[] = $upload_path . 'css/'.$css->to;
     502                }
    499503            }
    500504            $page->css = $ar;
     
    503507        if (sizeof($page->js) == 0) {
    504508            $ar = array();
    505             foreach($projects[$project_id]->js as $js) {
    506                 $ar[] = $upload_path . 'js/' . $js->to;
     509            if (is_array($projects[$project_id]->js)) {
     510                foreach($projects[$project_id]->js as $js) {
     511                    $ar[] = $upload_path . 'js/' . $js->to;
     512                }
    507513            }
    508514            $page->js = $ar;
  • tilda-publishing/trunk/readme.txt

    r1721030 r1812062  
    55Requires at least: 3.0.1
    66Tested up to: 4.1
    7 Stable tag: 0.2.24
     7Stable tag: 0.2.25
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6565== Changelog ==
    6666
    67 = 0.2.24 =
    68 * fix: add check rule if meta data not found (fix error: undefined index)
    69 
    70 = 0.2.23 =
    71 * fix: wpautop and add check rule
     67= 0.2.25 =
     68* fix: bug in WP4.9
    7269
    7370= 0.2.22 =
  • tilda-publishing/trunk/tilda-wordpress-plugin.php

    r1721030 r1812062  
    33Plugin Name: Tilda Publishing
    44Description: Tilda позволяет делать яркую подачу материала, качественную верстку и эффектную типографику, близкую к журнальной. Каким бы ни был ваш контент — Tilda знает, как его показать. С чего начать: 1) Нажмите ссылку «Активировать» слева от этого описания; 2) <a href="http://www.tilda.cc/" target="_blank">Зарегистрируйтесь</a>, чтобы получить API-ключ; 3) Перейдите на страницу настройки Tilda Publishing и введите свой API-ключ. Читайте подробную инструкцию по подключению.
    5 Version: 0.2.24
     5Version: 0.2.25
    66Author: Tilda Publishing
    77License: GPLv2 or later
    88Text Domain: api tilda
    99
    10 Update 0.2.24 - fix: add check rule if meta data not found (fix error: undefined index)
     10Update 0.2.25 - fix: bug in WP4.9
    1111
    1212Update 0.2.23 - fix: wpautop and add check rule
     
    6868}
    6969
    70 define( 'TILDA_VERSION', '0.2.24' );
     70define( 'TILDA_VERSION', '0.2.25' );
    7171define( 'TILDA_MINIMUM_WP_VERSION', '3.1' );
    7272define( 'TILDA_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.